|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.fuin.kickstart4j.Utils
public final class Utils
Utilities for the package.
| Method Summary | |
|---|---|
static void |
copyURLToFile(org.fuin.utils4swing.progress.FileCopyProgressListener listener,
java.net.URL srcFileUrl,
java.io.File destFile,
int fileNo,
int fileSize)
Copies a file from an URL to a local destination. |
static void |
copyURLToFile(java.lang.String url,
java.io.File file)
Copies bytes from the URL source to a file destination. |
static void |
main(java.lang.String[] args)
Main method to test the monitor. |
static void |
unzip(org.fuin.utils4swing.progress.FileCopyProgressListener listener,
java.io.File zipFile,
int zipFileNo,
java.io.File destDir,
org.fuin.utils4j.Cancelable cancelable)
Unzips a file into a local directory. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void copyURLToFile(org.fuin.utils4swing.progress.FileCopyProgressListener listener,
java.net.URL srcFileUrl,
java.io.File destFile,
int fileNo,
int fileSize)
throws java.io.FileNotFoundException
IOExceptions are mapped into a RuntimeException
.
listener - Monitor to use - Can be null if no progress
information is needed.srcFileUrl - Source file URL.destFile - Destination file.fileNo - Number of the current file.fileSize - File size.
java.io.FileNotFoundException - The srcFileUrl was not found.
public static void unzip(org.fuin.utils4swing.progress.FileCopyProgressListener listener,
java.io.File zipFile,
int zipFileNo,
java.io.File destDir,
org.fuin.utils4j.Cancelable cancelable)
IOExceptions are mapped into
a RuntimeException .
listener - Listener to inform - Can be null if no progress
information is needed.zipFile - Source ZIP file - Cannot be null and must be a
valid ZIP file.zipFileNo - Number of the zip file.destDir - Destination directory - Cannot be null and must
exist.cancelable - Signals if the unzip should be canceled - Can be
null if no cancel option is required.
public static void copyURLToFile(java.lang.String url,
java.io.File file)
IOExceptions are wrapped into RuntimeException.
url - The URL to copy bytes from, must not be null. A
possible MalformedURLException when converting
this argument into an URL is wrapped into a
RuntimeException.file - The non-directory File to write bytes to (possibly
overwriting), must not be null.public static void main(java.lang.String[] args)
args - Not used.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||