Package org.apache.commons.io.filefilter

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


    private static void addXMLTestCases(TestSuite suite) throws IOException {
        File mainDir = new File("test/fotree");

        final FOTreeTester tester = new FOTreeTester();
       
        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) {
View Full Code Here


     * @return a Collection of File instances containing all the test cases set up for processing.
     * @throws IOException if there's a problem gathering the list of test files
     */
    public static Collection getTestFiles() throws IOException {
        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) {
View Full Code Here

        if (fileFilter == null) {
            throw new NullPointerException("Parameter 'fileFilter' is null");
        }
       
        //Setup effective file filter
        IOFileFilter effFileFilter = FileFilterUtils.andFileFilter(fileFilter,
            FileFilterUtils.notFileFilter(DirectoryFileFilter.INSTANCE));
           
        //Setup effective directory filter
        IOFileFilter effDirFilter;
        if (dirFilter == null) {
            effDirFilter = FalseFileFilter.INSTANCE;
        } else {
            effDirFilter = FileFilterUtils.andFileFilter(dirFilter,
                DirectoryFileFilter.INSTANCE);
View Full Code Here

     * parameter is null, all files are returned.
     * @param recursive If true all subdirectories are searched, too.
     * @return an collection of java.io.File with the matching files
     */
    public static Collection listFiles(File directory, String[] extensions, boolean recursive) {
        IOFileFilter filter;
        if (extensions == null) {
            filter = TrueFileFilter.INSTANCE;
        } else {
            String[] suffixes = toSuffixes(extensions);
            filter = new SuffixFileFilter(suffixes);
View Full Code Here

    }

    public void testListFiles() throws Exception {
        Collection files;
        Collection filenames;
        IOFileFilter fileFilter;
        IOFileFilter dirFilter;
       
        //First, find non-recursively
        fileFilter = FileFilterUtils.trueFileFilter();
        files = FileUtils.listFiles(getLocalTestDirectory(), fileFilter, null);
        filenames = filesToFilenames(files);
View Full Code Here

     *
     */
    private boolean compileAllFiles(String tag, File[] inputDirs, File outputDir)
        throws MojoExecutionException
    {
        final IOFileFilter filter = new SuffixFileFilter(".proto");

        boolean seen = false;
        for (File inputDir : inputDirs) {
            if (!inputDir.exists()) {
                continue;
View Full Code Here

    private static void addXMLTestCases(TestSuite suite) throws IOException {
        File mainDir = new File("test/fotree");

        final FOTreeTester tester = new FOTreeTester();

        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) {
View Full Code Here

            boolean stopOnException = cfg.getChild("stop-on-exception").getValueAsBoolean(true);
            final boolean createDiffs = cfg.getChild("create-diffs").getValueAsBoolean(true);

            //RUN!

            IOFileFilter filter = new SuffixFileFilter(new String[] {".xml", ".fo"});
            //Same filtering as in layout engine tests
            if (cfg.getChild("filter-disabled").getValueAsBoolean(true)) {
                filter = LayoutEngineTestSuite.decorateWithDisabledList(filter);
            }
            String manualFilter = cfg.getChild("manual-filter").getValue(null);
View Full Code Here

     * @return a Collection of File instances containing all the test cases set up for processing.
     * @throws IOException if there's a problem gathering the list of test files
     */
    public static Collection getTestFiles() throws IOException {
        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) {
View Full Code Here

     */
    public void create(File oldDir, File newDir, File outFile, IOCase caseSensitive) throws IOException {
        OutputStream out = null;
        try {
            out = FileUtils.openOutputStream(outFile);
            IOFileFilter filter = TrueFileFilter.TRUE;
            create(oldDir, newDir, filter, out, caseSensitive);
        } finally {
            IOUtils.closeQuietly(out);
        }
    }
View Full Code Here

TOP

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

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.