edu.rice.cs.drjava.model
Class JDKDescriptor.Util

java.lang.Object
  extended by edu.rice.cs.drjava.model.JDKDescriptor.Util
Enclosing class:
JDKDescriptor

public static class JDKDescriptor.Util
extends Object

Utilities for JDK descriptors.


Constructor Summary
JDKDescriptor.Util()
           
 
Method Summary
static boolean exists(File jarOrDir, String... fileNames)
          Return true if the file names exist in the specified file, which can either be a directory or jar file.
static File oneOf(File dir, String... fileNames)
          Return the first of the file names that exists in the specified directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDKDescriptor.Util

public JDKDescriptor.Util()
Method Detail

exists

public static boolean exists(File jarOrDir,
                             String... fileNames)
Return true if the file names exist in the specified file, which can either be a directory or jar file.

Parameters:
jarOrDir - jar file or directory
fileNames - file names that need to exist
Returns:
true if all file names are found

oneOf

public static File oneOf(File dir,
                         String... fileNames)
                  throws FileNotFoundException
Return the first of the file names that exists in the specified directory. Throws FileNotFoundException if none of them exists.

Parameters:
jarOrDir - jar file or directory
fileNames - file names that need to exist
Returns:
file name if found, or null
Throws:
FileNotFoundException - if none of them exists.