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