|
Errai 3.0.1-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.errai.cdi.server.gwt.util.CopyUtil
public class CopyUtil
A utility class for copying files and directories.
Nested Class Summary | |
---|---|
static interface |
CopyUtil.Filter
For excluding files and folders from being copied by recursiveCopy(File, File, Filter) . |
Constructor Summary | |
---|---|
CopyUtil()
|
Method Summary | |
---|---|
static void |
copyFile(File to,
File from)
Copy the contents of a file. |
static void |
copyStream(OutputStream to,
InputStream from)
Copy one stream to another until the input stream has no more data. |
static void |
copyStreamToFile(File to,
InputStream from)
Copy the contents of a stream to the given file. |
static void |
recursiveCopy(File to,
File from,
CopyUtil.Filter filter)
Recursively copy a directory. |
static void |
recursiveDeleteOnExit(File rootDir)
Recursively set this directory to be deleted on termination of the JVM (using File.deleteOnExit() ). |
static void |
unzip(File dir,
ZipInputStream from)
Copy a zip stream to the given directory. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CopyUtil()
Method Detail |
---|
public static void recursiveCopy(File to, File from, CopyUtil.Filter filter) throws IOException
to
- The file or directory to be copied to. Must already exist and be
the same type as from (i.e. file or directory)from
- The file or directory being copied from.filter
- A filter for which files to include or exclude (or null if no all
files are to be copied).
IOException
public static void copyFile(File to, File from) throws IOException
to
- The file to be copied to (must already exist).from
- The file to be copied from.
IOException
public static void copyStreamToFile(File to, InputStream from) throws IOException
to
- A file (which may not yet exist).from
- The stream from which to copy (must be open).
IOException
public static void copyStream(OutputStream to, InputStream from) throws IOException
to
- The open stream to write to.from
- The open stream to read from.
IOException
public static void unzip(File dir, ZipInputStream from) throws IOException
dir
- The target directory.from
- The zip input stream to copy.
IOException
public static void recursiveDeleteOnExit(File rootDir)
File.deleteOnExit()
).
rootDir
- The directory to be deleted on exit.
|
Errai 3.0.1-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |