/** * @param delegate delegate tree * @param rootPath root path for the subtree * @param fullPath true if the root path should not be removed when accessing the delegate */ public SubPathTree(Tree<T> delegate, String rootPath, boolean fullPath) { this(delegate, PathUtil.asPath(rootPath), fullPath); }
/** * @return true if the path is the root * * @param path path string */ public static boolean isRoot(String path) { return isRoot(asPath(path)); } /**
@Override public byte[] readPublicKey(final String path) throws IOException { return readPublicKey(PathUtil.asPath(path)); } }
@Override public Resource<T> getResource(String path) { return getResource(PathUtil.asPath(path)); }
@Override public Set<Resource<T>> listDirectory(String path) { return listDirectory(PathUtil.asPath(path)); }
@Override public boolean deleteResource(String path) { return deleteResource(PathUtil.asPath(path)); }
@Override public Resource<T> updateResource(String path, T content) { return updateResource(PathUtil.asPath(path), content); } }
@Override public boolean hasPassword(String path) { return hasResourceWithType(PathUtil.asPath(path), KeyStorageLayer.PASSWORD_MIME_TYPE); }
@Override public boolean hasPrivateKey(String path) { return hasResourceWithType(PathUtil.asPath(path), KeyStorageLayer.PRIVATE_KEY_MIME_TYPE); }
@Override public boolean hasPublicKey(String path) { return hasResourceWithType(PathUtil.asPath(path), KeyStorageLayer.PUBLIC_KEY_MIME_TYPE); }
@Override public Set<Resource<T>> listDirectorySubdirs(String path) { return listDirectorySubdirs(PathUtil.asPath(path)); }
@Override public Resource<T> createResource(String path, T content) { return createResource(PathUtil.asPath(path), content); }
@Override public byte[] readPassword(final String path) throws IOException { return readPassword(PathUtil.asPath(path)); }
@Override public byte[] readPrivateKey(final String path) throws IOException { return readPrivateKey(PathUtil.asPath(path)); }
@Override public boolean hasPath(String path) { return hasPath(PathUtil.asPath(path)); }
@Override public boolean hasResource(String path) { return hasResource(PathUtil.asPath(path)); }
@Override public Set<Resource<T>> listDirectoryResources(String path) { return listDirectoryResources(PathUtil.asPath(path)); }
/** * Append one path to another * * @param prefix prefix * @param subpath sub path * * @return sub path appended to the prefix */ public static Path appendPath(Path prefix, String subpath) { return asPath(appendPath(prefix.getPath(), subpath)); }
private Path translatePathExternal(Path extpath) { return PathUtil.asPath(translatePathExternal(extpath.getPath())); }
private Path translatePathInternal(Path extpath) { return PathUtil.asPath(translatePathInternal(extpath.getPath())); }