Examples of DirectoryScanner


Examples of org.apache.tools.ant.DirectoryScanner

            // surefire:test just skips itself when the current project is not a java project

            synchronized (build) {
              FileSet fileSet = getFileSet(reportsDir);
             
                DirectoryScanner ds = fileSet.getDirectoryScanner();
               
                if(ds.getIncludedFilesCount()==0)
                    // no test in this module
                    return true;
               
                String[] reportFiles = ds.getIncludedFiles();
                rememberCheckedFiles(reportsDir, reportFiles);
   
                if(result==null)    result = new TestResult();
                result.parse(System.currentTimeMillis() - build.getMilliSecsSinceBuildStart(), reportsDir, reportFiles);
               
View Full Code Here

Examples of org.codehaus.loom.components.util.monitor.DirectoryScanner

     */
    public void initialize()
        throws Exception
    {
        deployDefaultApplications();
        m_scanner = new DirectoryScanner();
        m_scanner.setDirectory( m_appsDir.getPath() );
        m_scanner.setFrequency( m_frequency );
        m_scanner.setDirectoryChangeListener( this );
        m_scanner.start();
    }
View Full Code Here

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

Examples of org.codehaus.plexus.util.DirectoryScanner

     * @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

Examples of org.codehaus.plexus.util.DirectoryScanner

     */
    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

Examples of org.codehaus.plexus.util.DirectoryScanner

     * @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

Examples of org.codehaus.plexus.util.DirectoryScanner

     *
     * @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

Examples of org.codehaus.plexus.util.DirectoryScanner

     * @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

Examples of org.codehaus.plexus.util.DirectoryScanner

    {
        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

Examples of org.codehaus.plexus.util.DirectoryScanner

     * @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
TOP
Copyright © 2018 www.massapi.com. 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.