|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.izforge.izpack.installer.unpacker.FileUnpacker
public abstract class FileUnpacker
Unpacks a file from a pack.
This manages queueing files that are blocked.
| Constructor Summary | |
|---|---|
FileUnpacker(Cancellable cancellable,
FileQueue queue)
Constructs a FileUnpacker. |
|
| Method Summary | |
|---|---|
protected long |
copy(PackFile file,
byte[] buffer,
InputStream in,
OutputStream out,
long bytesCopied)
Copies from the input stream to the output stream. |
protected long |
copy(PackFile file,
InputStream in,
File target)
Copies an input stream to a target, setting its timestamp to that of the pack file. |
protected OutputStream |
getTarget(PackFile file,
File target)
Returns a stream to the target file. |
boolean |
isQueued()
Determines if the file was queued. |
protected void |
postCopy(PackFile file)
Invoked after copying is complete to set the last modified timestamp, and queue blockable files. |
protected int |
read(byte[] buffer,
InputStream in,
int maxBytes)
Reads up to maxBytes bytes to the specified buffer. |
protected void |
setLastModified(PackFile file)
Sets the last-modified timestamp of a file from the pack-file meta-data. |
abstract void |
unpack(PackFile file,
InputStream packInputStream,
File target)
Unpacks a pack file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileUnpacker(Cancellable cancellable,
FileQueue queue)
cancellable - determines if unpacking should be cancelledqueue - the file queue. May be null| Method Detail |
|---|
public abstract void unpack(PackFile file,
InputStream packInputStream,
File target)
throws IOException,
InstallerException
file - the pack file meta-datapackInputStream - the pack input streamtarget - the target
IOException - for any I/O error
InstallerException - for any installer exceptionpublic boolean isQueued()
protected long copy(PackFile file,
InputStream in,
File target)
throws IOException
file - the pack filein - the pack file streamtarget - the file to write to
InterruptedIOException - if the copy operation is cancelled
IOException - for any I/O errorprotected void postCopy(PackFile file)
file - the pack file meta-data
protected long copy(PackFile file,
byte[] buffer,
InputStream in,
OutputStream out,
long bytesCopied)
throws IOException
file - the pack filebuffer - the buffer to usein - the stream to read fromout - the stream to write tobytesCopied - the current no. of bytes copied
IOException - for any I/O error
protected int read(byte[] buffer,
InputStream in,
int maxBytes)
throws IOException
buffer - the bufferin - the input streammaxBytes - the maximum no. of bytes to read
IOException - for any I/O error
protected OutputStream getTarget(PackFile file,
File target)
throws IOException
file - the pack file meta-datatarget - the requested target
IOException - an I/O error occurredprotected void setLastModified(PackFile file)
file - the pack file meta-data
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||