|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.at4j.tar.builder.V7TarEntryStrategy org.at4j.tar.builder.UstarEntryStrategy org.at4j.tar.builder.GnuTarEntryStrategy
public class GnuTarEntryStrategy
This strategy extends the UstarEntryStrategy
with the capability to
use special headers for long Tar entry paths and link targets.
Gnu Tar headers contain the same data as ustar headers. If the Tar entry path for an entry is too long to fit in the ustar header, this strategy adds a special file name header containing the Tar entry path before the regular ustar entry header.
Constructor Summary | |
---|---|
GnuTarEntryStrategy()
Create a new strategy object that will use the platform's default character encoding to encode text values in the Tar entries. |
|
GnuTarEntryStrategy(Charset cs)
Create a new strategy object that will use the supplied charset for encoding test values in the Tar entries. |
Method Summary | |
---|---|
void |
writeDirectory(DataSink out,
DirectoryAdapter<?> da,
AbsoluteLocation location,
TarEntrySettings effectiveSettings,
Date lastModified)
Override the inherited implementation to prepend the Tar entry header with a special file name header if necessary. |
void |
writeFile(DataSink out,
ReadableFile f,
AbsoluteLocation location,
TarEntrySettings effectiveSettings,
Date lastModified)
Override the inherited implementation to prepend the Tar entry header with a special file name header if necessary. |
void |
writeFileFromStream(RandomAccess out,
InputStream is,
AbsoluteLocation location,
TarEntrySettings effectiveSettings,
Date lastModified)
Override the inherited implementation to prepend the Tar entry header with a special file name header if necessary. |
Methods inherited from class org.at4j.tar.builder.UstarEntryStrategy |
---|
getHeader, setFileNameInHeader |
Methods inherited from class org.at4j.tar.builder.V7TarEntryStrategy |
---|
addChecksumToHeader, getFileName, getTextEncodingCharset, goToNextBlockBoundary, writeFileToArchive, zeroPadLeft |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GnuTarEntryStrategy()
GnuTarEntryStrategy(Charset)
public GnuTarEntryStrategy(Charset cs)
cs
- The charset.GnuTarEntryStrategy()
Method Detail |
---|
public void writeFile(DataSink out, ReadableFile f, AbsoluteLocation location, TarEntrySettings effectiveSettings, Date lastModified)
writeFile
in interface TarEntryStrategy
writeFile
in class V7TarEntryStrategy
out
- The DataSink
to write to. This may be a
RandomAccess
object. When this method is called, the DataSink
is positioned at the start of the entry to write. If this
method returns successfully, the DataSink
should be positioned at
the next block boundary after the written entry (the Tar file is divided
into 512-byte blocks).f
- The file to add to the archive. If this file is in a locking
FileSystem
, it is locked for reading by the caller before this
method is called.location
- The absolute location of the entry in the Tar archive.effectiveSettings
- The effective settings for the entry.lastModified
- The time when the file entity was last modified.public void writeFileFromStream(RandomAccess out, InputStream is, AbsoluteLocation location, TarEntrySettings effectiveSettings, Date lastModified)
writeFileFromStream
in interface TarEntryStrategy
writeFileFromStream
in class V7TarEntryStrategy
out
- The RandomAccess
to write to. When this method is
called, the RandomAccess
is positioned at the start of the entry
to write. If this method returns successfully, the RandomAccess
should be positioned at the next block boundary after the written entry
(the Tar file is divided into 512-byte blocks).is
- The stream containing the file's data.location
- The absolute location of the entry in the Tar archive.effectiveSettings
- The effective settings for the entry.lastModified
- The time when the file entity was last modified.public void writeDirectory(DataSink out, DirectoryAdapter<?> da, AbsoluteLocation location, TarEntrySettings effectiveSettings, Date lastModified)
writeDirectory
in interface TarEntryStrategy
writeDirectory
in class V7TarEntryStrategy
out
- The DataSink
to write to. This may be a
RandomAccess
object. When this method is called, the DataSink
is positioned at the start of the entry to write. If this
method returns successfully, the DataSink
should be positioned at
the next block boundary after the written entry (the Tar file is divided
into 512-byte blocks).da
- The directory to add to the Tar file.location
- The absolute location of the entry in the Tar archive.effectiveSettings
- The effective settings for the entry.lastModified
- The time when the directory entity was last modified.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |