@SuppressWarnings("unchecked") public static List<File> convertFileSetToFiles(FileSet source) throws IOException { String includes = getCommaSeparatedList(source.getIncludes()); String excludes = getCommaSeparatedList(source.getExcludes()); return FileUtils.getFiles(new File(source.getDirectory()), includes, excludes); }
FileSet fileSet = new FileSet(); for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- ) fileSet.setDirectory( interpolatedTrimmed( parser.nextText(), "directory" ) ); fileSet.setIncludes( includes ); while ( parser.nextTag() == XmlPullParser.START_TAG ) fileSet.setExcludes( excludes ); while ( parser.nextTag() == XmlPullParser.START_TAG )
protected void mergeFileSet_Directory( FileSet target, FileSet source, boolean sourceDominant, Map<Object, Object> context ) { String src = source.getDirectory(); if ( src != null ) { if ( sourceDominant || target.getDirectory() == null ) { target.setDirectory( src ); target.setLocation( "directory", source.getLocation( "directory" ) ); } } }
for ( FileSet pattern : classesPattern ) pattern.setIncludes( toFilePattern( pattern.getIncludes() ) ); pattern.setExcludes( toFilePattern( pattern.getExcludes() ) ); if ( pattern.getDirectory() == null ) File dir = PathUtil.file( pattern.getDirectory(), getBasedir() ); if ( !ArrayUtils.contains( directories, dir ) )
void processDirectory() throws Exception { final File templateDirectory = resolveWithBaseDirectory(templateDirectoryPath()); final List<String> paths = FileUtils.getFileNames(templateDirectory, list2csv(templates.getIncludes()), list2csv(templates.getExcludes()), false); if (paths.isEmpty()) { getLog().warn(templates + " is empty."); } else { getLog().info("Template directory: " + templateDirectory); getLog().info("Merge directory: " + mergeDirectory()); for (String path : paths) { processFile(path); } generateSourcesStrategy().updateProjectFrom(this); } }
/** * @see java.lang.Object#toString() */ public String toString() { return "FileSet {directory: " + getDirectory() + ", " + super.toString() + "}"; }
protected List<FileSet> as3ClassesFileSet( File... files ) { if ( files == null ) { return null; } List<FileSet> sets = new ArrayList<FileSet>(); for ( File file : files ) { FileSet fs = new FileSet(); fs.setDirectory( PathUtil.path( file ) ); fs.addInclude( "**/*.as" ); fs.addInclude( "**/*.mxml" ); sets.add( fs ); } return sets; }
private List<File> getProjects() throws IOException { FileSet restriction = new FileSet(); restriction.setDirectory(workspace.getAbsolutePath()); restriction.addInclude("**/.project"); restriction.addExclude("**/.bsProject/.project"); restriction.addExclude("**/.com.tibco.bw.rad/.project"); List<File> projects = Utils.toFileList(restriction); return projects; }
protected List<String> getTestClasses() { getLog().debug( "Scanning for tests at " + testCompileSourceRoots + " for " + includeTestFiles + " but " + excludeTestFiles ); FileSet fs = new FileSet(); fs.setIncludes( includeTestFiles ); fs.setExcludes( excludeTestFiles ); List<String> testClasses = filterClasses( asList( fs ), files( testCompileSourceRoots ) ); getLog().debug( "Test classes: " + testClasses ); return testClasses; }
/** * Updates test or compile sourceRoot and resources, * depending on the isAddToTestSources() flag. * * @throws MojoExecutionException */ protected void updateMavenPaths() { // Mark XJC_generated java files for compilation. if (getProject() != null) // null when run for testing. if (isAddToTestSources()) getProject().addTestCompileSourceRoot(getGenerateDirectory().getPath()); else getProject().addCompileSourceRoot(getGenerateDirectory().getPath()); // Mark XJC_gen prop files as resources for inclusion to final jar. Resource jaxbRes = new Resource(); jaxbRes.setDirectory(getGenerateDirectory().getPath()); jaxbRes.addInclude("**/jaxb.properties"); jaxbRes.addInclude("**/bgm.ser"); if (getProject() != null) // null when run for testing. if (isAddToTestSources()) getProject().addTestResource(jaxbRes); else getProject().addResource(jaxbRes); }
private DirectoryScanner scan(final File sourceDirectory) { final DirectoryScanner scanner = new DirectoryScanner(); scanner.setBasedir(sourceDirectory); scanner.setIncludes(toArray(source.getIncludes())); scanner.setExcludes(toArray(source.getExcludes())); scanner.addDefaultExcludes(); scanner.scan(); return scanner; }
private String templateDirectoryPath() { return templates.getDirectory(); }
@Override protected List<File> getHTMLFiles() throws IOException { FileSet htmlFiles = new FileSet(); htmlFiles.setDirectory(outputDirectory.getAbsolutePath()); htmlFiles.addInclude(getFileNameToReplace()); return toFileList(htmlFiles); }
protected void mergeFileSet_Directory( FileSet target, FileSet source, boolean sourceDominant, Map<Object, Object> context ) { String src = source.getDirectory(); if ( src != null ) { if ( sourceDominant || target.getDirectory() == null ) { target.setDirectory( src ); target.setLocation( "directory", source.getLocation( "directory" ) ); } } }
protected List<File> getHTMLFiles() throws IOException { FileSet htmlFiles = new FileSet(); htmlFiles.setDirectory(outputDirectory.getAbsolutePath()); htmlFiles.addInclude("**/*.html"); htmlFiles.addExclude("apidocs/**/*"); htmlFiles.addExclude("xref/**/*"); return toFileList(htmlFiles); }
if ( fileSet.getDirectory() != null ) serializer.startTag( NAMESPACE, "directory" ).text( fileSet.getDirectory() ).endTag( NAMESPACE, "directory" ); if ( ( fileSet.getIncludes() != null ) && ( fileSet.getIncludes().size() > 0 ) ) for ( Iterator iter = fileSet.getIncludes().iterator(); iter.hasNext(); ) if ( ( fileSet.getExcludes() != null ) && ( fileSet.getExcludes().size() > 0 ) ) for ( Iterator iter = fileSet.getExcludes().iterator(); iter.hasNext(); )
FileSet fileSet = new FileSet(); InputLocation _location; _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source ); fileSet.setLocation( "", _location ); for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- ) fileSet.setLocation( "directory", _location ); fileSet.setDirectory( interpolatedTrimmed( parser.nextText(), "directory" ) ); fileSet.setIncludes( includes ); InputLocation _locations; _locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source ); fileSet.setLocation( "includes", _locations ); while ( parser.nextTag() == XmlPullParser.START_TAG ) fileSet.setExcludes( excludes ); InputLocation _locations; _locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source ); fileSet.setLocation( "excludes", _locations ); while ( parser.nextTag() == XmlPullParser.START_TAG )
@SuppressWarnings("unchecked") void processDirectory() throws Exception { final File templateDirectory = resolveWithBaseDirectory(templateDirectoryPath()); final List<String> paths = FileUtils.getFileNames(templateDirectory, list2csv(templates.getIncludes()), list2csv(templates.getExcludes()), false); if (paths.isEmpty()) { getLog().warn(templates + " is empty."); } else { getLog().info("Template directory: " + templateDirectory); getLog().info("Merge directory: " + mergeDirectory()); for (String path : paths) processFile(path); generateSourcesStrategy().updateProjectFrom(this); } }
private String templateDirectoryPath() { return templates.getDirectory(); }
private Iterable<File> findFacesConfigFiles() throws MojoExecutionException { if (null == facesConfigs) { File defaultDirectory = resolveRelativePath(new File(MAIN_CONFIG)); if (defaultDirectory.exists() && defaultDirectory.isDirectory()) { FileSet fileSet = new FileSet(); fileSet.setDirectory(MAIN_CONFIG); fileSet.addInclude(XML_INCLUDES); facesConfigs = new FileSet[] { fileSet }; } } return doScan(facesConfigs); }