@Override public boolean isReadOnly() { return delegate.isReadOnly(); }
private static void checkGcs() { FileSystem fs = FileSystems.getFileSystem(URI.create("gs://domain-registry-alpha")); System.out.println("Success! We can instantiate a gs:// filesystem."); System.out.println("isOpen: " + fs.isOpen()); System.out.println("isReadOnly: " + fs.isReadOnly()); } }
@Test public void testGetters() throws IOException { try (FileSystem fs = CloudStorageFileSystem.forBucket("bucket")) { assertThat(fs.isOpen()).isTrue(); assertThat(fs.isReadOnly()).isFalse(); assertThat(fs.getRootDirectories()).containsExactly(fs.getPath("/")); assertThat(fs.getFileStores()).isEmpty(); assertThat(fs.getSeparator()).isEqualTo("/"); assertThat(fs.supportedFileAttributeViews()).containsExactly("basic", "gcs"); } }
@Override public boolean isReadOnly() { return rootFs.isReadOnly(); }
@Override public boolean isReadOnly() { return rootFs.isReadOnly(); }
@Override public boolean isReadOnly() { return rootFs.isReadOnly(); }
@Override public boolean isReadOnly() { return getOrigFS().isReadOnly(); }
@Override public boolean isReadOnly() {return wrapped().isReadOnly();}
@Test @Category( { Readonly.class } ) public void testReadonyFileInReadonlyFS() throws IOException { assertThat( getFile().getFileSystem().isReadOnly(), is( true ) ); }
/** * Return a read only version of a filesystem, if necessary * * <p>If the filesystem given as an argument is already read only (ie, * {@link FileSystem#isReadOnly()} returns true), this * method will return the filesystem itself.</p> * * @param fs the filesystem * @return a read only filesystem */ @Nonnull @WillNotClose public static FileSystem readOnly(final FileSystem fs) { Objects.requireNonNull(fs); return fs.isReadOnly() ? fs : new ReadOnlyFileSystem(fs); } }
if( osource.getFileSystem().isReadOnly() ) { throw new ReadOnlyFileSystemException();
@Test public void isReadOnly() { Assert.assertFalse("ShrinkWrap File Systems are not read-only", fileSystem.isReadOnly()); }
public static void main(String[] args) { System.out.println(System.getProperty("os.name")); FileSystem fsys = FileSystems.getDefault(); for(FileStore fs : fsys.getFileStores()) show("File Store", fs); for(Path rd : fsys.getRootDirectories()) show("Root Directory", rd); show("Separator", fsys.getSeparator()); show("UserPrincipalLookupService", fsys.getUserPrincipalLookupService()); show("isOpen", fsys.isOpen()); show("isReadOnly", fsys.isReadOnly()); show("FileSystemProvider", fsys.provider()); show("File Attribute Views", fsys.supportedFileAttributeViews()); } }
if( osource.getFileSystem().isReadOnly() ) { throw new ReadOnlyFileSystemException();