Package org.codehaus.plexus.util

Examples of org.codehaus.plexus.util.DirectoryWalker


        // Scan All Content. (intentional)
        allIncludes.add( "**/*" );

        // Setup Directory Walker
        DirectoryWalker dirWalker = new DirectoryWalker();

        dirWalker.setBaseDir( repositoryBase );

        dirWalker.setIncludes( allIncludes );
        dirWalker.setExcludes( allExcludes );

        RepositoryScannerInstance scannerInstance = new RepositoryScannerInstance( repository, purgeController );

        dirWalker.addDirectoryWalkListener( scannerInstance );

        // Execute scan.
        dirWalker.scan();

    }
View Full Code Here


        // Scan All Content. (intentional)
        allIncludes.add( "**/*" );

        // Setup Directory Walker
        DirectoryWalker dirWalker = new DirectoryWalker();

        dirWalker.setBaseDir( repositoryBase );

        dirWalker.setIncludes( allIncludes );
        dirWalker.setExcludes( allExcludes );

        // Setup the Scan Instance
        RepositoryScannerInstance scannerInstance =
            new RepositoryScannerInstance( repository, knownContentConsumers, invalidContentConsumers, changesSince );

        inProgressScans.add( scannerInstance );

        RepositoryScanStatistics stats;
        try
        {
            dirWalker.addDirectoryWalkListener( scannerInstance );

            // Execute scan.
            dirWalker.scan();

            stats = scannerInstance.getStatistics();

            stats.setKnownConsumers( gatherIds( knownContentConsumers ) );
            stats.setInvalidConsumers( gatherIds( invalidContentConsumers ) );
View Full Code Here

            allIncludes.addAll( extraFileInclusions );
        }

        // Setup Directory Walker

        DirectoryWalker dirWalker = new DirectoryWalker();

        dirWalker.setBaseDir( repositoryBase );

        dirWalker.setIncludes( allIncludes );
        dirWalker.setExcludes( allExcludes );

        // Setup the Scan Instance
        RepositoryScannerInstance scannerInstance = new RepositoryScannerInstance( repository, consumers );
        scannerInstance.setOnlyModifiedAfterTimestamp( onlyModifiedAfterTimestamp );

        dirWalker.addDirectoryWalkListener( scannerInstance );

        // Execute scan.
        dirWalker.scan();

        return scannerInstance.getStatistics();
    }
View Full Code Here

            allIncludes.addAll( extraFileInclusions );
        }

        // Setup Directory Walker

        DirectoryWalker dirWalker = new DirectoryWalker();

        dirWalker.setBaseDir( repositoryBase );

        dirWalker.setIncludes( allIncludes );
        dirWalker.setExcludes( allExcludes );

        // Setup the Scan Instance
        RepositoryScanner repoScanner = new RepositoryScanner( repository, consumers );
        repoScanner.setOnlyModifiedAfterTimestamp( onlyModifiedAfterTimestamp );

        repoScanner.setLogger( getLogger() );
        dirWalker.addDirectoryWalkListener( repoScanner );

        // Execute scan.
        dirWalker.scan();

        return repoScanner.getStatistics();
    }
View Full Code Here

  }

  protected void copyDirectory(final File from, final File to)
      throws IOException
  {
    DirectoryWalker w = new DirectoryWalker();

    w.setBaseDir(from);

    w.addSCMExcludes();

    w.addDirectoryWalkListener(new DirectoryWalkListener()
    {
      public void debug(String message) {
      }

      public void directoryWalkStarting(File basedir) {
      }

      public void directoryWalkStep(int percentage, File file) {
        if (!file.isFile()) {
          return;
        }

        try {
          String path = file.getAbsolutePath().substring(from.getAbsolutePath().length());

          FileUtils.copyFile(file, new File(to, path));
        }
        catch (IOException e) {
          throw new IllegalStateException("Cannot copy dirtree.", e);
        }
      }

      public void directoryWalkFinished() {
      }
    });

    w.scan();
  }
View Full Code Here

        // Scan All Content. (intentional)
        allIncludes.add( "**/*" );

        // Setup Directory Walker
        DirectoryWalker dirWalker = new DirectoryWalker();

        dirWalker.setBaseDir( repositoryBase );

        dirWalker.setIncludes( allIncludes );
        dirWalker.setExcludes( allExcludes );

        // Setup the Scan Instance
        RepositoryScannerInstance scannerInstance = new RepositoryScannerInstance( repository, knownContentConsumers,
                                                                                   invalidContentConsumers, changesSince );

        inProgressScans.add( scannerInstance );

        dirWalker.addDirectoryWalkListener( scannerInstance );

        // Execute scan.
        dirWalker.scan();

        RepositoryScanStatistics stats = scannerInstance.getStatistics();

        stats.setKnownConsumers( gatherIds( knownContentConsumers ) );
        stats.setInvalidConsumers( gatherIds( invalidContentConsumers ) );
View Full Code Here

        // Scan All Content. (intentional)
        allIncludes.add( "**/*" );

        // Setup Directory Walker
        DirectoryWalker dirWalker = new DirectoryWalker();

        dirWalker.setBaseDir( repositoryBase );

        dirWalker.setIncludes( allIncludes );
        dirWalker.setExcludes( allExcludes );

        // Setup the Scan Instance
        RepositoryScannerInstance scannerInstance = new RepositoryScannerInstance( repository, knownContentConsumers,
                                                                                   invalidContentConsumers, changesSince );

        dirWalker.addDirectoryWalkListener( scannerInstance );

        // Execute scan.
        dirWalker.scan();

        RepositoryScanStatistics stats = scannerInstance.getStatistics();

        stats.setKnownConsumers( gatherIds( knownContentConsumers ) );
        stats.setInvalidConsumers( gatherIds( invalidContentConsumers ) );
View Full Code Here

TOP

Related Classes of org.codehaus.plexus.util.DirectoryWalker

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.