Package org.apache.commons.io.filefilter

Examples of org.apache.commons.io.filefilter.NameFileFilter


  @Override
  protected void processDirectory( List<IPlatformPlugin> plugins, File folder, IPentahoSession session )
    throws PlatformPluginRegistrationException {
    // see if there is a plugin.xml file
    FilenameFilter filter = new NameFileFilter( "plugin.xml", IOCase.SENSITIVE ); //$NON-NLS-1$
    File[] kids = folder.listFiles( filter );
    if ( kids == null || kids.length == 0 ) {
      return;
    }
    boolean hasLib = false;
    filter = new NameFileFilter( "lib", IOCase.SENSITIVE ); //$NON-NLS-1$
    kids = folder.listFiles( filter );
    if ( kids != null && kids.length > 0 ) {
      hasLib = kids[0].exists() && kids[0].isDirectory();
    }
    // we have found a plugin.xml file
View Full Code Here


       
        IOFileFilter filter;
        String single = System.getProperty("fop.fotree.single");
        String startsWith = System.getProperty("fop.fotree.starts-with");
        if (single != null) {
            filter = new NameFileFilter(single);
        } else if (startsWith != null) {
            filter = new PrefixFileFilter(startsWith);
            filter = new AndFileFilter(filter, new SuffixFileFilter(".fo"));
        } else {
            filter = new SuffixFileFilter(".fo");
View Full Code Here

   
    public static IOFileFilter decorateWithDisabledList(IOFileFilter filter) throws IOException {
        String disabled = System.getProperty("fop.layoutengine.disabled");
        if (disabled != null && disabled.length() > 0) {
            filter = new AndFileFilter(new NotFileFilter(
                           new NameFileFilter(readDisabledTestcases(new File(disabled)))),
                    filter);
        }
        return filter;
    }
View Full Code Here

        File mainDir = new File("test/layoutengine");
        IOFileFilter filter;
        String single = System.getProperty("fop.layoutengine.single");
        String startsWith = System.getProperty("fop.layoutengine.starts-with");
        if (single != null) {
            filter = new NameFileFilter(single);
        } else if (startsWith != null) {
            filter = new PrefixFileFilter(startsWith);
            filter = new AndFileFilter(filter, new SuffixFileFilter(".xml"));
        } else {
            filter = new SuffixFileFilter(".xml");
View Full Code Here

     
      File templateDir = node.root().template(templateName).dir();
     
      if(templateDir.exists()) {
        IOFileFilter hiddenFilesFilter = FileFilterUtils.or(
            FileFilterUtils.notFileFilter(new PrefixFileFilter(".")), new NameFileFilter(".gitignore") );
        IOFileFilter fileFilter = FileFilterUtils.and( new FileDoesntAlreadyExistFileFilter(templateDir, node.dir()), hiddenFilesFilter );
        FileUtils.copyDirectory(templateDir, tempDir, fileFilter);
      }
     
      if(!transformations.isEmpty()) {
View Full Code Here

  }
 
  @Test
  public void getAllFilesAndFoldersMatchingFilterIncludingSubdirectories() throws Exception
  {
    List<File> files = FileUtility.getAllFilesAndFoldersMatchingFilterIncludingSubdirectories(new File("src/test/resources/FileUtiltyTest"), new NameFileFilter("folderB"));
    assertEquals(1, files.size());
    assertEquals("folderB", files.get(0).getName());
  }
View Full Code Here

        for (String dir : toolDirectories) {
            File toolsDir = new File(sdkRoot, dir);
            if (!toolsDir.isDirectory()) {
                continue;
            }
            IOFileFilter filter = new NameFileFilter(Tool.getAllExecutableVariants(Tool.REQUIRED));
            toolsFound += FileUtils.listFiles(toolsDir, filter, TrueFileFilter.INSTANCE).size();
        }
        if (toolsFound < Tool.REQUIRED.length) {
            return ValidationResult.errorWithMarkup(Messages.REQUIRED_SDK_TOOLS_NOT_FOUND());
        }
View Full Code Here

        File grandParentDir = new File(getTestDirectory(), "grandparent");
        File parentDir      = new File(grandParentDir, "parent");
        File childDir       = new File(parentDir, "child");
        createFilesForTestCopyDirectory(grandParentDir, parentDir, childDir);

        NameFileFilter filter = new NameFileFilter(new String[] {"parent", "child", "file3.txt"});
        File destDir       = new File(getTestDirectory(), "copydest");

        FileUtils.copyDirectory(grandParentDir, destDir, filter);
        List<File> files  = LIST_WALKER.list(destDir);
        assertEquals(3, files.size());
View Full Code Here

    private static IOFileFilter createNameFilter(File[] files) {
        String[] names = new String[files.length];
        for (int i = 0; i < files.length; i++) {
            names[i] = files[i].getName();
        }
        return new NameFileFilter(names);
    }
View Full Code Here

      JFrame frame = JComponentBoostUtils.createDisposingJFrameWithOneComponent(new JTree(rootNode), 800, 800);
   }
  
   public static void main(String[] ignored) throws Exception
   {
      NameFileFilter navigationConfigFilter = new NameFileFilter("navigation-config.xml");
      OrFileFilter fileFilter = new OrFileFilter(DirectoryFileFilter.INSTANCE, navigationConfigFilter);
      BoostFunction navigationFilter = new ReflectionFunctions(ReflectionFunctions.Operation.invokeMethodOfOtherObject, fileFilter, "accept");
      //displayDirectory("C:/christian/projekte/opensource/gluebooster/glueBoosterApplications/assetManagement/target/assetManagement/WEB-INF/useCases", navigationFilter);
      displayDirectory("C:/christian/projekte/opensource/gluebooster/glueBoosterApplications/assetManagement/target/assetManagement/WEB-INF/useCases", navigationFilter);
     
View Full Code Here

TOP

Related Classes of org.apache.commons.io.filefilter.NameFileFilter

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.