Package org.codehaus.plexus.util

Examples of org.codehaus.plexus.util.DirectoryScanner


        File bindingdir = new File(path);
        if (!bindingdir.isDirectory()) {
            return bindingSet;
        }

        DirectoryScanner scanner = new DirectoryScanner();

        scanner.setBasedir(bindingdir);
        String[] includes = (String[]) includeFiles.toArray(new String[includeFiles.size()]);
        scanner.setIncludes(includes);
        String[] excludes = (String[]) excludeFiles.toArray(new String[excludeFiles.size()]);
        scanner.setExcludes(excludes);
        scanner.scan();

        String[] files = scanner.getIncludedFiles();
        String absolutePath = bindingdir.getAbsolutePath();
        for (int i = 0; i < files.length; i++) {
            String file = absolutePath + File.separator + files[i];
            bindingSet.add(file);
        }
View Full Code Here


     * @return all poms found.
     * @throws MojoExecutionException
     */
    private List getAdditionalFiles()
    {
        final DirectoryScanner scanner = new DirectoryScanner();
        scanner.setBasedir(this.project.getBuild().getDirectory());
        scanner.setIncludes(this.includes);
        scanner.setExcludes(this.excludes);
        scanner.scan();

        final List files = new ArrayList();
        for (int ctr = 0; ctr < scanner.getIncludedFiles().length; ctr++)
        {
            final File file = new File(
                    this.project.getBuild().getDirectory(),
                    scanner.getIncludedFiles()[ctr]);
            if (file.exists())
            {
                files.add(file);
            }
        }
View Full Code Here

     */
    protected List getMappingFilesList(
        final String extension,
        final String baseDirectory)
    {
        final DirectoryScanner scanner = new DirectoryScanner();
        scanner.setBasedir(baseDirectory);
        scanner.setIncludes(new String[] {"**/*." + extension});
        scanner.setExcludes(null);
        scanner.scan();

        final List files = new ArrayList();
        for (final Iterator iterator = Arrays.asList(scanner.getIncludedFiles()).iterator(); iterator.hasNext();)
        {
            final String path = (String)iterator.next();
            files.add(new File(
                    baseDirectory,
                    path).toString());
View Full Code Here

     * @throws MojoExecutionException
     */
    private List getPoms()
        throws MojoExecutionException
    {
        final DirectoryScanner scanner = new DirectoryScanner();
        scanner.setBasedir(this.getRootProject().getBasedir());
        scanner.setIncludes(INCLUDE_ALL_POMS);
        scanner.scan();
        final List poms = new ArrayList();
        for (int ctr = 0; ctr < scanner.getIncludedFiles().length; ctr++)
        {
            final File file = new File(
                    this.getRootProject().getBasedir(),
                    scanner.getIncludedFiles()[ctr]);
            if (file.exists())
            {
                poms.add(file);
            }
        }
View Full Code Here

     *
     * @return the list of module poms
     */
    private List getPoms()
    {
        final DirectoryScanner scanner = new DirectoryScanner();
        scanner.setBasedir(this.baseDirectory);
        scanner.setIncludes(includes);
        scanner.setExcludes(excludes);
        scanner.scan();
        final List poms = new ArrayList();
        for (int ctr = 0; ctr < scanner.getIncludedFiles().length; ctr++)
        {
            poms.add(new File(
                    this.baseDirectory,
                    scanner.getIncludedFiles()[ctr]));
        }
        return poms;
    }
View Full Code Here

     * @throws MojoExecutionException
     */
    private List getPoms()
        throws Exception
    {
        final DirectoryScanner scanner = new DirectoryScanner();
        scanner.setBasedir(this.getRootProject().getBasedir());
        scanner.setIncludes(this.includes);
        scanner.setExcludes(this.excludePoms != null ? excludePoms.split(",") : null);
        scanner.scan();

        List poms = new ArrayList();

        for (int ctr = 0; ctr < scanner.getIncludedFiles().length; ctr++)
        {
            final File file = new File(
                this.getRootProject().getBasedir(),
                scanner.getIncludedFiles()[ctr]);
            if (file.exists())
            {
                poms.add(file);
            }
        }
View Full Code Here

    {
        List poms = new ArrayList();
        if (this.projectIncludes != null && this.projectIncludes.length > 0)
        {
            final File baseDirectory = this.getRootProject().getBasedir();
            final DirectoryScanner scanner = new DirectoryScanner();
            scanner.setBasedir(baseDirectory);
            scanner.setIncludes(this.projectIncludes);
            scanner.setExcludes(this.projectExcludes);
            scanner.scan();
            for (int ctr = 0; ctr < scanner.getIncludedFiles().length; ctr++)
            {
                final File pom = new File(baseDirectory, scanner.getIncludedFiles()[ctr]);
                if (pom.exists())
                {
                    poms.add(pom);
                }
            }
View Full Code Here

     * @return all poms found.
     * @throws MojoExecutionException
     */
    public List getPaths()
    {
        final DirectoryScanner scanner = new DirectoryScanner();
        final File filePath = new File(this.path);
        final List paths = new ArrayList();
        if (filePath.isDirectory())
        {
            scanner.setBasedir(this.path);
            scanner.setIncludes(this.includes);   
            scanner.setExcludes(this.excludes);
            scanner.scan();
   
            final String[] files = scanner.getIncludedFiles();
            for (int ctr = 0; ctr < files.length; ctr++)
            {
                paths.add(files[ctr]);
            }
        }
View Full Code Here

    public List getPaths()
    {
        final List paths = new ArrayList();
        if (this.rootPath != null && new File(this.rootPath).exists())
        {
            final DirectoryScanner scanner = new DirectoryScanner();
            scanner.setBasedir(this.rootPath);
            scanner.setIncludes(this.includes);
            scanner.setExcludes(this.excludes);
            scanner.scan();
   
            for (int ctr = 0; ctr < scanner.getIncludedFiles().length; ctr++)
            {
                paths.add(scanner.getIncludedFiles()[ctr]);
            }
        }
        return paths;
    }
View Full Code Here

     */
    public Collection<Source> getSources() {
      if ( scanClasses ) {
            final ArrayList<Source> files = new ArrayList<Source>();

            final DirectoryScanner scanner = new DirectoryScanner();
            scanner.setBasedir(this.project.getBuild().getOutputDirectory());
            if ( this.includeString != null ) {
                scanner.setIncludes(this.includeString.split(","));
            } else {
                scanner.setIncludes(new String[] {"**/*.class"});
            }
            if ( this.excludeString != null ) {
                scanner.setExcludes(this.excludeString.split(","));
            }
            scanner.addDefaultExcludes();

            scanner.scan();

            for ( final String fileName : scanner.getIncludedFiles() ) {
                files.add( new Source() {

                    public File getFile() {
                        return new File(project.getBuild().getOutputDirectory(), fileName);
                    }
View Full Code Here

TOP

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

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.