public boolean isWriteable() { try { return getBackend().isWriteable(); } catch ( FileSystemException e ) { throw new RuntimeException( e ); } } }
if ( !output.isWriteable() ) { box = new MessageBox( shell, SWT.ICON_QUESTION | SWT.APPLICATION_MODAL | SWT.SHEET | SWT.OK | SWT.CANCEL ); box.setText( BaseMessages.getString( PKG, "RepositoryExportProgressDialog.ExportFileDialog.AreadyExists" ) );
extraData[outputIndex++] = Boolean.valueOf( data.file.isWriteable() );
extraData[outputIndex++] = Boolean.valueOf( data.file.isWriteable() );
/** * Determines if this file can be written to. */ @Override protected boolean doIsWriteable() throws FileSystemException { if (file != null) { return file.isWriteable(); } return false; }
@Override public boolean isReadOnly() { try { return file.isWriteable(); } catch (FileSystemException e) { return true; } }
/** * Determines if this file can be written to. */ @Override protected boolean doIsWriteable() throws FileSystemException { if (file != null) { return file.isWriteable(); } return false; }
/** * Determines if this file can be written to. */ @Override protected boolean doIsWriteable() throws FileSystemException { if (file != null) { return file.isWriteable(); } return false; }
@Override public boolean isWriteable() throws FileSystemException { return decoratedFileObject.isWriteable(); }
@Override public boolean isWriteable() throws FileSystemException { return decoratedFileObject.isWriteable(); }
@Override public boolean isWriteable() { try { return this.fileObject.isWriteable(); } catch (FileSystemException e) { throw new VFSFileSystemException(e); } }
@Override public boolean isReadOnly() { try { return !_fileObject.isWriteable(); } catch (FileSystemException e) { throw new ResourceException(this, e); } }
@Override public boolean isReadOnly() { try { return !_fileObject.isWriteable(); } catch (final FileSystemException e) { throw new ResourceException(this, e); } }
@Override public boolean isWriteable() { try { return this.fileObject.isWriteable(); } catch (FileSystemException e) { throw new VFSFileSystemException(e); } }
private void writeFile(FileObject file, String content) throws IOException { if (!file.isWriteable()) { throw new IOException("Can't write into file"); } try (OutputStream outputStream = file.getContent().getOutputStream()) { if (content != null) { outputStream.write(content.getBytes(Charset.forName("UTF-8"))); //$NON-NLS-1$ } } }
/** * Tests that test folder iswritable. */ public void testFolderIsWritable() throws Exception { final FileObject folder = getWriteFolder().resolveFile("dir1"); Assert.assertTrue(folder.isWriteable()); }
/** * Tests that test folder iswritable. */ public void testFolderIsWritable() throws Exception { final FileObject folder = getWriteFolder().resolveFile("dir1"); Assert.assertTrue(folder.isWriteable()); }
/** * Tests that test folder iswritable. */ public void testFolderIsWritable() throws Exception { final FileObject folder = getWriteFolder().resolveFile("dir1"); Assert.assertTrue(folder.isWriteable()); }
@Test public void testIsWritable() throws Exception { final FileObject fo = manager.resolveFile(TEST_DIR1); Assert.assertNotNull(fo); Assert.assertFalse(fo.exists()); // Create the test file final FileObject file = createTestFile(hdfs); Assert.assertTrue(fo.exists()); Assert.assertFalse(file.isWriteable()); }
@Test public void testIsWritable() throws Exception { final FileObject fo = manager.resolveFile(TEST_DIR1); Assert.assertNotNull(fo); Assert.assertFalse(fo.exists()); // Create the test file final FileObject file = createTestFile(hdfs); Assert.assertTrue(fo.exists()); Assert.assertFalse(file.isWriteable()); }