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

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


      for (final String exclude : excludes) {
        this.log.debug("  excluding " + exclude);
        set.addExclude(exclude);
      }
    }
    return new FileSetManager().getIncludedFiles(set);
  }
View Full Code Here


    typeToObjectTypeMap.put("int", "Integer");
    typeToObjectTypeMap.put("short", "Short");
    typeToObjectTypeMap.put("long", "Long");
    typeToObjectTypeMap.put("float", "Float");
    typeToObjectTypeMap.put("double", "Double");
    fileSetManager = new FileSetManager(getLog());
  }
View Full Code Here

            {
                throw new MojoExecutionException(dir + " is not a directory.");
            }

            log.info("Deleting " + fileset.getDirectory());
            FileSetManager fileSetManager = new FileSetManager(log, true);
            fileSetManager.delete(fileset);
        }
        catch (IOException e)
        {
            throw new MojoExecutionException("Failed to delete directory: " + fileset.getDirectory() + ". Reason: "
                                             + e.getMessage(), e);
View Full Code Here

    typeToObjectTypeMap.put("int", "Integer");
    typeToObjectTypeMap.put("short", "Short");
    typeToObjectTypeMap.put("long", "Long");
    typeToObjectTypeMap.put("float", "Float");
    typeToObjectTypeMap.put("double", "Double");
    fileSetManager = new FileSetManager(getLog());
  }
View Full Code Here

            fileSet.setIncludes( set.getIncludes() );

            fileSet.setExcludes( set.getExcludes() );
            fileSet.setUseDefaultExcludes( true );

            FileSetManager fsm = new FileSetManager( logger );
            String[] files = fsm.getIncludedFiles( fileSet );

            // if we don't have anything to process, let's just skip all of this mess.
            if ( ( files == null ) || ( files.length == 0 ) )
            {
                logger.info( "No files selected for line-ending conversion or filtering. Skipping: " + fileSet.getDirectory() );
View Full Code Here

        File workingDirectory = workingDirectoryService.getWorkingDirectory( project );

        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

    }
  }

  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

        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

        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

        File workingDirectory = workingDirectoryService.getWorkingDirectory( project, projectScmRootUrl,
                                                                             projectsWithCommonScmRoot );

        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

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.