|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.at4j.archive.builder.AbstractArchiveBuilder<U,V>
org.at4j.archive.builder.AbstractStreamAddCapableArchiveBuilder<U,V>
U
- The concrete type of this builder.V
- The type of settings object that this builder uses.public abstract class AbstractStreamAddCapableArchiveBuilder<U extends AbstractStreamAddCapableArchiveBuilder<U,V>,V extends ArchiveEntrySettings<V>>
This abstract class extends the AbstractArchiveBuilder
with the
capability to
Constructor Summary | |
---|---|
protected |
AbstractStreamAddCapableArchiveBuilder(V defaultFileEntrySettings,
V defaultDirectoryEntrySettings)
Create a new archive builder. |
Method Summary | |
---|---|
U |
add(InputStream is,
AbsoluteLocation entityLocation)
Add a file entry containing all data that can be read from the supplied stream. |
U |
add(InputStream is,
AbsoluteLocation entityLocation,
V settings)
Add a file entry containing all data that can be read from the supplied stream. |
protected abstract void |
addStreamCallback(AbsoluteLocation location,
InputStream is,
V effectiveSettings,
Date lastModified)
This callback method is implemented by subclasses to add a file entry containing data read from a stream to the archive. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.at4j.archive.builder.ArchiveBuilder |
---|
add, add, add, add, add, add, add, add, add, addRecursively, addRecursively, addRecursively, addRecursively, addRecursively, addRule, addRules, close, getDefaultDirectoryEntrySettings, getDefaultFileEntrySettings, getRules, isClosed, removeRule, setDefaultDirectoryEntrySettings, setDefaultFileEntrySettings |
Constructor Detail |
---|
protected AbstractStreamAddCapableArchiveBuilder(V defaultFileEntrySettings, V defaultDirectoryEntrySettings)
defaultFileEntrySettings
- Default settings for file entries.defaultDirectoryEntrySettings
- Default settings for directory
entries.Method Detail |
---|
protected abstract void addStreamCallback(AbsoluteLocation location, InputStream is, V effectiveSettings, Date lastModified) throws WrappedIOException, ArchiveEntryAddException
Note: If this method throws an exception, it is the method's responsibility to make sure that the archive file is left in a consistent state. This should probably always mean that the failed entry is truncated from the archive file and that the current archive file pointer is restored to where it was before the method was called.
location
- The location of the entry in the archive.is
- The stream to read file data from. The method should read up to
the end of the stream, but not close the stream.effectiveSettings
- The effective settings for the entry.lastModified
- The time when the file was last modified.
WrappedIOException
- On I/O errors.
ArchiveEntryAddException
- If the entry could not be added to the
archive for some other reason than an I/O error.public U add(InputStream is, AbsoluteLocation entityLocation, V settings) throws IllegalStateException, WrappedIOException
StreamAddCapableArchiveBuilder
add
in interface StreamAddCapableArchiveBuilder<U extends AbstractStreamAddCapableArchiveBuilder<U,V>,V extends ArchiveEntrySettings<V>>
is
- The stream to read file data from. The stream is not
closed by this method.entityLocation
- The location of the file entry in the archive.settings
- The custom settings to use for this entry. The custom
settings are combined with the default settings and global rule settings
as described above. If this is set to null
, only the default
settings combined with settings from the global rules that apply to this
file are used.
this
.
IllegalStateException
- If the archive builder is closed.
WrappedIOException
- On I/O errors.public U add(InputStream is, AbsoluteLocation entityLocation) throws IllegalStateException, WrappedIOException
StreamAddCapableArchiveBuilder
add
in interface StreamAddCapableArchiveBuilder<U extends AbstractStreamAddCapableArchiveBuilder<U,V>,V extends ArchiveEntrySettings<V>>
is
- The stream to read file data from. The stream is not
closed by this method.entityLocation
- The location of the file entry in the archive.
this
.
IllegalStateException
- If the archive builder is closed.
WrappedIOException
- On I/O errors.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |