org.hsqldb.lib.tar
Class TarGenerator
- java.lang.Object
-
- org.hsqldb.lib.tar.TarGenerator
-
public class TarGenerator extends java.lang.ObjectGenerates a tar archive from specified Files and InputStreams. Modified by fredt for hot backup- Since:
- 2.0.0
-
-
Constructor Summary
Constructors Constructor and Description TarGenerator(java.io.File inFile, boolean overWrite, java.lang.Integer blocksPerRecord)Compression is determined directly by the suffix of the file name in the specified path.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description longgetPaxThreshold()static voidmain(java.lang.String[] sa)Creates specified tar file to contain specified files, or stdin, using default blocks-per-record and replacing tar file if it already exists.voidqueueEntry(java.io.File file)voidqueueEntry(java.lang.String entryPath, java.io.File file)voidqueueEntry(java.lang.String entryPath, java.io.InputStream inStream, int maxBytes)This method does not support Pax Interchange Format, nor data sizes greater than 2G.voidqueueEntry(java.lang.String entryPath, InputStreamInterface is)voidsetPaxThreshold(long paxThreshold)When data file is this size or greater, in bytes, a Pix Interchange Format 'x' record will be created and used for the file entry.voidwrite()This method does release all of the streams, even if there is a failure.
-
-
-
Constructor Detail
-
TarGenerator
public TarGenerator(java.io.File inFile, boolean overWrite, java.lang.Integer blocksPerRecord) throws java.io.IOExceptionCompression is determined directly by the suffix of the file name in the specified path.- Parameters:
inFile- Absolute or relative (from user.dir) File for tar file to be created. getName() Suffix must indicate tar file and may indicate a compression method.overWrite- True to replace an existing file of same path.blocksPerRecord- Null will use default tar value.- Throws:
java.io.IOException
-
-
Method Detail
-
main
public static void main(java.lang.String[] sa) throws java.io.IOException, TarMalformatExceptionCreates specified tar file to contain specified files, or stdin, using default blocks-per-record and replacing tar file if it already exists.- Throws:
java.io.IOExceptionTarMalformatException
-
setPaxThreshold
public void setPaxThreshold(long paxThreshold)
When data file is this size or greater, in bytes, a Pix Interchange Format 'x' record will be created and used for the file entry.Limitation At this time, PAX is only implemented for entries added as Files, not entries added as Stream.
-
getPaxThreshold
public long getPaxThreshold()
- See Also:
setPaxThreshold(long)
-
queueEntry
public void queueEntry(java.io.File file) throws java.io.FileNotFoundException, TarMalformatException- Throws:
java.io.FileNotFoundExceptionTarMalformatException
-
queueEntry
public void queueEntry(java.lang.String entryPath, java.io.File file) throws java.io.FileNotFoundException, TarMalformatException- Throws:
java.io.FileNotFoundExceptionTarMalformatException
-
queueEntry
public void queueEntry(java.lang.String entryPath, InputStreamInterface is) throws java.io.FileNotFoundException, TarMalformatException- Throws:
java.io.FileNotFoundExceptionTarMalformatException
-
queueEntry
public void queueEntry(java.lang.String entryPath, java.io.InputStream inStream, int maxBytes) throws java.io.IOException, TarMalformatExceptionThis method does not support Pax Interchange Format, nor data sizes greater than 2G.This limitation may or may not be eliminated in the future.
- Throws:
java.io.IOExceptionTarMalformatException
-
write
public void write() throws java.io.IOException, TarMalformatExceptionThis method does release all of the streams, even if there is a failure.- Throws:
java.io.IOExceptionTarMalformatException
-
-
DataMelt 3.0 © DataMelt by jWork.ORG