public static RelativePath parse(boolean isFile, String path) { return parse(isFile, null, path); }
public void add(String path, Action<OutputStream> contentWriter) { elements.put(RelativePath.parse(true, path), contentWriter); }
public static DefaultFileTreeElement of(File file, FileSystem fileSystem) { RelativePath path = RelativePath.parse(!file.isDirectory(), file.getAbsolutePath()); return new DefaultFileTreeElement(file, path, fileSystem, fileSystem); }
public RelativePath getDestPath() { RelativePath parentPath; if (parentResolver == null) { parentPath = new RelativePath(false); } else { parentPath = parentResolver.getDestPath(); } if (destDir == null) { return parentPath; } String path = PATH_NOTATION_PARSER.parseNotation(destDir); if (path.startsWith("/") || path.startsWith(File.separator)) { return RelativePath.parse(false, path); } return RelativePath.parse(false, parentPath, path); }
@Override public HashCode hash(ZipEntry zipEntry, InputStream zipInput) throws IOException { if (shouldBeIgnored(RelativePath.parse(true, zipEntry.getName()))) { return null; } return delegate.hash(zipEntry, zipInput); }
public static boolean contains(FileSystem fileSystem, DirectoryTree tree, File file) { String prefix = tree.getDir().getAbsolutePath() + File.separator; if (!file.getAbsolutePath().startsWith(prefix)) { return false; } RelativePath path = RelativePath.parse(true, file.getAbsolutePath().substring(prefix.length())); return tree.getPatterns().getAsSpec().isSatisfiedBy(new DefaultFileTreeElement(file, path, fileSystem, fileSystem)); }
public void setPath(String path) { relativePath = RelativePath.parse(getRelativePath().isFile(), path); }