/** * Determines if this file can be written to. * * @return <code>true</code> if this file is writeable, <code>false</code> if not. */ public boolean isWriteable() throws FileSystemException { return getFileSystem().hasCapability(Capability.WRITE_CONTENT); }
/** * Handles an out-of-date file. */ protected void handleOutOfDateFile(final FileObject srcFile, final FileObject destFile) throws FileSystemException { log("Copying " + srcFile + " to " + destFile); destFile.copyFrom(srcFile, Selectors.SELECT_SELF); if (preserveLastModified && srcFile.getFileSystem().hasCapability(Capability.GET_LAST_MODIFIED) && destFile.getFileSystem().hasCapability(Capability.SET_LAST_MODIFIED_FILE)) { final long lastModTime = srcFile.getContent().getLastModifiedTime(); destFile.getContent().setLastModifiedTime(lastModTime); } }
/** * Handles a single source file. */ protected void handleOutOfDateFile(final FileObject srcFile, final FileObject destFile) throws FileSystemException { if (!tryRename || !srcFile.canRenameTo(destFile)) { super.handleOutOfDateFile(srcFile, destFile); log("Deleting " + srcFile); srcFile.delete(Selectors.SELECT_SELF); } else { log("Rename " + srcFile + " to " + destFile); srcFile.moveTo(destFile); if (!isPreserveLastModified() && destFile.getFileSystem().hasCapability(Capability.SET_LAST_MODIFIED_FILE)) { destFile.getContent().setLastModifiedTime(System.currentTimeMillis()); } } } }
if (!getFileSystem().hasCapability(Capability.RANDOM_ACCESS_READ)) if (!getFileSystem().hasCapability(Capability.RANDOM_ACCESS_WRITE))
if (bAppend && !getFileSystem().hasCapability(Capability.APPEND_CONTENT))
if (((destFile.getType().hasContent() && destFile.getFileSystem().hasCapability(Capability.SET_LAST_MODIFIED_FILE)) || (destFile.getType().hasChildren() && destFile.getFileSystem().hasCapability(Capability.SET_LAST_MODIFIED_FOLDER))) && getFileSystem().hasCapability(Capability.GET_LAST_MODIFIED))