Package java.io

Examples of java.io.FileFilter.accept()


        assertTrue( filter.accept(new File("file.mp3")) );
        assertTrue( filter.accept(new File("file.wma")) );
        assertTrue( filter.accept(new File("file.ogg")) );
        assertTrue( filter.accept(new File("file.asf")) );
        assertTrue( filter.accept(new File("file.flac")) );
        assertTrue( filter.accept(new File("file.m4a")) );
        assertTrue( filter.accept(new File("file.MP3")) );
        assertTrue( filter.accept(new File("/folder/file.MP3")) );
    }

}
View Full Code Here


        assertTrue( filter.accept(new File("file.wma")) );
        assertTrue( filter.accept(new File("file.ogg")) );
        assertTrue( filter.accept(new File("file.asf")) );
        assertTrue( filter.accept(new File("file.flac")) );
        assertTrue( filter.accept(new File("file.m4a")) );
        assertTrue( filter.accept(new File("file.MP3")) );
        assertTrue( filter.accept(new File("/folder/file.MP3")) );
    }

}
View Full Code Here

        assertTrue( filter.accept(new File("file.ogg")) );
        assertTrue( filter.accept(new File("file.asf")) );
        assertTrue( filter.accept(new File("file.flac")) );
        assertTrue( filter.accept(new File("file.m4a")) );
        assertTrue( filter.accept(new File("file.MP3")) );
        assertTrue( filter.accept(new File("/folder/file.MP3")) );
    }

}

class Directory extends File {
View Full Code Here

                // Setting dragged files
                final FileFilter filter = getFileFilter ();
                for ( final File file : files )
                {
                    final File actualFile = file.isDirectory () ? file : file.getParentFile ();
                    if ( filter == null || filter.accept ( actualFile ) )
                    {
                        folderSelected ( actualFile );
                        return true;
                    }
                }
View Full Code Here

            File[] files = pkgDir.listFiles();
            if (files != null) {
                for(File src : files) {
                    if(src.isFile() && src.getName().toLowerCase().endsWith(".ceylon")) {
                        String baseName = src.getName().substring(0, src.getName().length() - 7);
                        if (!exceptions.accept(src)) {
                            sourceFiles.add(src);
                        } else {
                            addJavaSourceFile(baseName, sourceFiles, javaPkgDir, false);
                        }
                    }
View Full Code Here

            return false;
        }

        for (Iterator<FileFilter> iter = this.fileFilters.iterator(); iter.hasNext();) {
            FileFilter fileFilter = (FileFilter) iter.next();
            if (!fileFilter.accept(file)) {
                return false;
            }
        }

        return true;
View Full Code Here

    }

    public static void assertFilterMatches(String fileName, String wildcard, boolean expected) {
        File file = new File(fileName);
        FileFilter filter = FileFilters.createFileFilter(wildcard);
        boolean actual = filter.accept(file);
        assertEquals("Comparison of file name: " + fileName + " with wildcard: " + wildcard, expected, actual);
    }

}
View Full Code Here

            accepted = true;

            while (accepted && it.hasNext())
            {
                filter = it.next();
                accepted = filter.accept (file);
            }
        }

        else
        {
View Full Code Here

            accepted = false;

            while ((! accepted) && it.hasNext())
            {
                filter = it.next();
                accepted = filter.accept (file);
            }
        }

        return accepted;
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.