Package org.unidal.helper.Scanners

Examples of org.unidal.helper.Scanners.FileMatcher


      Date date = new Date();
      SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
      final String today = sdf.format(date);
      final String yesterday = sdf.format(new Date(date.getTime() - 24 * 60 * 60 * 1000L));

      Scanners.forDir().scan(reportDir, new FileMatcher() {
        @Override
        public Direction matches(File base, String path) {
          File file = new File(base, path);
          if (file.isFile() && shouldDeleteReport(path)) {
            toRemovePaths.add(path);
View Full Code Here


  private void removeEmptyDir(File baseFile) {
    // the path has two depth
    for (int i = 0; i < 2; i++) {
      final List<String> directionPaths = new ArrayList<String>();

      Scanners.forDir().scan(baseFile, new FileMatcher() {
        @Override
        public Direction matches(File base, String path) {
          if (new File(base, path).isDirectory()) {
            directionPaths.add(path);
          }
View Full Code Here

  private void uploadLogviewFile() {
    File baseDir = new File(m_dumpBaseDir, "outbox");
    final List<String> paths = new ArrayList<String>();

    Scanners.forDir().scan(baseDir, new FileMatcher() {
      @Override
      public Direction matches(File base, String path) {
        if (new File(base, path).isFile()) {
          paths.add(path);
        }
View Full Code Here

      final String path = m_pathBuilder.getPath(new Date(id.getTimestamp()), "");
      final File dir = new File(m_baseDir, path);
      final String key = id.getDomain() + '-' + id.getIpAddress();
      final List<String> paths = new ArrayList<String>();

      Scanners.forDir().scan(dir, new FileMatcher() {
        @Override
        public Direction matches(File base, String name) {
          if (name.contains(key) && !name.endsWith(".idx")) {
            paths.add(path + name);
          }
View Full Code Here

  }

  private void moveOldMessages() {
    final List<String> paths = new ArrayList<String>();

    Scanners.forDir().scan(m_baseDir, new FileMatcher() {
      @Override
      public Direction matches(File base, String path) {
        if (new File(base, path).isFile()) {
          if (path.indexOf(".idx") == -1 && shouldMove(path)) {
            paths.add(path);
View Full Code Here

TOP

Related Classes of org.unidal.helper.Scanners.FileMatcher

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.