/** * Return the size of this file * * @return the file size in bytes */ public long getSize() { return getCurrentBytes().length; }
/** * Create and return an InputStream for reading the contents of the file represented by this entry * * @return an InputStream */ public InputStream createInputStream() { return new ByteArrayInputStream(getCurrentBytes()); }
/** * Return a new FileSystemEntry that is a clone of this object, except having the specified path * * @param path - the new path value for the cloned file system entry * @return a new FileSystemEntry that has all the same values as this object except for its path */ public FileSystemEntry cloneWithNewPath(String path) { FileEntry clone = new FileEntry(path); clone.setLastModified(getLastModified()); clone.setOwner(getOwner()); clone.setGroup(getGroup()); clone.setPermissions(getPermissions()); clone.setContents(getCurrentBytes()); return clone; }