Java Folder Read getFilesOf(File dir)

Here you can find the source of getFilesOf(File dir)

Description

get Files Of

License

Apache License

Declaration

public static File[] getFilesOf(File dir) throws IllegalArgumentException 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.io.File;

public class Main {

    public static File[] getFilesOf(File dir) throws IllegalArgumentException {
        if (dir == null) {
            throw new IllegalArgumentException("argument must not be null.");
        }/* w  w w .j  ava  2s  .co m*/
        File[] files = dir.listFiles();
        if (files == null) {
            throw new IllegalArgumentException("could not get files of [" + dir + "]");
        }
        return files;
    }
}

Related

  1. getFilesInFolder(File dir)
  2. getFilesInFolder(final String pathToFolder, final String suffix)
  3. getFilesInFolderByRegex(File folder, final String regex)
  4. getFilesMatchingRegexp(final File directory, final String regexp)
  5. getFilesModDate(String path)
  6. getFilesOfDirectory(File directory)
  7. getFilesOfTypeInDirectory(File directory, String filetype)
  8. getFilesRegex(final File root, final String[] regex)
  9. getFilesStartingWith(File parentDir, String prefix)