protected void ensureFileHasContent(final FileObject file) throws FileSystemException { assert file != null; if (!file.getType().hasContent()) { FileObjects.close(file); throw new ResultNotification("File has no content: " + file.getName(), Result.FAILURE); } }
protected void ensureFileHasContent(final FileObject file) throws FileSystemException { assert file != null; if (!file.getType().hasContent()) { FileObjects.close(file); throw new ResultNotification("File has no content: " + file.getName(), Result.FAILURE); } }
protected void ensureFileHasContent(final FileObject file) throws FileSystemException { assert file != null; if (!file.getType().hasContent()) { FileObjects.close(file); throw new ResultNotification("File has no content: " + file.getName(), Result.FAILURE); } } }
return Result.FAILURE; else if (!file.getType().hasContent()) { io.error("File has no content: {}", file.getName()); return Result.FAILURE;
/** * Returns the size of the content (in bytes). */ public long getSize() throws FileSystemException { // Do some checking if (!file.getType().hasContent()) { throw new FileSystemException("vfs.provider/get-size-not-file.error", file); } /* if (getThreadData().getState() == STATE_WRITING || getThreadData().getState() == STATE_RANDOM_ACCESS) { throw new FileSystemException("vfs.provider/get-size-write.error", file); } */ try { // Get the size return file.doGetContentSize(); } catch (final Exception exc) { throw new FileSystemException("vfs.provider/get-size.error", new Object[]{file}, exc); } }
/** * Returns an input stream to use to read the content of the file. */ public InputStream getInputStream() throws FileSystemException { if (!getType().hasContent()) { throw new FileSystemException("vfs.provider/read-not-file.error", name); } if (!isReadable()) { throw new FileSystemException("vfs.provider/read-not-readable.error", name); } // Get the raw input stream try { return doGetInputStream(); } catch (final Exception exc) { throw new FileSystemException("vfs.provider/read.error", name, exc); } }
if (file.getType().hasContent())
if (srcFile.getType().hasContent())
return Result.FAILURE; else if (!file.getType().hasContent()) { io.error("File has not content: {}", file.getName()); return Result.FAILURE;
if (getType() != FileType.IMAGINARY && !getType().hasContent())
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))