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