Package org.apache.maven.shared.model.fileset.util

Examples of org.apache.maven.shared.model.fileset.util.FileSetManager


        if ( workingDirectory.exists() )
        {
            getLogger().debug( "Cleaning working directory " + workingDirectory.getAbsolutePath() );

            FileSetManager fileSetManager = new FileSetManager();
            FileSet fileSet = new FileSet();
            fileSet.setDirectory( workingDirectory.getPath() );
            fileSet.addInclude( "**/**" );
            // TODO : this with a configuration option somewhere ?
            fileSet.setFollowSymlinks( false );
            fileSetManager.delete( fileSet );
        }
    }
View Full Code Here


    }
  }

  private String[] getIncludedFiles(String absPath, String[] excludes,
      String[] includes) {
    FileSetManager fileSetManager = new FileSetManager();
    FileSet fs = new FileSet();
    fs.setDirectory(absPath);
    fs.setFollowSymlinks(false);
    for (String include : includes) {
      fs.addInclude(include);
    }
    for (String exclude : excludes) {
      fs.addExclude(exclude);
    }
    return fileSetManager.getIncludedFiles(fs);
  }
View Full Code Here

   * Creates the context path from the specified entries.
   *
   * @param theContextPath List of entries which defines the context path.
   */
  public static void build(final List<Entry> theContextPath) {
    final FileSetManager fileSetManager = new FileSetManager();
    final HashSet<File> includes = new HashSet<File>();
    final HashSet<File> excludes = new HashSet<File>();

    for (Object entry : theContextPath) {
      final String[] includeNames = fileSetManager.getIncludedDirectories(
          ((Entry)entry).files);
      final String[] excludeNames = fileSetManager.getExcludedDirectories(
          ((Entry)entry).files);

      final String baseDir = ((Entry)entry).files.getDirectory();

      /* Adds the included directories. */
 
View Full Code Here

        if ( includes.isEmpty() &&  excludes.isEmpty() )
        {
            return;
        }

        FileSetManager fileSetManager = new FileSetManager();

        FileSet fileset = new FileSet();
        fileset.setDirectory( checkoutDirectory.getAbsolutePath() );
        fileset.setIncludes( excludes );//revert the order to do the delete
        fileset.setExcludes( includes );
        fileset.setUseDefaultExcludes( false );

        try
        {
            fileSetManager.delete( fileset );
        }
        catch ( IOException e )
        {
            throw new MojoExecutionException( "Error found while cleaning up output directory base on excludes/includes configurations.", e );
        }
View Full Code Here

    }

    FileLocations config = new FileLocations();
    config.setOutputDirectory(generatedSourcesDirectory);

    for (String srcFileRelativePath : new FileSetManager().getIncludedFiles(properties)) {
      config.addSourceFile(new File(resourceDirectory,srcFileRelativePath));
    }

    try {
      config.setSourcePath(Arrays.asList(resourceDirectory));
View Full Code Here

    }
  }

  private String[] getIncludedFiles(String absPath, String[] excludes,
      String[] includes) {
    FileSetManager fileSetManager = new FileSetManager();
    FileSet fs = new FileSet();
    fs.setDirectory(absPath);
    fs.setFollowSymlinks(false);
   
    //exclude imports directory since it has already been compiled.
    if (imports != null) {
      String importExclude = null;

      for (String importFile : this.imports) {
        File file = new File(importFile);

        if (file.isDirectory()) {
          importExclude = file.getName() + "/**";
        } else if (file.isFile()) {
          importExclude = "**/" + file.getName();
        }

        fs.addExclude(importExclude);
      }
    }
    for (String include : includes) {
      fs.addInclude(include);
    }
    for (String exclude : excludes) {
      fs.addExclude(exclude);
    }
    return fileSetManager.getIncludedFiles(fs);
  }
View Full Code Here

  static final String OUTPUT_DIR_PROP = "coverage-outputDir";
  static final String OUTPUT_FMT_PROP = "coverage-output";

  public MergeJMockitMojo() {
    this.fileSetManager = new FileSetManager();
  }
View Full Code Here

   
        File workingDirectory = buildAgentConfigurationService.getWorkingDirectory( project.getId() );
   
        if ( workingDirectory.exists() )
        {
            FileSetManager fileSetManager = new FileSetManager();
            FileSet fileSet = new FileSet();
            fileSet.setDirectory( workingDirectory.getPath() );
            fileSet.addInclude( "**/**" );
            // TODO : this with a configuration option somewhere ?
            fileSet.setFollowSymlinks( false );
            fileSetManager.delete( fileSet );
        }
    }
View Full Code Here

        if ( includes.isEmpty() && excludes.isEmpty() )
        {
            return;
        }

        FileSetManager fileSetManager = new FileSetManager();

        FileSet fileset = new FileSet();
        fileset.setDirectory( checkoutDirectory.getAbsolutePath() );
        fileset.setIncludes( excludes ); // revert the order to do the delete
        fileset.setExcludes( includes );
        fileset.setUseDefaultExcludes( false );

        try
        {
            fileSetManager.delete( fileset );
        }
        catch ( IOException e )
        {
            throw new MojoExecutionException( "Error found while cleaning up output directory base on "
                + "excludes/includes configurations.", e );
View Full Code Here

        throws IOException
    {
        if ( dir != null )
        {
            Log log = new SilentLog();
            FileSetManager fileSetManager = new FileSetManager( log, false );

            FileSet fs = new FileSet();
            fs.setDirectory( dir.getPath() );
            fs.addInclude( "**/**" );
            fileSetManager.delete( fs );

        }
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.shared.model.fileset.util.FileSetManager

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.