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>> extends AbstractArchiveBuilder<U,V> implements StreamAddCapableArchiveBuilder<U,V>
AbstractArchiveBuilder
with the
capability toModifier | Constructor and Description |
---|---|
protected |
AbstractStreamAddCapableArchiveBuilder(V defaultFileEntrySettings,
V defaultDirectoryEntrySettings)
Create a new archive builder.
|
Modifier and Type | Method and Description |
---|---|
U |
add(InputStream is,
org.entityfs.el.AbsoluteLocation entityLocation)
Add a file entry containing all data that can be read from the supplied
stream.
|
U |
add(InputStream is,
org.entityfs.el.AbsoluteLocation entityLocation,
V settings)
Add a file entry containing all data that can be read from the supplied
stream.
|
protected abstract void |
addStreamCallback(org.entityfs.el.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.
|
add, add, add, add, add, add, add, add, add, addDirectoryCallback, addFileCallback, addRecursively, addRecursively, addRecursively, addRecursively, addRecursively, addRule, addRules, assertNotClosed, getDefaultDefaultDirectoryEntrySettings, getDefaultDefaultFileEntrySettings, getDefaultDirectoryEntrySettings, getDefaultFileEntrySettings, getEffectiveSettingsForDirectory, getEffectiveSettingsForDirectory, getEffectiveSettingsForFile, getEffectiveSettingsForFile, getRules, getThis, removeRule, setDefaultDirectoryEntrySettings, setDefaultFileEntrySettings
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
add, add, add, add, add, add, add, add, add, addRecursively, addRecursively, addRecursively, addRecursively, addRecursively, addRule, addRules, close, getDefaultDirectoryEntrySettings, getDefaultFileEntrySettings, getRules, isClosed, removeRule, setDefaultDirectoryEntrySettings, setDefaultFileEntrySettings
protected AbstractStreamAddCapableArchiveBuilder(V defaultFileEntrySettings, V defaultDirectoryEntrySettings)
defaultFileEntrySettings
- Default settings for file entries.defaultDirectoryEntrySettings
- Default settings for directory
entries.protected abstract void addStreamCallback(org.entityfs.el.AbsoluteLocation location, InputStream is, V effectiveSettings, Date lastModified) throws org.entityfs.support.exception.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.org.entityfs.support.exception.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, org.entityfs.el.AbsoluteLocation entityLocation, V settings) throws IllegalStateException, org.entityfs.support.exception.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.org.entityfs.support.exception.WrappedIOException
- On I/O errors.public U add(InputStream is, org.entityfs.el.AbsoluteLocation entityLocation) throws IllegalStateException, org.entityfs.support.exception.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.org.entityfs.support.exception.WrappedIOException
- On I/O errors.