|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.glite.authz.common.util.Files
public final class Files
A utility class for working with files.
Method Summary | |
---|---|
static byte[] |
fileToByteArray(java.io.File file)
Reads the contents of a file in to a byte array. |
static java.io.File |
getFile(java.lang.String filePath,
boolean requireFile,
boolean requireExistance,
boolean requireReadable,
boolean requireWritable)
Gets the file object associated with the path. |
static java.io.File |
getReadableFile(java.lang.String filePath)
A convenience method for getting a file and requiring it to be a readable file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.io.File getReadableFile(java.lang.String filePath) throws java.io.IOException
getFile(filePath, true, true, true, false)
.
filePath
- the path to the file
java.io.IOException
- thrown if the file is a directory, does not exist, or can not be readpublic static java.io.File getFile(java.lang.String filePath, boolean requireFile, boolean requireExistance, boolean requireReadable, boolean requireWritable) throws java.io.IOException
filePath
- the file pathrequireFile
- whether the given path is required to be a file instead of a directoryrequireExistance
- whether the given file/directory must exist alreadyrequireReadable
- whether the given file/directory must be readablerequireWritable
- whether the given file/directory must be writable
java.io.IOException
- thrown if existance, reabability, or writability is required but not metpublic static byte[] fileToByteArray(java.io.File file) throws java.io.IOException
file
- file to read
java.io.IOException
- throw if there is a problem reading the file in to the byte array
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |