|
Nuxeo Enterprise Platform 5.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.nuxeo.common.utils.FileUtils
public final class FileUtils
Method Summary | |
---|---|
static void |
append(java.io.File src,
java.io.File dst)
|
static void |
append(java.io.File src,
java.io.File dst,
boolean appendNewLine)
|
static void |
append(java.io.InputStream in,
java.io.File file)
|
static void |
append(java.io.InputStream in,
java.io.File file,
boolean appendNewLine)
|
static void |
close(java.io.InputStream in)
|
static void |
close(java.io.OutputStream out)
|
static void |
collectFiles(java.io.File root,
FileNamePattern pattern,
java.util.List<java.io.File> result)
|
static void |
collectFiles(java.io.File root,
java.util.List<java.io.File> result)
|
static void |
copy(java.io.File[] src,
java.io.File dst)
|
static void |
copy(java.io.File src,
java.io.File dst)
Copies source to destination. |
static void |
copy(java.io.InputStream in,
java.io.OutputStream out)
|
static void |
copyFile(java.io.File src,
java.io.File dst)
|
static void |
copyToFile(java.io.InputStream in,
java.io.File file)
|
static void |
copyTree(java.io.File src,
java.io.File dst)
Copies recursively source to destination. |
static void |
copyTree(java.io.File src,
java.io.File dst,
PathFilter filter)
|
static void |
deleteTree(java.io.File dir)
|
static void |
download(java.net.URL url,
java.io.File file)
|
static void |
emptyDirectory(java.io.File dir)
|
static java.io.File[] |
findFiles(java.io.File root,
java.lang.String pattern,
boolean recurse)
|
static java.lang.String |
getFileExtension(java.lang.String path)
|
static java.io.File |
getFileFromURL(java.net.URL url)
|
static java.lang.String |
getFileName(java.lang.String path)
|
static java.lang.String |
getFileNameNoExt(java.lang.String path)
|
static java.lang.String |
getFilePathFromUrl(java.net.URL url)
Decodes an URL path so that is can be processed as a filename later. |
static java.lang.String |
getParentPath(java.lang.String path)
|
static java.io.File |
getResourceFileFromContext(java.lang.String resource)
|
static java.lang.String |
getResourcePathFromContext(java.lang.String resource)
Retrieves the total path of a resource from the Thread Context. |
static java.lang.String |
read(java.io.InputStream in)
|
static byte[] |
readBytes(java.io.File file)
|
static byte[] |
readBytes(java.io.InputStream in)
|
static byte[] |
readBytes(java.net.URL url)
|
static java.lang.String |
readFile(java.io.File file)
|
static java.util.List<java.lang.String> |
readLines(java.io.File file)
|
static java.util.List<java.lang.String> |
readLines(java.io.InputStream in)
|
static void |
safeClose(java.io.Closeable stream)
|
static java.io.File |
urlToFile(java.lang.String url)
Create a file handler (this doesn't create a real file) given a file URI. |
static java.io.File |
urlToFile(java.net.URL url)
|
static void |
writeFile(java.io.File file,
byte[] buf)
|
static void |
writeFile(java.io.File file,
java.lang.String buf)
|
static void |
writeLines(java.io.File file,
java.util.List<java.lang.String> lines)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void safeClose(java.io.Closeable stream)
public static void copy(java.io.InputStream in, java.io.OutputStream out) throws java.io.IOException
java.io.IOException
public static java.lang.String read(java.io.InputStream in) throws java.io.IOException
java.io.IOException
public static byte[] readBytes(java.net.URL url) throws java.io.IOException
java.io.IOException
public static byte[] readBytes(java.io.InputStream in) throws java.io.IOException
java.io.IOException
public static java.lang.String readFile(java.io.File file) throws java.io.IOException
java.io.IOException
public static java.util.List<java.lang.String> readLines(java.io.File file) throws java.io.IOException
java.io.IOException
public static void writeLines(java.io.File file, java.util.List<java.lang.String> lines) throws java.io.IOException
java.io.IOException
public static byte[] readBytes(java.io.File file) throws java.io.IOException
java.io.IOException
public static void writeFile(java.io.File file, byte[] buf) throws java.io.IOException
java.io.IOException
public static void writeFile(java.io.File file, java.lang.String buf) throws java.io.IOException
java.io.IOException
public static void download(java.net.URL url, java.io.File file) throws java.io.IOException
java.io.IOException
public static void deleteTree(java.io.File dir)
public static void emptyDirectory(java.io.File dir)
public static void copyToFile(java.io.InputStream in, java.io.File file) throws java.io.IOException
java.io.IOException
public static void append(java.io.File src, java.io.File dst) throws java.io.IOException
java.io.IOException
public static void append(java.io.File src, java.io.File dst, boolean appendNewLine) throws java.io.IOException
java.io.IOException
public static void append(java.io.InputStream in, java.io.File file) throws java.io.IOException
java.io.IOException
public static void append(java.io.InputStream in, java.io.File file, boolean appendNewLine) throws java.io.IOException
java.io.IOException
public static void copy(java.io.File src, java.io.File dst) throws java.io.IOException
src
- the source file or directorydst
- the destination file or directory
java.io.IOException
public static void copy(java.io.File[] src, java.io.File dst) throws java.io.IOException
java.io.IOException
public static void copyFile(java.io.File src, java.io.File dst) throws java.io.IOException
java.io.IOException
public static void copyTree(java.io.File src, java.io.File dst) throws java.io.IOException
The source file is assumed to be a directory.
src
- the source directorydst
- the destination directory
java.io.IOException
public static void copyTree(java.io.File src, java.io.File dst, PathFilter filter) throws java.io.IOException
java.io.IOException
public static java.lang.String getFilePathFromUrl(java.net.URL url)
url
- the Url to be processed.
public static java.io.File getFileFromURL(java.net.URL url)
public static java.lang.String getParentPath(java.lang.String path)
public static java.lang.String getFileName(java.lang.String path)
public static java.lang.String getFileExtension(java.lang.String path)
public static java.lang.String getFileNameNoExt(java.lang.String path)
public static java.lang.String getResourcePathFromContext(java.lang.String resource)
resource
- the resource name to be retrieved.
public static java.io.File getResourceFileFromContext(java.lang.String resource)
public static java.io.File[] findFiles(java.io.File root, java.lang.String pattern, boolean recurse)
public static void collectFiles(java.io.File root, FileNamePattern pattern, java.util.List<java.io.File> result)
public static void collectFiles(java.io.File root, java.util.List<java.io.File> result)
public static void close(java.io.InputStream in)
public static void close(java.io.OutputStream out)
public static java.io.File urlToFile(java.lang.String url) throws java.net.MalformedURLException
java.net.MalformedURLException
public static java.io.File urlToFile(java.net.URL url)
public static java.util.List<java.lang.String> readLines(java.io.InputStream in) throws java.io.IOException
java.io.IOException
|
Nuxeo Enterprise Platform 5.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |