Esempio n. 1
0
    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));
    }
Esempio n. 2
0
 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();
 }
Esempio n. 3
0
  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;
  }
Esempio n. 5
0
 public String getDisplayName() {
   return path.toString();
 }
Esempio n. 6
0
 private File createFileInstance(RelativePath path) {
   return path.getFile(getTmpDir());
 }
Esempio n. 7
0
 public void visit(RelativePath path, Action<OutputStream> generator) {
   visitDirs(path.getParent(), visitor);
   visitor.visitFile(new FileVisitDetailsImpl(path, generator, stopFlag, chmod));
 }
Esempio n. 8
0
 public void add(String path, Action<OutputStream> contentWriter) {
   elements.put(RelativePath.parse(true, path), contentWriter);
 }
Esempio n. 9
0
 public void execute(FileCopyDetails fileCopyDetails) {
   RelativePath path = fileCopyDetails.getRelativePath();
   path = path.replaceLastName(transformer.transform(path.getLastName()));
   fileCopyDetails.setRelativePath(path);
 }