|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mindswap.pellet.utils.FileUtils
public class FileUtils
Constructor Summary | |
---|---|
FileUtils()
|
Method Summary | |
---|---|
static boolean |
exists(java.lang.String file)
|
static java.lang.String |
getFileURI(java.lang.String fileName)
Creates a URI from a given file name. |
static java.util.Collection<java.lang.String> |
getFileURIs(java.lang.String... fileNameList)
Creates a collection of URIs from a given list of files. |
static java.util.Collection<java.lang.String> |
getFileURIsFromRegex(java.lang.String... fileNameRegexList)
Creates a collection of URIs from a given regex list. |
static java.lang.String |
readAll(java.io.Reader reader)
|
static java.lang.String |
readFile(java.io.File file)
|
static java.lang.String |
readFile(java.lang.String fileName)
|
static java.lang.String |
readURL(java.net.URL fileURL)
|
static java.lang.String |
toURI(java.lang.String fileName)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileUtils()
Method Detail |
---|
public static boolean exists(java.lang.String file)
public static java.lang.String readURL(java.net.URL fileURL) throws java.io.IOException
java.io.IOException
public static java.lang.String readFile(java.io.File file) throws java.io.FileNotFoundException, java.io.IOException
java.io.FileNotFoundException
java.io.IOException
public static java.lang.String readFile(java.lang.String fileName) throws java.io.FileNotFoundException, java.io.IOException
java.io.FileNotFoundException
java.io.IOException
public static java.lang.String readAll(java.io.Reader reader) throws java.io.IOException
java.io.IOException
public static java.lang.String toURI(java.lang.String fileName)
public static java.util.Collection<java.lang.String> getFileURIsFromRegex(java.lang.String... fileNameRegexList)
Creates a collection of URIs from a given regex list. The given list can contain either absolute (local or remote) URIs or a Java regex expression for a local path. If a regex is given all the files whose name matches the regex will be added to the resulting list.
The regular expressions supported by this function are Java regular
expressions. If we want to get the URIS for all the files in a directory
we need to pass /path/to/dir/.*
fileNameRegexList
- list of regular expressions for fiel URIs
public static java.util.Collection<java.lang.String> getFileURIs(java.lang.String... fileNameList)
fileNameList
- the list of files
public static java.lang.String getFileURI(java.lang.String fileName)
fileNameList
- the list of files
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |