Example #1
0
 public CopySpecImpl into(Object destPath, Closure configureClosure) {
   if (configureClosure == null) {
     into(destPath);
     return this;
   } else {
     CopySpecImpl child = addChild();
     child.into(destPath);
     ConfigureUtil.configure(configureClosure, child);
     return child;
   }
 }
Example #2
0
 public CopySpec from(Object sourcePath, Closure c) {
   if (c == null) {
     from(sourcePath);
     return this;
   } else {
     CopySpecImpl child = addChild();
     child.from(sourcePath);
     ConfigureUtil.configure(c, child);
     return child;
   }
 }
Example #3
0
 public List<Spec<FileTreeElement>> getAllExcludeSpecs() {
   List<Spec<FileTreeElement>> result = new ArrayList<Spec<FileTreeElement>>();
   if (parentSpec != null) {
     result.addAll(parentSpec.getAllExcludeSpecs());
   }
   result.addAll(patternSet.getExcludeSpecs());
   return result;
 }
Example #4
0
 public List<String> getAllExcludes() {
   List<String> result = new ArrayList<String>();
   if (parentSpec != null) {
     result.addAll(parentSpec.getAllExcludes());
   }
   result.addAll(getExcludes());
   return result;
 }
Example #5
0
 public boolean isCaseSensitive() {
   if (caseSensitive != null) {
     return caseSensitive;
   } else if (parentSpec != null) {
     return parentSpec.isCaseSensitive();
   }
   return true;
 }
Example #6
0
 public int getFileMode() {
   if (fileMode != null) {
     return fileMode;
   }
   if (parentSpec != null) {
     return parentSpec.getFileMode();
   }
   return UnixStat.DEFAULT_FILE_PERM;
 }
Example #7
0
 public int getDirMode() {
   if (dirMode != null) {
     return dirMode;
   }
   if (parentSpec != null) {
     return parentSpec.getDirMode();
   }
   return UnixStat.DEFAULT_DIR_PERM;
 }
Example #8
0
 public List<Action<? super FileCopyDetails>> getAllCopyActions() {
   if (parentSpec == null) {
     return actions;
   }
   List<Action<? super FileCopyDetails>> allActions =
       new ArrayList<Action<? super FileCopyDetails>>();
   allActions.addAll(parentSpec.getAllCopyActions());
   allActions.addAll(actions);
   return allActions;
 }
Example #9
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);
  }