private void visitDirs(RelativePath path, FileVisitor visitor) { if (path == null || path.getParent() == null || !visitedDirs.add(path)) { return; } visitDirs(path.getParent(), visitor); visitor.visitDir(new FileVisitDetailsImpl(path, null, stopFlag, chmod)); }
public FileVisitDetailsImpl( RelativePath path, Action<OutputStream> generator, AtomicBoolean stopFlag, Chmod chmod) { super(chmod); this.path = path; this.generator = generator; this.stopFlag = stopFlag; this.isDirectory = !path.isFile(); }
public RelativePath getDestPath() { RelativePath parentPath; if (parentSpec == null) { parentPath = new RelativePath(false); } else { parentPath = parentSpec.getDestPath(); } if (destDir == null) { return parentPath; } String path = destDir.toString(); if (path.startsWith("/") || path.startsWith(File.separator)) { return RelativePath.parse(false, path); } return RelativePath.parse(false, parentPath, path); }
ProgramArguments buildProgramArguments(File inputDirectory, RelativePath inputRelativePath) { ProgramArguments commandLineArguments = new ProgramArguments(); if (programArguments != null) { commandLineArguments.addAll(programArguments); } commandLineArguments.addFilename(inputRelativePath.getFile(inputDirectory).getAbsolutePath()); augmentArguments(inputDirectory, inputRelativePath, commandLineArguments); return commandLineArguments; }
public String getDisplayName() { return path.toString(); }
private File createFileInstance(RelativePath path) { return path.getFile(getTmpDir()); }
public void visit(RelativePath path, Action<OutputStream> generator) { visitDirs(path.getParent(), visitor); visitor.visitFile(new FileVisitDetailsImpl(path, generator, stopFlag, chmod)); }
public void add(String path, Action<OutputStream> contentWriter) { elements.put(RelativePath.parse(true, path), contentWriter); }
public void execute(FileCopyDetails fileCopyDetails) { RelativePath path = fileCopyDetails.getRelativePath(); path = path.replaceLastName(transformer.transform(path.getLastName())); fileCopyDetails.setRelativePath(path); }