Examples of FileSet


Examples of org.apache.maven.project.FileSet

     * @param parser
     */
    private FileSet parseFileSet(String tagName, XmlPullParser parser, boolean strict, String encoding)
        throws IOException, XmlPullParserException
    {
        FileSet fileSet = new FileSet();
        fileSet.setModelEncoding( encoding );
        java.util.Set parsed = new java.util.HashSet();
        while ( parser.nextTag() == XmlPullParser.START_TAG )
        {
            if ( parser.getName().equals( "directory" )  )
            {
                if ( parsed.contains( "directory" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "directory" );
                fileSet.setDirectory( getTrimmedValue( parser.nextText()) );
            }
            else if ( parser.getName().equals( "includes" )  )
            {
                if ( parsed.contains( "includes" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "includes" );
                java.util.List includes = new java.util.ArrayList();
                fileSet.setIncludes( includes );
                while ( parser.nextTag() == XmlPullParser.START_TAG )
                {
                    if ( parser.getName().equals( "include" ) )
                    {
                        includes.add( getTrimmedValue( parser.nextText()) );
                    }
                    else
                    {
                        parser.nextText();
                    }
                }
            }
            else if ( parser.getName().equals( "excludes" )  )
            {
                if ( parsed.contains( "excludes" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "excludes" );
                java.util.List excludes = new java.util.ArrayList();
                fileSet.setExcludes( excludes );
                while ( parser.nextTag() == XmlPullParser.START_TAG )
                {
                    if ( parser.getName().equals( "exclude" ) )
                    {
                        excludes.add( getTrimmedValue( parser.nextText()) );
View Full Code Here

Examples of org.apache.maven.shared.model.fileset.FileSet

    }
  }

  private String[] scanIncludedFiles(final String dir, final String[] includes,
      final String[] excludes) {
    final FileSet set = new FileSet();
    this.log.debug("Scanning " + dir);
    set.setDirectory(dir);
    if (includes != null) {
      for (final String include : includes) {
        this.log.debug("  including " + include);
        set.addInclude(include);
      }
    }
    if (excludes != null) {
      for (final String exclude : excludes) {
        this.log.debug("  excluding " + exclude);
        set.addExclude(exclude);
      }
    }
    return new FileSetManager().getIncludedFiles(set);
  }
View Full Code Here

Examples of org.apache.maven.shared.model.fileset.FileSet

 
  private void runGeneration(String thisSourceRoot,
      VelocityEngine engine,
      File thisOutputDirectory,
      File thisDoNotReplaceDirectory, String[] excludes) throws MojoExecutionException {
    FileSet fileSet = new FileSet();
    fileSet.setDirectory(thisSourceRoot);
    List<String> includes = new ArrayList<String>();
    includes.add("**/*.java.t");
    fileSet.setIncludes(includes);
   
    String[] includedFiles = fileSetManager.getIncludedFiles(fileSet);
    for (String template : includedFiles) {
      File templateFile = new File(thisSourceRoot, template);
      String subpath = templateFile.getParentFile().getPath().substring(
          fileSet.getDirectory().length());
      thisOutputDirectory.mkdirs();
      File thisDoNotReplaceFull = new File(thisDoNotReplaceDirectory, subpath);
      processOneTemplate(engine, template, thisOutputDirectory,
          thisDoNotReplaceFull, subpath.substring(1), excludes);
    }
View Full Code Here

Examples of org.apache.maven.shared.model.fileset.FileSet

        if (!clearLogs)
            return;

        String logsDir = getTomcatConfiguration().getTomcatHome() + "/logs";

        FileSet fileSet = FileSystemUtils.createFileSet(logsDir, INCLUDES_LOGS, EXCLUDES_LOGS);

        FileSystemUtils.removeFileSet(fileSet, getLog());

        // noinspection ResultOfMethodCallIgnored
        new File(logsDir).mkdirs();
View Full Code Here

Examples of org.apache.maven.shared.model.fileset.FileSet

 
  private void runGeneration(String thisSourceRoot,
      VelocityEngine engine,
      File thisOutputDirectory,
      File thisDoNotReplaceDirectory, String[] excludes) throws MojoExecutionException {
    FileSet fileSet = new FileSet();
    fileSet.setDirectory(thisSourceRoot);
    List<String> includes = new ArrayList<String>();
    includes.add("**/*.java.t");
    fileSet.setIncludes(includes);
   
    String[] includedFiles = fileSetManager.getIncludedFiles(fileSet);
    for (String template : includedFiles) {
      File templateFile = new File(thisSourceRoot, template);
      String subpath = templateFile.getParentFile().getPath().substring(
          fileSet.getDirectory().length());
      thisOutputDirectory.mkdirs();
      File thisDoNotReplaceFull = new File(thisDoNotReplaceDirectory, subpath);
      processOneTemplate(engine, template, thisOutputDirectory,
          thisDoNotReplaceFull, subpath.substring(1), excludes);
    }
View Full Code Here

Examples of org.apache.tools.ant.types.FileSet

            // <classpathset> tags.
            //
            pathArray = new String[m_fileSet.size()];
       
            for(int i = 0; i < m_fileSet.size(); i++) {
                FileSet fileSet = (FileSet)m_fileSet.get(i);
                File directory = fileSet.getDir(project);
                pathArray[i] = directory.getAbsolutePath();
            }
        }
       
        // make Ant classpath usable by application
View Full Code Here

Examples of org.apache.tools.ant.types.FileSet

            //
            // For each fileset, get all the file paths included by it.
            //
            ArrayList paths = new ArrayList();
            for(int i = 0; i < m_bindingFileSet.size(); i++){
                FileSet bPath = (FileSet)m_bindingFileSet.get(i);
               
                DirectoryScanner dirScn = bPath.getDirectoryScanner(project);
                String[] bndingFiles = dirScn.getIncludedFiles();
               
                for(int x = 0; x < bndingFiles.length; x++){
                    String fullPath = dirScn.getBasedir()
                                      + System.getProperty("file.separator")
View Full Code Here

Examples of org.apache.tools.ant.types.FileSet

    {
        final List list = new ArrayList();
        final int count = m_filesets.size();
        for( int i = 0; i < count; i++ )
        {
            final FileSet fileSet = (FileSet)m_filesets.get( i );
            scanFileSetForClassesWithMetaData( fileSet, list );
        }
        return list;
    }
View Full Code Here

Examples of org.apache.tools.ant.types.FileSet

        }

        // TODO: any of this used?
        // deal with the filesets
        for (int i = 0; i < filesets.size(); i++) {
            FileSet fs = filesets.elementAt(i);
            DirectoryScanner ds = fs.getDirectoryScanner(getProject());
            File srcDir = fs.getDir(getProject());
            String[] srcFiles = ds.getIncludedFiles();
        }

        try {
            PrintStream out = System.out;
View Full Code Here

Examples of org.apache.tools.ant.types.FileSet

    {
        Vector v = new Vector();
        final int size = filesets.size();
        for (int i = 0; i < size; i++)
        {
            FileSet fs = (FileSet) filesets.elementAt(i);
            DirectoryScanner ds = fs.getDirectoryScanner(getProject());
            ds.scan();
            String[] f = ds.getIncludedFiles();
            for (int j = 0; j < f.length; j++)
            {
                String pathname = f[j];
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.