Package org.apache.commons.io.filefilter

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


    public IVResource[] findChildren(String childName) {
        // TODO Auto-generated method stub
        Path path = new Path(childName);
        IOFileFilter filter;
        if (path.segment(0).equals("*")) {
            filter = new NameFileFilter(path.lastSegment());
        } else {
            String lastSegment = path.lastSegment();
            if (lastSegment.startsWith("*")) {
                filter = new SuffixFileFilter(lastSegment.substring(1));
            } else {
View Full Code Here


  public Collection findFiles(IStorage f1, String pathStr, boolean ignoreCase) {
    IOFileFilter filter;
    IPath path = new Path(pathStr);
    if (path.segment(0).equals("*")) {
      IOCase ioCase = ignoreCase ? IOCase.INSENSITIVE    : IOCase.SENSITIVE;
      filter = new NameFileFilter(path.lastSegment(), ioCase);
    } else {
      String lastSegment = path.lastSegment();
      if (lastSegment.startsWith("*")) {
        filter = new SuffixFileFilter(lastSegment.substring(1));
      } else {
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"));
            filter = decorateWithDisabledList(filter);
        } else {
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

    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

     */
    private void update( File checkout, File dir, List<String> doNotDeleteDirs )
        throws IOException
    {
        String[] files =
            checkout.list( new NotFileFilter( new NameFileFilter( scmProvider.getScmSpecificFilename() ) ) );

        Set<String> checkoutContent = new HashSet<String>( Arrays.asList( files ) );
        List<String> dirContent = ( dir != null ) ? Arrays.asList( dir.list() ) : Collections.<String>emptyList();

        Set<String> deleted = new HashSet<String>( checkoutContent );
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

       
        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

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.