Package java.io

Examples of java.io.FileFilter


        }

        public List<String> list(File directory, FilenameFilter filter,
                boolean recursive, boolean root) {
            if (recursive) {
                File[] dirs = directory.listFiles(new FileFilter() {

                    public boolean accept(File pathname) {
                        if (pathname.isDirectory())
                            return true;
                        return false;
View Full Code Here


            if (!actualParent.exists())
            {
                throw new IOException("File does not exist");
            }
            final List<String> pieces = parseSubstring(target);
            files = actualParent.listFiles(new FileFilter() {
                public boolean accept(File pathname)
                {
                    return compareSubstring(pieces, pathname.getName());
                }
            });
View Full Code Here

    }

    public static Set<String> getAllNames() {
        Set<String> result = new HashSet<String>();
        File rootDir = getRootDir();
        File[] directories = rootDir.listFiles(new FileFilter() {
            public boolean accept(File file) {
                return file.isDirectory();
            }
        });
    if(directories != null) {
View Full Code Here

     *         <code>null</code> is returned if an IO error occurs trying to
     *         list the files.
     */
    private File[] getLauncherJarFiles() {
        // Get list of files with names starting with our prefix
        final File[] rawList = launchpadHome.listFiles(new FileFilter() {
            public boolean accept(File pathname) {
                return pathname.isFile()
                    && pathname.getName().startsWith(
                        SharedConstants.LAUNCHER_JAR_REL_PATH);
            }
View Full Code Here

        if (!errorDirectory.exists()) {
            errorDirectory.mkdirs();
        }

        final String errorBase = getScreenshotErrorBaseName();
        File[] files = errorDirectory.listFiles(new FileFilter() {

            @Override
            public boolean accept(File pathname) {
                String thisFile = pathname.getAbsolutePath();
                if (thisFile.startsWith(errorBase)) {
View Full Code Here

    }

    @Override
    public Iterable<FileSystemFile> getChildren(final LocalFileFilter filter)
            throws IOException {
        File[] childFiles = filter == null ? file.listFiles() : file.listFiles(new FileFilter() {
            @Override
            public boolean accept(File file) {
                return filter.accept(new FileSystemFile(file));
            }
        });
View Full Code Here

        return list;
    }

    @Override
    public File[] filesByExtension(String extension) {
        FileFilter filter = FileFilters.withExtension(extension);
        File[] files = directory.listFiles(filter);
        return files != null ? files : new File[] { };
    }
View Full Code Here

       String baseDir = DOMUtil.getAttr(node, "dir");
       String path = DOMUtil.getAttr(node, "path");
       if (null != baseDir) {
         // :TODO: add support for a simpler 'glob' mutually eclusive of regex
         String regex = DOMUtil.getAttr(node, "regex");
         FileFilter filter = (null == regex) ? null : new RegexFileFilter(regex);
         getResourceLoader().addToClassLoader(baseDir, filter);
       } else if (null != path) {
         getResourceLoader().addToClassLoader(path);
       } else {
         throw new RuntimeException
View Full Code Here

    *
    * @see {@link ConfigurationRuleParameterBuilder#where(String)}
    */
   public static Filesystem fileExists(final File resource)
   {
      return new Filesystem(resource, new FileFilter()
      {
         @Override
         public boolean accept(File file)
         {
            return file.exists() && file.isFile();
View Full Code Here

    *
    * @see {@link ConfigurationRuleParameterBuilder#where(String)}
    */
   public static Filesystem directoryExists(final File resource)
   {
      return new Filesystem(resource, new FileFilter()
      {
         @Override
         public boolean accept(File file)
         {
            return file.exists() && file.isDirectory();
View Full Code Here

TOP

Related Classes of java.io.FileFilter

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.