java.lang.Object
org.hsqldb.lib.tar.TarGenerator
Generates a tar archive from specified Files and InputStreams.
Modified by fredt for hot backup
- Since:
- 2.0.0
- Author:
- Blaine Simpson (blaine dot simpson at admc dot com)
-
Constructor Summary
ConstructorsConstructorDescriptionTarGenerator
(File inFile, boolean overWrite, Integer blocksPerRecord) Compression is determined directly by the suffix of the file name in the specified path. -
Method Summary
Modifier and TypeMethodDescriptionlong
void
queueEntry
(File file) void
queueEntry
(String entryPath, File file) void
queueEntry
(String entryPath, InputStream inStream, int maxBytes) This method does not support Pax Interchange Format, nor data sizes greater than 2G.void
queueEntry
(String entryPath, InputStreamInterface is) 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.void
write()
This method does release all of the streams, even if there is a failure.
-
Constructor Details
-
TarGenerator
Compression 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:
IOException
- on access failure
-
-
Method Details
-
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.
- Parameters:
paxThreshold
- long
-
getPaxThreshold
public long getPaxThreshold()- Returns:
- long
- See Also:
-
queueEntry
-
queueEntry
public void queueEntry(String entryPath, File file) throws FileNotFoundException, TarMalformatException -
queueEntry
public void queueEntry(String entryPath, InputStreamInterface is) throws FileNotFoundException, TarMalformatException -
queueEntry
public void queueEntry(String entryPath, InputStream inStream, int maxBytes) throws IOException, TarMalformatException This method does not support Pax Interchange Format, nor data sizes greater than 2G.This limitation may or may not be eliminated in the future.
- Parameters:
entryPath
- StringinStream
- InputStreammaxBytes
- int- Throws:
IOException
- on access failureTarMalformatException
- if malformed
-
write
This method does release all of the streams, even if there is a failure.- Throws:
IOException
- on access failureTarMalformatException
- if malformed
-