Java Directory Check checkDirectory(final File directory)

Here you can find the source of checkDirectory(final File directory)

Description

check Directory

License

BSD License

Declaration

public static void checkDirectory(final File directory) throws IOException 

Method Source Code

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

import java.io.File;
import java.io.IOException;

public class Main {
    public static void checkDirectory(final File directory) throws IOException {
        if (directory.exists()) {
            if (!directory.isDirectory()) {
                throw new IOException(directory + " is not a directory");
            }//  ww  w.  jav a2 s . c  o  m
        } else {
            throw new IOException(directory + " doesn't exist");
        }
    }
}

Related

  1. checkDirectory(File directory)
  2. checkDirectory(File directory)
  3. checkDirectory(File directory, String pckgname, ArrayList> classes)
  4. checkDirectory(File file)
  5. checkDirectory(File target)
  6. checkDirectory(final String dir, final boolean create, final String errorDirName)
  7. checkDirectory(String value)
  8. checkDirectoryArray(String[] names)
  9. checkDirectoryInWorkspace(String directoryName)