Java Directory to File List getAllFilesInternal(final File aPath, final FilenameFilter filter, final List fileList)

Here you can find the source of getAllFilesInternal(final File aPath, final FilenameFilter filter, final List fileList)

Description

get All Files Internal

License

Open Source License

Declaration

private static void getAllFilesInternal(final File aPath, final FilenameFilter filter,
            final List<File> fileList) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 005, 2007, 2008 committers of openArchitectureWare and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors://from w  w  w.j  a  v  a2s . c o m
 *     committers of openArchitectureWare - initial API and implementation
 *******************************************************************************/

import java.io.File;

import java.io.FilenameFilter;

import java.util.List;

public class Main {
    private static void getAllFilesInternal(final File aPath, final FilenameFilter filter,
            final List<File> fileList) {
        final File[] allFiles = aPath.listFiles(filter);
        for (int i = 0; i < allFiles.length; i++) {
            if (allFiles[i].isDirectory())
                getAllFilesInternal(allFiles[i], filter, fileList);
            else
                fileList.add(allFiles[i]);
        }
    }
}

Related

  1. getAllFilesInFolder(File rootFolder, FileFilter filter, int maxFilesRequired)
  2. getAllFilesInFolder(String folder)
  3. getAllFilesInFolderAndSubFolders(String folder)
  4. getAllFilesInHierarchy(final String basePath, final FilenameFilter filter)
  5. getAllFilesInSubFolder(String base, String ending)
  6. getAllFilesLeastRecentFirst(File directory)
  7. getAllFilesMatching(File srcDir, final String regex)
  8. getAllFilesMatchingThisPatternIgnoreCase(String sDirectoryPath, String sPattern)
  9. getAllFilesPresentInFolder(File srcPath)