You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
FileStore.getBlockSize() should return the configuration block size #183
@Test
void test() throws IOException {
var blockSize = 1 << 12;
var configuration = Configuration.unix().toBuilder().setBlockSize(blockSize).build();
var fs = Jimfs.newFileSystem(configuration);
var path = fs.getPath("/home/test/test.txt");
var store = Files.getFileStore(path);
assertThat(store.getBlockSize()).isEqualTo(blockSize);
}
I'm explicitly setting the block size, but I get an IOException when the test case is run:
java.lang.UnsupportedOperationException
at java.base/java.nio.file.FileStore.getBlockSize(FileStore.java:158)
...
I would expect the store to return the block size instead.
Activity
ogregoire commentedon Mar 31, 2022
I noticed that the method is new since Java 10. So I guess that a multi-release JAR must be created.
I worked a bit on it and found that it's possible to create such multi-release jar with the following changes:
JimfsFileStore.javatojimfs/src/main/java10/com/google/common/jimfs/.jimfs/pom.xml:My only issue was with the tests, hence why I didn't provide a full-blown PR: I don't know how to make tests for a Multi-release project.
Return configured block size from `FileStore.getBlockSize()`.