/** * Returns {@code true} if and only if this {@code TPath} addresses an * entry located within an archive file. * Whether or not this is true solely depends on the * {@link TArchiveDetector} which was used to construct this {@code TPath} * - no file system tests are performed by this method! * * @return {@code true} if and only if this {@code TPath} addresses an * entry located within an archive file. * @see #isArchive */ public boolean isEntry() { final FsPath address = getAddress(); final boolean root = address.getEntryName().isRoot(); final FsMountPoint parent = address.getMountPoint().getParent(); return !root ? null != parent : null != parent && null != parent.getParent(); }
BitField<FsOutputOption> getOutputPreferences() { final BitField<FsOutputOption> prefs = TConfig .get() .getOutputPreferences(); return null != getMountPoint().getParent() ? prefs : prefs.clear(CREATE_PARENTS); }
/** * Returns {@code true} if and only if this {@code TPath} addresses an * archive file. * Whether or not this is true solely depends on the * {@link TArchiveDetector} which was used to construct this {@code TPath} * - no file system tests are performed by this method! * * @return {@code true} if and only if this {@code TPath} addresses an * archive file. * @see #isEntry */ public boolean isArchive() { final FsPath address = getAddress(); final boolean root = address.getEntryName().isRoot(); final FsMountPoint parent = address.getMountPoint().getParent(); return root && null != parent; }
try { TPath p = new TPath(path); if (null == p.getMountPoint().getParent()) throw new UnsupportedOperationException("No prospective archive file detected."); // don't be greedy! return p.getFileSystem();