@Override public long size() { final long size = entry.getSize(DATA); return UNKNOWN == size ? 0 : size; }
@Override public String getTimeWrittenDate() { final long time = node().getTime(WRITE); return UNKNOWN == time ? null : new Date(time).toString(); }
private static @CheckForNull Set<String> members(@CheckForNull FsNode entry) { return null == entry ? null : entry.getMembers(); }
if (null == srcEntry) throw new NoSuchFileException(src.toString()); if (!srcEntry.isType(FILE)) throw new FileSystemException(src.toString(), null, "Expected type FILE, but is " + srcEntry.getTypes() + "!"); if (null != dstEntry) { if (o.get(EXCLUSIVE)) throw new FileAlreadyExistsException(dst.toString()); if (dstEntry.isType(DIRECTORY)) dst.delete();
@Override public boolean isOther() { return entry.isType(SPECIAL); }
@Override public boolean isSymbolicLink() { return entry.isType(SYMLINK); }
@Override public Long getTimeWrittenMillis() { final long time = node().getTime(WRITE); return UNKNOWN == time ? null : time; }
private long sizeOf(Size type) { return node().getSize(type); }
@Override public boolean isRegularFile() { return entry.isType(FILE); }
final Set<String> members = entry.getMembers(); return null == members ? null : members.toArray(new String[members.size()]);
@Override public String getTimeCreatedDate() { final long time = node().getTime(CREATE); return UNKNOWN == time ? null : new Date(time).toString(); }
/** * Returns the (uncompressed) length of the file. * The length returned of a valid archive file is {@code 0} in order * to properly emulate virtual directories across all platforms. * <p> * For archive file validation its virtual file system gets mounted. * In case a RAES encrypted ZIP file gets mounted, the user gets prompted * for its password unless the default configuration for key management * hasn't been overridden. * * @see <a href="#falsePositives">Detecting Archive Paths and False Positives</a> */ @Override @FsAssertion(atomic=YES, consistent=YES, isolated=YES, durable=NOT_APPLICABLE) public long length() { if (null != innerArchive) { final FsNode entry; try { entry = innerArchive.getController() .node(getAccessPreferences(), getNodeName()); } catch (final IOException ex) { return 0; } if (null == entry) return 0; final long size = entry.getSize(Size.DATA); return UNKNOWN != size ? size : 0; } return file.length(); }
@Override public boolean isDirectory() { return entry.isType(DIRECTORY); }
final FsNode entry = stat(path); final Set<String> set; if (null == entry || null == (set = entry.getMembers())) throw new NotDirectoryException(path.toString());
@Override public Long getTimeReadMillis() { final long time = node().getTime(READ); return UNKNOWN == time ? null : time; }
/** * Similar to its super class implementation, but returns * {@code false} for a valid archive file, too. * <p> * For archive file validation its virtual file system gets mounted. * In case a RAES encrypted ZIP file gets mounted, the user gets prompted * for its password unless the default configuration for key management * hasn't been overridden. * * @see <a href="#falsePositives">Detecting Archive Paths and False Positives</a> */ @Override @FsAssertion(atomic=YES, consistent=YES, isolated=YES, durable=NOT_APPLICABLE) public boolean isFile() { if (null != innerArchive) { try { final FsNode entry = innerArchive.getController() .node(getAccessPreferences(), getNodeName()); return null != entry && entry.isType(FILE); } catch (IOException ex) { return false; } } return file.isFile(); }
@Override public Long getTimeCreatedMillis() { final long time = node().getTime(CREATE); return UNKNOWN == time ? null : time; }
/** * Similar to its super class implementation, but returns * {@code true} for a valid archive file, too. * <p> * For archive file validation its virtual file system gets mounted. * In case a RAES encrypted ZIP file gets mounted, the user gets prompted * for its password unless the default configuration for key management * hasn't been overridden. * * @see <a href="#falsePositives">Detecting Archive Paths and False Positives</a> * @see #isArchive * @see #isEntry */ @Override @FsAssertion(atomic=YES, consistent=YES, isolated=YES, durable=NOT_APPLICABLE) public boolean isDirectory() { if (null != innerArchive) { try { final FsNode entry = innerArchive.getController() .node(getAccessPreferences(), getNodeName()); return null != entry && entry.isType(DIRECTORY); } catch (IOException ex) { return false; } } return file.isDirectory(); }
@Override public String getTimeReadDate() { final long time = node().getTime(READ); return UNKNOWN == time ? null : new Date(time).toString(); }
final FsNode entry = controller .node(getAccessPreferences(), innerEntryName); if (null == entry || !entry.isType(DIRECTORY)) throw ex;