public class IOUtils extends Object
| Constructor and Description |
|---|
IOUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
close(Closeable c)
Close some xStream for good :)
|
static void |
close(ZipFile file)
A special version of close() for ZipFiles, which don't implement Closeable.
|
static void |
copy(InputStream in,
OutputStream out)
Copy an InputStream to an OutputStream and close the InputStream afterwards.
|
static void |
copyAndDoNotCloseInputStream(InputStream in,
OutputStream out)
Copy an InputStream to an OutputStream and do not close the InputStream afterwards.
|
static boolean |
deleteRecursive(File root)
Do rm -rf
|
static OutputStream |
getOutputStream(File outputDir,
String relativePath) |
static void |
jarUp(File rootDir,
File targetFile,
Manifest manifest)
Jar up all the contents of rootDir (recursively) into targetFile and add the manifest
|
static boolean |
unpackZip(IFile zip,
File outputDir)
Unpack the zip file into the outputDir
|
static void |
writeOut(File outputDir,
String relativePath,
InputStream content)
Write the given InputStream to a file given by a root directory (outputDir) and a relative directory.
|
static void |
writeOutAndDontCloseInputStream(File outputDir,
String relativePath,
InputStream content)
Write the given InputStream to a file given by a root directory (outputDir) and a relative directory.
|
static void |
zipUp(File rootDir,
File targetFile)
Zip up all contents of rootDir (recursively) into targetFile
|
static void |
zipUp(File rootDir,
OutputStream targetStream)
Zip up all contents of rootDir (recursively) into targetStream
|
public static void copy(InputStream in, OutputStream out) throws IOException
IOExceptionpublic static void copyAndDoNotCloseInputStream(InputStream in, OutputStream out) throws IOException
IOExceptionpublic static void close(Closeable c)
public static void close(ZipFile file) throws IOException
file - the file to close. ZipFiles seem prone to file locking problems
on Windows, so to aid diagnostics we throw, not swallow, any exceptions.IOExceptionpublic static OutputStream getOutputStream(File outputDir, String relativePath) throws IOException
IOExceptionpublic static void writeOut(File outputDir, String relativePath, InputStream content) throws IOException
IOExceptionpublic static void writeOutAndDontCloseInputStream(File outputDir, String relativePath, InputStream content) throws IOException
IOExceptionpublic static void zipUp(File rootDir, OutputStream targetStream) throws IOException
IOExceptionpublic static void zipUp(File rootDir, File targetFile) throws IOException
IOExceptionpublic static void jarUp(File rootDir, File targetFile, Manifest manifest) throws IOException
IOExceptionpublic static boolean deleteRecursive(File root)
public static boolean unpackZip(IFile zip, File outputDir) throws IOException
zip - outputDir - IOException - when there are unexpected issues handling the zip files.Copyright © 2010 - 2020 Adobe. All Rights Reserved