搜索指定目录

@param srPath
343843
public FileScanner setSearchPath(String... srPath) {
        if (srPath == null || srPath.length == 0) {
            this.srPath = new String[0];
        } else {
            this.srPath = srPath;
        }
        return this;
    }
507743
private void addPaths(Path p) {

        for (String d : p.list()) {
            File dir = new File(d);
            if (dir.exists() && dir.isDirectory()) {
                if (!includeDirectories.contains(dir))
                    includeDirectories.add(dir);
            }
        }
    }
158245
public ISO9660Directory addPath(String path) throws HandlerException {
        ISO9660Directory dir;
        if (path.indexOf(File.separator) == -1) {
            // Path is a directory - add it if not already listed
            return checkDirectory(path);
        }

        // Add path recursively
        int frontSeparatorIndex = path.indexOf(File.separator);
        String dirName = path.substring(0, frontSeparatorIndex);
        dir = checkDirectory(dirName);
        String rest = path.substring(frontSeparatorIndex + 1);
        dir = dir.addPath(rest);

        return dir;
    }
117532
public void setAuxAnalyzepath(Path src) {
        boolean nonEmpty = false;

        String[] elementList = src.list();
        for (String anElementList : elementList) {
            if (!"".equals(anElementList)) {
                nonEmpty = true;
                break;
            }
        }

        if (nonEmpty) {
            if (auxAnalyzepath == null) {
                auxAnalyzepath = src;
            } else {
                auxAnalyzepath.append(src);
            }
        }
    }
280373
public void setPath(String path) {
        if (path != null) {
            manifest = ManifestIterator.getInstance().findByPath(path);
        }
    }
794155
public void addPath(MultiPath src, int srcPathIndex, boolean bForward) {
		m_impl.addPath((MultiPathImpl) src._getImpl(), srcPathIndex, bForward);
	}
1062959
public void setSourcePath(String sourcePath) {
		this.sourcePath = new ArrayList<>();
		for (final String path : Strings.split(sourcePath, Pattern.quote(File.pathSeparator))) {
			this.sourcePath.add(normalizeFile(path));
		}
	}
664537
public void setRelativePath(QPath relPath) {
        if (relPath != null && relPath.isAbsolute()) {
            throw new IllegalArgumentException("relPath must be relative");
        }
        this.relPath = relPath;
    }
255914
public void setDirectoryPath(String pidsfilepath) {
        File pidsfile = new File(pidsfilepath);
        directoryPath = pidsfile.getParent();
    }
101642
public void setAuxClasspath(Path src) {
        boolean nonEmpty = false;

        String[] elementList = src.list();
        for (String anElementList : elementList) {
            if (!"".equals(anElementList)) {
                nonEmpty = true;
                break;
            }
        }

        if (nonEmpty) {
            if (auxClasspath == null) {
                auxClasspath = src;
            } else {
                auxClasspath.append(src);
            }
        }
    }
796545
public static Action moveFileToEmptyPath(final String srcPath, final String destPath) {
        if (srcPath == null)
            throw new IllegalArgumentException("The srcPath variable cannot be null");
        if (destPath == null)
            throw new IllegalArgumentException("The destPath variable cannot be null");

        return new Action(
            // Perform:
            new ActionBlock() {
                @Override
                public void execute() throws ActionException {
                    File destFile = new File(destPath);
                    if (destFile.exists())
                        throw new ActionException("Cannot move file. " +
                                "The Destination file " + destPath + " already exists.");
                    boolean success = new File(srcPath).renameTo(destFile);
                    if (!success)
                        throw new ActionException("Cannot move file " + srcPath +
                                " to " + destPath);
                }
            },
            // Backout:
            new ActionBlock() {
                @Override
                public void execute() throws ActionException {
                    boolean success = new File(destPath).renameTo(new File(srcPath));
                    if (!success)
                        throw new ActionException("Cannot move file " + destPath +
                                " to " + srcPath);
                }
            },
            // Cleanup:
            null);
    }
734433
public static void deleteDir(Path dir) throws IOException {
		Validate.isTrue(isDirExists(dir), "%s is not exist or not a dir", dir);

		// 后序遍历，先删掉子目录中的文件/目录
		Files.walkFileTree(dir, deleteFileVisitor);
	}
634804
public void changePathInURL(String path, boolean changeHistory) {
        jcrURL.setPath(path);
        if (changeHistory) {
            htmlHistory.newItem(jcrURL.toString(), false);
        }
    }
933734
public void setMalwarePath(java.util.Collection<StringFilter> malwarePath) {
        if (malwarePath == null) {
            this.malwarePath = null;
            return;
        }

        this.malwarePath = new java.util.ArrayList<StringFilter>(malwarePath);
    }
878661
private static void checkSrcPath(Configuration conf, List<Path> srcPaths
      ) throws IOException {
    List<IOException> rslt = new ArrayList<IOException>();
    List<Path> unglobbed = new LinkedList<Path>();
    for (Path p : srcPaths) {
      FileSystem fs = p.getFileSystem(conf);
      FileStatus[] inputs = fs.globStatus(p);

      if(inputs != null && inputs.length > 0) {
        for (FileStatus onePath: inputs) {
          unglobbed.add(onePath.getPath());
        }
      } else {
        rslt.add(new IOException("Input source " + p + " does not exist."));
      }
    }
    if (!rslt.isEmpty()) {
      throw new InvalidInputException(rslt);
    }
    srcPaths.clear();
    srcPaths.addAll(unglobbed);
  }
1352118
@Requires("location != null")
  public void setLocation(Location location, List<? extends File> path)
      throws IOException {
    fileManager.setLocation(location, path);
  }
623134
public void redirectToApplicationPath(String path) {
        if ("".equals(applicationPath)) {
            // application path is the root
            redirect(path);
        } else {
            redirect(applicationPath + StringUtils.addStart(path, "/"));
        }
    }