Modifier and Type | Method and Description |
---|---|
static void |
append(File src,
File dst)
Deprecated.
since 9.1 Use
IOUtils.copy(InputStream, OutputStream) instead. See
append(InputStream, File, boolean) for more information. |
static void |
append(File src,
File dst,
boolean appendNewLine)
Deprecated.
since 9.1 Use
IOUtils.copy(InputStream, OutputStream) instead. See
append(InputStream, File, boolean) for more information. |
static void |
append(InputStream in,
File file)
Deprecated.
since 9.1 Use
IOUtils.copy(InputStream, OutputStream) instead. See
append(InputStream, File, boolean) for more information. |
static void |
append(InputStream in,
File file,
boolean appendNewLine)
Deprecated.
since 9.1 Use
IOUtils.copy(InputStream, OutputStream) instead. |
static boolean |
areFilesContentEquals(String expected,
String source)
Compares two files content as String even if their EOL are different
|
static void |
close(InputStream in)
Deprecated.
since 9.1 Use
IOUtils.closeQuietly(InputStream) instead or AutoCloseable feature. |
static void |
close(OutputStream out)
Deprecated.
since 9.1 Use
IOUtils.closeQuietly(InputStream) instead or AutoCloseable feature. |
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)
Deprecated.
since 9.1 use
IOUtils.copy(InputStream, OutputStream) instead. |
static void |
copyFile(File src,
File dst) |
static void |
copyToFile(InputStream in,
File file)
Deprecated.
since 9.1 Use
FileUtils.copyInputStreamToFile(InputStream, File)
instead. Note: that proposed method close the stream, could lead to issues with some
input stream (like ZipInputStream which uses a global cursor on zip file stream when
iterating on files in it). |
static void |
copyTree(File src,
File dst)
Copies recursively source to destination.
|
static void |
copyTree(File src,
File dst,
PathFilter filter) |
static void |
copyTree(File src,
File dst,
Path prefix,
PathFilter filter) |
protected static void |
copyTree(int rootIndex,
File src,
File dst,
Path prefix,
PathFilter filter) |
static void |
download(URL url,
File file)
Deprecated.
since 9.1 Use
FileUtils.copyURLToFile(URL, File) instead. |
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 |
getSafeFilename(String filename)
Returns a safe filename, replacing unsafe characters (: \ / * ..) with "_".
|
static byte[] |
readBytes(File file)
Deprecated.
since 9.1 Use
FileUtils.readFileToByteArray(File) instead. |
static byte[] |
readBytes(InputStream in)
Deprecated.
since 9.1 use
IOUtils.toByteArray(InputStream) instead. |
static byte[] |
readBytes(URL url)
Deprecated.
since 9.1 use
IOUtils.toByteArray(URL) instead. |
static String |
readFile(File file)
Deprecated.
since 9.1 Use
FileUtils.readLines(File) instead. |
static List<String> |
readLines(File file)
Deprecated.
since 9.1 Use
FileUtils.readLines(File) instead. |
static List<String> |
readLines(InputStream in)
Deprecated.
since 9.1 Use
IOUtils.readLines(InputStream) instead. |
static void |
safeClose(Closeable stream)
Deprecated.
since 9.1 seems unused
|
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)
Deprecated.
since 9.1 Use
FileUtils.writeByteArrayToFile(File, byte[]) instead. |
static void |
writeFile(File file,
byte[] buf,
boolean append)
Deprecated.
since 9.1 Use
FileUtils.writeByteArrayToFile(File, byte[], boolean)
instead. |
static void |
writeFile(File file,
String buf)
Deprecated.
since 9.1 Use
FileUtils.writeStringToFile(File, String) instead. |
static void |
writeFile(File file,
String buf,
boolean append)
Deprecated.
since 9.1 Use
FileUtils.writeStringToFile(File, String, boolean)
instead. |
static void |
writeLines(File file,
List<String> lines)
Deprecated.
since 9.1 Use
FileUtils.writeLines(File, Collection) instead. |
@Deprecated public static void safeClose(Closeable stream)
@Deprecated public static void copy(InputStream in, OutputStream out) throws IOException
IOUtils.copy(InputStream, OutputStream)
instead.IOException
@Deprecated public static byte[] readBytes(URL url) throws IOException
IOUtils.toByteArray(URL)
instead.IOException
@Deprecated public static byte[] readBytes(InputStream in) throws IOException
IOUtils.toByteArray(InputStream)
instead.IOException
@Deprecated public static String readFile(File file) throws IOException
FileUtils.readLines(File)
instead.IOException
@Deprecated public static List<String> readLines(File file) throws IOException
FileUtils.readLines(File)
instead.IOException
@Deprecated public static void writeLines(File file, List<String> lines) throws IOException
FileUtils.writeLines(File, Collection)
instead.IOException
@Deprecated public static byte[] readBytes(File file) throws IOException
FileUtils.readFileToByteArray(File)
instead.IOException
@Deprecated public static void writeFile(File file, byte[] buf) throws IOException
FileUtils.writeByteArrayToFile(File, byte[])
instead.IOException
@Deprecated public static void writeFile(File file, byte[] buf, boolean append) throws IOException
FileUtils.writeByteArrayToFile(File, byte[], boolean)
instead.IOException
@Deprecated public static void writeFile(File file, String buf) throws IOException
FileUtils.writeStringToFile(File, String)
instead.IOException
@Deprecated public static void writeFile(File file, String buf, boolean append) throws IOException
FileUtils.writeStringToFile(File, String, boolean)
instead.IOException
@Deprecated public static void download(URL url, File file) throws IOException
FileUtils.copyURLToFile(URL, File)
instead.IOException
@Deprecated public static void copyToFile(InputStream in, File file) throws IOException
FileUtils.copyInputStreamToFile(InputStream, File)
instead. Note: that proposed method close the stream, could lead to issues with some
input stream (like ZipInputStream
which uses a global cursor on zip file stream when
iterating on files in it).IOException
@Deprecated public static void append(File src, File dst) throws IOException
IOUtils.copy(InputStream, OutputStream)
instead. See
append(InputStream, File, boolean)
for more information.IOException
@Deprecated public static void append(File src, File dst, boolean appendNewLine) throws IOException
IOUtils.copy(InputStream, OutputStream)
instead. See
append(InputStream, File, boolean)
for more information.IOException
@Deprecated public static void append(InputStream in, File file) throws IOException
IOUtils.copy(InputStream, OutputStream)
instead. See
append(InputStream, File, boolean)
for more information.IOException
@Deprecated public static void append(InputStream in, File file, boolean appendNewLine) throws IOException
IOUtils.copy(InputStream, OutputStream)
instead.IOException
public static void copy(File src, File dst) throws IOException
src
- the source file or directorydst
- the destination file or directoryIOException
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 directoryIOException
public static void copyTree(File src, File dst, PathFilter filter) throws IOException
IOException
public static void copyTree(File src, File dst, Path prefix, PathFilter filter) throws IOException
IOException
protected static void copyTree(int rootIndex, File src, File dst, Path prefix, 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 void collectFiles(File root, FileNamePattern pattern, List<File> result)
public static void collectFiles(File root, List<File> result)
@Deprecated public static void close(InputStream in)
IOUtils.closeQuietly(InputStream)
instead or AutoCloseable
feature.@Deprecated public static void close(OutputStream out)
IOUtils.closeQuietly(InputStream)
instead or AutoCloseable
feature.public static File urlToFile(String url) throws MalformedURLException
MalformedURLException
@Deprecated public static List<String> readLines(InputStream in) throws IOException
IOUtils.readLines(InputStream)
instead.IOException
public static boolean areFilesContentEquals(String expected, String source)
expected
- a file content with Windows or Unix like EOLsource
- another file content with Windows or Unix like EOLpublic static String getSafeFilename(String filename)
filename
- the filenameCopyright © 2018 Nuxeo. All rights reserved.