• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java FileSet类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.maven.shared.model.fileset.FileSet的典型用法代码示例。如果您正苦于以下问题:Java FileSet类的具体用法?Java FileSet怎么用?Java FileSet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



FileSet类属于org.apache.maven.shared.model.fileset包,在下文中一共展示了FileSet类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: removeDirectory

import org.apache.maven.shared.model.fileset.FileSet; //导入依赖的package包/类
/**
 * Deletes a directory and its contents.
 * 
 * @param dir
 *            The base directory of the included and excluded files.
 * @throws IOException
 * @throws MojoExecutionException
 *             When a directory failed to get deleted.
 */
public static void removeDirectory( File dir )
    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 );

    }
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:25,代码来源:DependencyTestUtils.java


示例2: getSourceBundleFiles

import org.apache.maven.shared.model.fileset.FileSet; //导入依赖的package包/类
protected List<SourceBundleFile> getSourceBundleFiles(BundleSet bundleSet) {
    List<SourceBundleFile> bundleFiles = new LinkedList<SourceBundleFile>();

    FileSetManager fsm = new FileSetManager(getLog());
    File baseDir = project.getBasedir();
    ResourceType type = bundleSet.getType();
    FileSet fs = bundleSet.getSourceFiles();
    File fsBaseDir = new File(baseDir, fs.getDirectory());
    String[] relPathes = fsm.getIncludedFiles(fs);
    for (String relPath : relPathes) {
        File bundleFile = new File(fsBaseDir, relPath);
        bundleFiles.add(
                new SourceBundleFile(type, pathToBundleId(type, relPath),
                        bundleFile, relPath));
    }
    return bundleFiles;
}
 
开发者ID:IBM-Cloud,项目名称:gp-java-tools,代码行数:18,代码来源:GPBaseMojo.java


示例3: getSourceDirectories

import org.apache.maven.shared.model.fileset.FileSet; //导入依赖的package包/类
/**
 * Combine all inputs for source files which are to be included in the SPDX analysis.
 * FileSets are all normalized to include the full (absolute) path and use filtering.
 * @return included files from the project source roots, resources, and includedDirectories parameter
 */
private FileSet[] getSourceDirectories() 
{
    ArrayList<FileSet> result = new ArrayList<FileSet>();
    @SuppressWarnings( "unchecked" )
    List<String> sourceRoots = this.mavenProject.getCompileSourceRoots();
    if ( sourceRoots != null ) 
    {
        Iterator<String> sourceRootIter = sourceRoots.iterator();
        while ( sourceRootIter.hasNext() ) {
            FileSet srcFileSet = new FileSet();
            File sourceDir = new File( sourceRootIter.next() );
            srcFileSet.setDirectory( sourceDir.getAbsolutePath() );
            srcFileSet.addInclude( INCLUDE_ALL );
            result.add( srcFileSet );
            this.getLog().debug( "Adding sourceRoot directory "+srcFileSet.getDirectory() );
        }
    }
    return result.toArray( new FileSet[result.size()] );
}
 
开发者ID:spdx,项目名称:spdx-maven-plugin,代码行数:25,代码来源:CreateSpdxMojo.java


示例4: getTestDirectories

import org.apache.maven.shared.model.fileset.FileSet; //导入依赖的package包/类
/**
 * Combine all inputs for test files which are to be included in the SPDX analysis.
 * FileSets are all normalized to include the full (absolute) path and use filtering.
 * @return included files from the project source roots, resources, and includedDirectories parameter
 */
private FileSet[] getTestDirectories() 
{
    ArrayList<FileSet> result = new ArrayList<FileSet>();
    @SuppressWarnings( "unchecked" )
    List<String> sourceRoots = this.mavenProject.getTestCompileSourceRoots();
    if ( sourceRoots != null ) 
    {
        Iterator<String> sourceRootIter = sourceRoots.iterator();
        while ( sourceRootIter.hasNext() ) {
            FileSet srcFileSet = new FileSet();
            File sourceDir = new File( sourceRootIter.next() );
            srcFileSet.setDirectory( sourceDir.getAbsolutePath() );
            srcFileSet.addInclude( INCLUDE_ALL );
            result.add( srcFileSet );
            this.getLog().debug( "Adding TestSourceRoot directory "+srcFileSet.getDirectory() );
        }
    }
    return result.toArray( new FileSet[result.size()] );
}
 
开发者ID:spdx,项目名称:spdx-maven-plugin,代码行数:25,代码来源:CreateSpdxMojo.java


示例5: testCollectFileInDirectoryPattern

import org.apache.maven.shared.model.fileset.FileSet; //导入依赖的package包/类
@Test
public void testCollectFileInDirectoryPattern() throws SpdxCollectionException {
    FileSet skipBin = new FileSet();
    skipBin.setDirectory( this.fileSets[0].getDirectory() );
    skipBin.addExclude( "**/*.bin" );
    skipBin.setOutputDirectory( this.fileSets[0].getOutputDirectory() );
    SpdxFileCollector collector = new SpdxFileCollector( null );
       SpdxFile[] SpdxFiles = collector.getFiles();
       assertEquals( 0, SpdxFiles.length );
       
       collector.collectFiles( new FileSet[] {skipBin},  this.directory.getAbsolutePath(), this.defaultFileInformation,
                                          new HashMap<String, SpdxDefaultFileInformation>(),
                                          spdxPackage, RelationshipType.GENERATES, container );
       SpdxFiles = collector.getFiles();
       assertEquals( filePaths.length - 2, SpdxFiles.length );
       Arrays.sort(  SpdxFiles );
       int SpdxFilesIndex = 0;
       for ( int i = 0; i < SpdxFileNames.length; i++ ) {
           if ( SpdxFileNames[i].endsWith( ".bin" )) {
               continue;
           }
           assertEquals( SpdxFileNames[i], SpdxFiles[SpdxFilesIndex++].getName() );
       }
}
 
开发者ID:spdx,项目名称:spdx-maven-plugin,代码行数:25,代码来源:TestSpdxFileCollector.java


示例6: testCollectFileInDirectoryPattern

import org.apache.maven.shared.model.fileset.FileSet; //导入依赖的package包/类
@Test
public void testCollectFileInDirectoryPattern() throws SpdxCollectionException {
    FileSet skipBin = new FileSet();
    skipBin.setDirectory( this.fileSets[0].getDirectory() );
    skipBin.addExclude( "**/*.bin" );
    skipBin.setOutputDirectory( this.fileSets[0].getOutputDirectory() );
    SpdxFileCollector collector = new SpdxFileCollector();
       SpdxFile[] SpdxFiles = collector.getFiles();
       assertEquals( 0, SpdxFiles.length );
       
       collector.collectFiles( new FileSet[] {skipBin},  this.defaultFileInformation,
                                          new HashMap<String, SpdxDefaultFileInformation>() );
       SpdxFiles = collector.getFiles();
       assertEquals( filePaths.length - 2, SpdxFiles.length );
       Arrays.sort(  SpdxFiles );
       int SpdxFilesIndex = 0;
       for ( int i = 0; i < SpdxFileNames.length; i++ ) {
           if ( SpdxFileNames[i].endsWith( ".bin" )) {
               continue;
           }
           assertEquals( SpdxFileNames[i], SpdxFiles[SpdxFilesIndex++].getName() );
       }
}
 
开发者ID:spdx,项目名称:spdx-maven-plugin,代码行数:24,代码来源:TestSpdxFileCollector.java


示例7: testOrderOfFileSet

import org.apache.maven.shared.model.fileset.FileSet; //导入依赖的package包/类
@Test
public void testOrderOfFileSet() {
    FileSet fs = new FileSet();
    fs.setDirectory("target/test-classes/aggregation");
    fs.setIncludes(
            ImmutableList.of(
                    "core/the-first-to-aggregate.js",
                    "core/**/*.js",
                    "utils/**/*.js",
                    "plugins/**/*uses*.js",
                    "plugins/**/*.js"
            )
    );
    Aggregation aggregation = new Aggregation();
    aggregation.setFileSets(ImmutableList.of(fs));

    final Collection<File> included = aggregation.getSelectedFiles(new File("target"));
    assertThat(included).hasSize(5);
    // Check order
    assertThat(Iterables.get(included, 0).getAbsolutePath()).isEqualToIgnoringCase(
            new File("target/test-classes/aggregation/core/the-first-to-aggregate.js").getAbsolutePath());
    assertThat(Iterables.get(included, 1).getAbsolutePath()).isEqualToIgnoringCase(
            new File("target/test-classes/aggregation/core/a.js").getAbsolutePath());
    assertThat(Iterables.get(included, 4).getAbsolutePath()).isEqualToIgnoringCase(
            new File("target/test-classes/aggregation/plugins/another-file.js").getAbsolutePath());
}
 
开发者ID:wisdom-framework,项目名称:wisdom,代码行数:27,代码来源:AggregationTest.java


示例8: testExcludes

import org.apache.maven.shared.model.fileset.FileSet; //导入依赖的package包/类
@Test
public void testExcludes() {
    FileSet fs = new FileSet();
    fs.setDirectory("target/test-classes/aggregation");
    fs.setIncludes(
            ImmutableList.of(
                    "core/the-first-to-aggregate.js",
                    "core/**/*.js",
                    "utils/**/*.js",
                    "plugins/**/*uses*.js",
                    "plugins/**/*.js"
            )
    );
    fs.setExcludes(
            ImmutableList.of("**/another-file*")
    );
    Aggregation aggregation = new Aggregation();
    aggregation.setFileSets(ImmutableList.of(fs));

    final Collection<File> included = aggregation.getSelectedFiles(new File("target"));
    assertThat(included).hasSize(4);
    assertThat(Iterables.get(included, 0).getAbsolutePath()).isEqualToIgnoringCase(
            new File("target/test-classes/aggregation/core/the-first-to-aggregate.js").getAbsolutePath());
    assertThat(Iterables.get(included, 1).getAbsolutePath()).isEqualToIgnoringCase(
            new File("target/test-classes/aggregation/core/a.js").getAbsolutePath());
}
 
开发者ID:wisdom-framework,项目名称:wisdom,代码行数:27,代码来源:AggregationTest.java


示例9: testIncludesCustomization

import org.apache.maven.shared.model.fileset.FileSet; //导入依赖的package包/类
@Test
public void testIncludesCustomization() throws MojoExecutionException, IOException {
    WebJarPackager packager = new WebJarPackager();
    packager.project = mock(MavenProject.class);
    packager.projectHelper = mock(MavenProjectHelper.class);
    when(packager.project.getArtifactId()).thenReturn("test");
    when(packager.project.getVersion()).thenReturn("1.0");
    when(packager.project.getBasedir()).thenReturn(fake);
    packager.buildDirectory = new File("target/junk");
    copy();
    packager.webjar = new WebJar();
    FileSet set = new FileSet();
    set.setDirectory(new File(classes, "assets").getAbsolutePath());
    set.setIncludes(ImmutableList.of("**/coffee/*"));
    packager.webjar.setFileset(set);

    packager.execute();
    final File wj = new File(packager.buildDirectory, "test-1.0-webjar.jar");
    assertThat(wj).isFile();
    JarFile jar = new JarFile(wj);
    assertThat(jar.getEntry(WebJarPackager.ROOT + "test/1.0/missing")).isNull();
    assertThat(jar.getEntry(WebJarPackager.ROOT + "test/1.0/coffee/script.coffee")).isNotNull();
    assertThat(jar.getEntry(WebJarPackager.ROOT + "test/1.0/less/style.less")).isNull();
}
 
开发者ID:wisdom-framework,项目名称:wisdom,代码行数:25,代码来源:WebJarPackagerTest.java


示例10: testExcludesCustomization

import org.apache.maven.shared.model.fileset.FileSet; //导入依赖的package包/类
@Test
public void testExcludesCustomization() throws MojoExecutionException, IOException {
    WebJarPackager packager = new WebJarPackager();
    packager.project = mock(MavenProject.class);
    packager.projectHelper = mock(MavenProjectHelper.class);
    when(packager.project.getArtifactId()).thenReturn("test");
    when(packager.project.getVersion()).thenReturn("1.0");
    when(packager.project.getBasedir()).thenReturn(fake);
    packager.buildDirectory = new File("target/junk");
    copy();
    packager.webjar = new WebJar();
    FileSet set = new FileSet();
    set.setDirectory(new File(classes, "assets").getAbsolutePath());
    set.setExcludes(ImmutableList.of("**/less/*"));
    packager.webjar.setFileset(set);

    packager.execute();
    final File wj = new File(packager.buildDirectory, "test-1.0-webjar.jar");
    assertThat(wj).isFile();
    JarFile jar = new JarFile(wj);
    assertThat(jar.getEntry(WebJarPackager.ROOT + "test/1.0/missing")).isNull();
    assertThat(jar.getEntry(WebJarPackager.ROOT + "test/1.0/coffee/script.coffee")).isNotNull();
    assertThat(jar.getEntry(WebJarPackager.ROOT + "test/1.0/less/style.less")).isNull();
}
 
开发者ID:wisdom-framework,项目名称:wisdom,代码行数:25,代码来源:WebJarPackagerTest.java


示例11: getIncludedFiles

import org.apache.maven.shared.model.fileset.FileSet; //导入依赖的package包/类
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);
}
 
开发者ID:SumoLogic,项目名称:epigraph,代码行数:10,代码来源:AbstractCompilingMojo.java


示例12: getBundleSets

import org.apache.maven.shared.model.fileset.FileSet; //导入依赖的package包/类
protected synchronized List<BundleSet> getBundleSets() {
    if (bundleSets == null) {
        // default SourceBundleSet
        FileSet fs = new FileSet();
        fs.setDirectory("src/main/resources");
        fs.addInclude("**/*.properties");
        // Note: This exclusion pattern might be too aggressive...
        fs.addExclude("**/*_*.properties");
        bundleSets = Collections.singletonList(new BundleSet(fs));
    }
    return bundleSets;
}
 
开发者ID:IBM-Cloud,项目名称:gp-java-tools,代码行数:13,代码来源:GPBaseMojo.java


示例13: collectFiles

import org.apache.maven.shared.model.fileset.FileSet; //导入依赖的package包/类
/**
 * Collect file information in the directory (including subdirectories).  
 * @param fileSets FileSets containing the description of the directory to be scanned
 * @param baseDir project base directory used to construct the relative paths for the SPDX files 
 * @param pathPrefix Path string which should be removed when creating the SPDX file name
 * @param defaultFileInformation Information on default SPDX field data for the files
 * @param pathSpecificInformation Map of path to file information used to override the default file information
 * @param relationshipType Type of relationship to the project package 
 * @param projectPackage Package to which the files belong
 * @param container contains the extracted license infos that may be needed for license parsing
 * @throws SpdxCollectionException 
 */
public void collectFiles( FileSet[] fileSets,
                          String baseDir, SpdxDefaultFileInformation defaultFileInformation,
                          Map<String, SpdxDefaultFileInformation> pathSpecificInformation, 
                          SpdxPackage projectPackage, RelationshipType relationshipType,
                          SpdxDocumentContainer container) throws SpdxCollectionException 
{
   for ( int i = 0; i < fileSets.length; i++ ) 
   {
       String[] includedFiles = fileSetManager.getIncludedFiles( fileSets[i] );
       for ( int j = 0; j < includedFiles.length; j++ )
       {
           String filePath = fileSets[i].getDirectory() + File.separator + includedFiles[j];
           File file = new File( filePath );
           String relativeFilePath = file.getAbsolutePath().substring( baseDir.length() + 1 ).replace( '\\', '/' );;
           SpdxDefaultFileInformation fileInfo = findDefaultFileInformation( relativeFilePath, pathSpecificInformation );
           if ( fileInfo == null ) 
           {
               fileInfo = defaultFileInformation;
           }
           
           String outputFileName;
           if ( fileSets[i].getOutputDirectory() != null ) 
           {
               outputFileName = fileSets[i].getOutputDirectory() + File.separator + includedFiles[j];
           } else 
           {
               outputFileName = file.getAbsolutePath().substring( baseDir.length() + 1 );
           }
           collectFile( file, outputFileName, fileInfo, relationshipType, projectPackage, container );
       }
   }
}
 
开发者ID:spdx,项目名称:spdx-maven-plugin,代码行数:45,代码来源:SpdxFileCollector.java


示例14: getIncludedDirectoriesFromModel

import org.apache.maven.shared.model.fileset.FileSet; //导入依赖的package包/类
/**
 * Get filsets of files included in the project from the Maven model
 * @param model Maven model
 * @return Source file set and resource filesets
 */
@SuppressWarnings( "unused" )
private FileSet[] getIncludedDirectoriesFromModel( Model model ) 
{
    //TODO: This can be refactored to common code from the CreateSpdxMojo
    ArrayList<FileSet> result = new ArrayList<FileSet>();
    String sourcePath = model.getBuild().getSourceDirectory();
    if ( sourcePath != null && !sourcePath.isEmpty() ) {
        FileSet srcFileSet = new FileSet();
        File sourceDir = new File( sourcePath );
        srcFileSet.setDirectory( sourceDir.getAbsolutePath() );
        srcFileSet.addInclude( CreateSpdxMojo.INCLUDE_ALL );
        result.add( srcFileSet );  
    }
  
    List<Resource> resourceList = model.getBuild().getResources();
    if ( resourceList != null ) 
    {
        Iterator<Resource> resourceIter = resourceList.iterator();
        while ( resourceIter.hasNext() ) 
        {
            Resource resource = resourceIter.next();
            FileSet resourceFileSet = new FileSet();
            File resourceDir = new File( resource.getDirectory() );
            resourceFileSet.setDirectory( resourceDir.getAbsolutePath() );
            resourceFileSet.setExcludes( resource.getExcludes() );
            resourceFileSet.setIncludes( resource.getIncludes() );
            result.add( resourceFileSet );
        }
    }
    return result.toArray( new FileSet[result.size()] );
}
 
开发者ID:spdx,项目名称:spdx-maven-plugin,代码行数:37,代码来源:SpdxDependencyInformation.java


示例15: logIncludedDirectories

import org.apache.maven.shared.model.fileset.FileSet; //导入依赖的package包/类
/**
 * Primarily for debugging purposes - logs includedDirectories as info
 * @param includedDirectories
 */
private void logIncludedDirectories( FileSet[] includedDirectories ) 
{
    if ( includedDirectories == null ) {
        return;
    }
    this.getLog().debug( "Logging "+String.valueOf( includedDirectories.length ) + " filesets." );
    for ( int i = 0; i < includedDirectories.length; i++ ) 
    {
        StringBuilder sb = new StringBuilder( "Included Directory: "+includedDirectories[i].getDirectory() );
        @SuppressWarnings( "unchecked" )
        List<String> includes = includedDirectories[i].getIncludes();
        if ( includes != null && includes.size() > 0) 
        {                
            sb.append( "; Included=" );
            sb.append( includes.get( 0 ) );
            for ( int j = 1; j < includes.size(); j++ ) 
            {
                sb.append( "," );
                sb.append( includes.get(j) );
            }
        }
        @SuppressWarnings( "unchecked" )
        List<String> excludes = includedDirectories[i].getExcludes();
        if ( excludes != null && excludes.size() > 0 ) 
        {
            sb.append( "; Excluded=" );
            sb.append( excludes.get( 0 ) );
            for ( int j = 1; j < excludes.size(); j++ ) 
            {
                sb.append( "," );
                sb.append( excludes.get( j ) );
            }
        }
        this.getLog().debug( sb.toString() );
    }
}
 
开发者ID:spdx,项目名称:spdx-maven-plugin,代码行数:41,代码来源:CreateSpdxMojo.java


示例16: getResourceDirectories

import org.apache.maven.shared.model.fileset.FileSet; //导入依赖的package包/类
/**
 * Combine all inputs for resource files which are to be included in the SPDX analysis.
 * FileSets are all normalized to include the full (absolute) path and use filtering.
 * @return included files from the project source roots, resources, and includedDirectories parameter
 */
private FileSet[] getResourceDirectories() 
{
    ArrayList<FileSet> result = new ArrayList<FileSet>();
    @SuppressWarnings( "unchecked" )
    List<String> sourceRoots = this.mavenProject.getCompileSourceRoots();
    if ( sourceRoots != null ) 
    {
        Iterator<String> sourceRootIter = sourceRoots.iterator();
        while ( sourceRootIter.hasNext() ) {
            FileSet srcFileSet = new FileSet();
            File sourceDir = new File( sourceRootIter.next() );
            srcFileSet.setDirectory( sourceDir.getAbsolutePath() );
            srcFileSet.addInclude( INCLUDE_ALL );
            result.add( srcFileSet );
            this.getLog().debug( "Adding sourceRoot directory "+srcFileSet.getDirectory() );
        }
    }
    @SuppressWarnings( "unchecked" )
    List<Resource> resourceList = this.mavenProject.getResources();
    if ( resourceList != null ) 
    {
        Iterator<Resource> resourceIter = resourceList.iterator();
        while ( resourceIter.hasNext() ) 
        {
            Resource resource = resourceIter.next();
            FileSet resourceFileSet = new FileSet();
            File resourceDir = new File( resource.getDirectory() );
            resourceFileSet.setDirectory( resourceDir.getAbsolutePath() );
            resourceFileSet.setExcludes( resource.getExcludes() );
            resourceFileSet.setIncludes( resource.getIncludes() );
            result.add( resourceFileSet );
            this.getLog().debug( "Adding resource directory "+resource.getDirectory() );
        }
    }
    this.getLog().debug( "Number of filesets: "+String.valueOf( result.size() ) );
    return result.toArray( new FileSet[result.size()] );
}
 
开发者ID:spdx,项目名称:spdx-maven-plugin,代码行数:43,代码来源:CreateSpdxMojo.java


示例17: testGetLicenseInfoFromFiles

import org.apache.maven.shared.model.fileset.FileSet; //导入依赖的package包/类
@Test
public void testGetLicenseInfoFromFiles() throws SpdxCollectionException, IOException, InvalidLicenseStringException {
       SpdxFileCollector collector = new SpdxFileCollector();
       AnyLicenseInfo[] result = collector.getLicenseInfoFromFiles();
       assertEquals( 0, result.length );
       
       collector.collectFiles( this.fileSets, this.defaultFileInformation,
                                          new HashMap<String, SpdxDefaultFileInformation>() );
       result = collector.getLicenseInfoFromFiles();
       assertEquals( 1, result.length );
       assertEquals( DEFAULT_DECLARED_LICENSE, result[0].toString() );
       
       File tempDir2 = Files.createTempDir();
       try {
           File oneMoreFile = new File( tempDir2.getPath() + File.separator + "oneMore.c") ;
           oneMoreFile.createNewFile();
           createUniqueContent( oneMoreFile );
           SpdxDefaultFileInformation info2 = new SpdxDefaultFileInformation();
           info2.setConcludedLicense( this.defaultFileInformation.getConcludedLicense() );
           info2.setCopyright( this.defaultFileInformation.getCopyright() );
           String newLicenseName = "LicenseRef-newLicense";
           AnyLicenseInfo newDeclaredLicense = LicenseInfoFactory.parseSPDXLicenseString( newLicenseName );
           info2.setDeclaredLicense( newDeclaredLicense );
           FileSet fileSet2 = new FileSet();
           fileSet2.setDirectory( tempDir2.getPath() );
           
           collector.collectFiles( new FileSet[] { fileSet2 }, info2,
                                              new HashMap<String, SpdxDefaultFileInformation>() );
           result = collector.getLicenseInfoFromFiles();
           assertEquals( 2, result.length );
           if ( result[0].toString().equals( DEFAULT_DECLARED_LICENSE )) {
               assertEquals( newLicenseName, result[1].toString() );
           } else {
               assertEquals( newLicenseName, result[0].toString() );
               assertEquals( DEFAULT_DECLARED_LICENSE, result[1].toString() );
           }
       } finally {
           deleteDirectory( tempDir2 );
       }
}
 
开发者ID:spdx,项目名称:spdx-maven-plugin,代码行数:41,代码来源:TestSpdxFileCollector.java


示例18: getSelectedFiles

import org.apache.maven.shared.model.fileset.FileSet; //导入依赖的package包/类
/**
 * @return the selected set of files.
 */
public Collection<File> getSelectedFiles(File defaultBaseDirectory) {
    List<File> result = new ArrayList<>();
    final List<FileSet> sets = getFileSets();

    if (sets != null  && ! sets.isEmpty()) {
        for (FileSet set : sets) {
            File base;
            if (set.getDirectory() == null) {
                // Set the directory if not set
                set.setDirectory(defaultBaseDirectory.getAbsolutePath());
                base = defaultBaseDirectory;
            } else {
                base = new File(set.getDirectory());
            }

            for (String include : set.getIncludesArray()) {
                // We don't extract the selected file set directly because the it does not enforce the include order.
                // So we iterate over the set of include clause one by one, and include files if not already included.
                addInto(base, set, include, result);
            }
        }
    } else {
        for (String f : getFiles()) {
            File file = new File(f);
            if (!file.isAbsolute()) {
                file = new File(defaultBaseDirectory, f);
            }
            result.add(file);
        }
    }
    return result;
}
 
开发者ID:wisdom-framework,项目名称:wisdom,代码行数:36,代码来源:Aggregation.java


示例19: newScanner

import org.apache.maven.shared.model.fileset.FileSet; //导入依赖的package包/类
private DirectoryScanner newScanner(File base, FileSet fileSet) {
    DirectoryScanner scanner = new DirectoryScanner();
    scanner.setBasedir(base);
    if ((fileSet.getExcludes() != null) && (fileSet.getExcludes().size() != 0)) {
        scanner.setExcludes(fileSet.getExcludesArray());
    }
    scanner.addDefaultExcludes();
    return scanner;
}
 
开发者ID:wisdom-framework,项目名称:wisdom,代码行数:10,代码来源:Aggregation.java


示例20: getSelectedFiles

import org.apache.maven.shared.model.fileset.FileSet; //导入依赖的package包/类
/**
 * @return the selected set of files.
 */
public Collection<File> getSelectedFiles() {
    // Because of a symlink issue on OpenJDK, we cannot use the FileSetManager directory, because we need to
    // override a method from the DirectoryScanner.
    // The exception is: java.lang.ClassNotFoundException: sun/nio/fs/AixFileSystemProvider

    final FileSet set = getFileset();
    String[] names = FILESET_MANAGER.getIncludedFiles(set);
    List<File> files = new ArrayList<>();
    File base = new File(set.getDirectory());
    for (String n : names) {
        files.add(new File(base, n));
    }
    return files;
}
 
开发者ID:wisdom-framework,项目名称:wisdom,代码行数:18,代码来源:WebJar.java



注:本文中的org.apache.maven.shared.model.fileset.FileSet类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BuildMessage类代码示例发布时间:2022-05-22
下一篇:
Java FileContent类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap