U
- The concrete type of this builder.V
- The type of settings object that this builder uses.public abstract class AbstractArchiveBuilder<U extends AbstractArchiveBuilder<U,V>,V extends ArchiveEntrySettings<V>> extends Object implements ArchiveBuilder<U,V>
ArchiveBuilder
interface. It can be
extended by objects that build specific types of archives.ArchiveBuilder
Modifier | Constructor and Description |
---|---|
protected |
AbstractArchiveBuilder(V defaultFileEntrySettings,
V defaultDirectoryEntrySettings)
Create a new archive builder.
|
Modifier and Type | Method and Description |
---|---|
U |
add(org.entityfs.DirectoryView d)
Add a directory entry to the archive's root directory.
|
U |
add(org.entityfs.DirectoryView d,
org.entityfs.el.AbsoluteLocation parentDirLocation)
Add the directory entry to the specified parent directory in the archive.
|
U |
add(org.entityfs.DirectoryView d,
org.entityfs.el.AbsoluteLocation parentDirLocation,
V settings)
Add a directory entry to the specified parent directory in the archive.
|
U |
add(File f)
Add a file or directory entry to the archive's root directory.
|
U |
add(File f,
org.entityfs.el.AbsoluteLocation parentDirLocation)
Add a file or directory entry to the specified parent directory in the
archive.
|
U |
add(File f,
org.entityfs.el.AbsoluteLocation parentDirLocation,
V settings)
Add a file or directory entry to the specified parent directory in the
archive.
|
U |
add(org.entityfs.NamedReadableFile f)
Add a file entry to the archive's root directory.
|
U |
add(org.entityfs.NamedReadableFile f,
org.entityfs.el.AbsoluteLocation parentDirLocation)
Add a file entry to the specified parent directory in the archive.
|
U |
add(org.entityfs.NamedReadableFile f,
org.entityfs.el.AbsoluteLocation parentDirLocation,
V settings)
Add a file entry to the specified parent directory in the archive.
|
protected abstract void |
addDirectoryCallback(org.entityfs.el.AbsoluteLocation location,
Object d,
V effectiveSettings,
Date lastModified)
This callback method is implemented by subclasses to add a directory
entry to the archive.
|
protected abstract void |
addFileCallback(org.entityfs.el.AbsoluteLocation location,
org.entityfs.ReadableFile f,
V effectiveSettings,
Date lastModified)
This callback method is implemented by subclasses to add a file entry to
the archive.
|
U |
addRecursively(org.entityfs.DirectoryView d,
org.entityfs.el.AbsoluteLocation rootDirLocation)
Add the supplied directory recursively to the specified position in the
archive.
|
U |
addRecursively(org.entityfs.DirectoryView d,
org.entityfs.el.AbsoluteLocation rootDirLocation,
org.entityfs.support.filter.Filter<? super org.entityfs.EntityView> filter)
Add the supplied directory recursively to the specified position in the
archive.
|
U |
addRecursively(org.entityfs.DirectoryView d,
org.entityfs.el.AbsoluteLocation rootDirLocation,
org.entityfs.support.filter.Filter<? super org.entityfs.EntityView> filter,
ArchiveEntrySettingsRule<? extends V>... rules)
Add the supplied directory recursively to the specified position in the
archive.
|
U |
addRecursively(File f,
org.entityfs.el.AbsoluteLocation rootDirLocation)
Add the supplied file or directory recursively to the specified position
in the archive.
|
U |
addRecursively(File f,
org.entityfs.el.AbsoluteLocation rootDirLocation,
ArchiveEntrySettingsRule<? extends V>... rules)
Add the supplied file or directory recursively to the specified position
in the archive.
|
U |
addRule(ArchiveEntrySettingsRule<? extends V> rule)
Append an entry settings rule to the end of the rule list.
|
U |
addRules(Collection<? extends ArchiveEntrySettingsRule<? extends V>> rules)
Append a list of entry settings rules to the end of the rule list.
|
protected abstract void |
assertNotClosed()
Subclasses implement this method to throw an
IllegalStateException if it is called after the archive builder
has been closed. |
protected abstract V |
getDefaultDefaultDirectoryEntrySettings()
Subclasses implement this method to return a default settings object for
directory entries if the client does not specify one when creating the
archive builder object.
|
protected abstract V |
getDefaultDefaultFileEntrySettings()
Subclasses implement this method to return a default settings object for
file entries if the client does not specify one when creating the archive
builder object.
|
V |
getDefaultDirectoryEntrySettings()
Get (a copy of) the default settings for the directory entries added to
this archive builder.
|
V |
getDefaultFileEntrySettings()
Get (a copy of) the default settings for the file entries added to this
archive builder.
|
protected V |
getEffectiveSettingsForDirectory(Object entity,
org.entityfs.el.AbsoluteLocation location,
ArchiveEntrySettingsRule<? extends V>[] rules)
Get the effective settings for a directory entry that is about to be
added to the archive.
|
protected V |
getEffectiveSettingsForDirectory(Object entity,
org.entityfs.el.AbsoluteLocation location,
V entrySettings)
Get the effective settings for a directory entry that is about to be
added to the archive.
|
protected V |
getEffectiveSettingsForFile(Object entity,
org.entityfs.el.AbsoluteLocation location,
ArchiveEntrySettingsRule<? extends V>[] rules)
Get the effective settings for a file entry that is about to be added to
the archive.
|
protected V |
getEffectiveSettingsForFile(Object entity,
org.entityfs.el.AbsoluteLocation location,
V entrySettings)
Get the effective settings for a file entry that is about to be added to
the archive.
|
List<ArchiveEntrySettingsRule<? extends V>> |
getRules()
Get a copy of the list of rules that are used to determine the entry
settings for entries added to this archive.
|
protected U |
getThis()
Get this object cast to its actual type.
|
boolean |
removeRule(ArchiveEntrySettingsRule<? extends V> rule)
Remove an entry settings rule from the rule list.
|
U |
setDefaultDirectoryEntrySettings(V s)
Set the default settings for directory entries that are added to the
archive from now on.
|
U |
setDefaultFileEntrySettings(V s)
Set the default settings for file entries that are added to the archive
from now on.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, isClosed
protected abstract void assertNotClosed() throws IllegalStateException
IllegalStateException
if it is called after the archive builder
has been closed.IllegalStateException
- If the archive builder has been closed.protected abstract V getDefaultDefaultFileEntrySettings()
protected abstract V getDefaultDefaultDirectoryEntrySettings()
protected U getThis()
this
.public U setDefaultFileEntrySettings(V s) throws IllegalStateException
ArchiveBuilder
The supplied object is combined with the default default file entry
settings object using the
ArchiveEntrySettings.combineWith(ArchiveEntrySettings)
method.
This means that the client does not have to specify values for the
properties where the default values should be used.
The actual settings that are used for entries that are added to the archive is determined using the algorithm described in the interface documentation above.
setDefaultFileEntrySettings
in interface ArchiveBuilder<U extends AbstractArchiveBuilder<U,V>,V extends ArchiveEntrySettings<V>>
s
- The new default file entry settings.this
IllegalStateException
- If the archive builder is closed.ArchiveBuilder.setDefaultDirectoryEntrySettings(ArchiveEntrySettings)
public V getDefaultFileEntrySettings() throws IllegalStateException
ArchiveBuilder
The actual settings that are used for entries that are added to the archive is determined using the algorithm described in the interface documentation above.
getDefaultFileEntrySettings
in interface ArchiveBuilder<U extends AbstractArchiveBuilder<U,V>,V extends ArchiveEntrySettings<V>>
IllegalStateException
- If the archive builder is closed.ArchiveBuilder.getDefaultDirectoryEntrySettings()
,
ArchiveBuilder.setDefaultFileEntrySettings(ArchiveEntrySettings)
public U setDefaultDirectoryEntrySettings(V s) throws IllegalStateException
ArchiveBuilder
The supplied object is combined with the default default directory entry
settings object using the
ArchiveEntrySettings.combineWith(ArchiveEntrySettings)
method.
This means that the client does not have to specify values for the
properties where the default values should be used.
The actual settings that are used for entries that are added to the archive is determined using the algorithm described in the interface documentation above.
setDefaultDirectoryEntrySettings
in interface ArchiveBuilder<U extends AbstractArchiveBuilder<U,V>,V extends ArchiveEntrySettings<V>>
s
- The new default directory entry settings.this
IllegalStateException
- If the archive builder is closed.ArchiveBuilder.setDefaultFileEntrySettings(ArchiveEntrySettings)
public V getDefaultDirectoryEntrySettings() throws IllegalStateException
ArchiveBuilder
The actual settings that are used for entries that are added to the archive is determined using the algorithm described in the interface documentation above.
getDefaultDirectoryEntrySettings
in interface ArchiveBuilder<U extends AbstractArchiveBuilder<U,V>,V extends ArchiveEntrySettings<V>>
IllegalStateException
- If the archive builder is closed.ArchiveBuilder.getDefaultFileEntrySettings()
,
ArchiveBuilder.setDefaultDirectoryEntrySettings(ArchiveEntrySettings)
public U addRule(ArchiveEntrySettingsRule<? extends V> rule) throws IllegalStateException
ArchiveBuilder
The rule list is used when determining the settings that an entry added to the archive should have. The actual settings that are used for entries that are added to the archive is determined using the algorithm described in the interface documentation above.
addRule
in interface ArchiveBuilder<U extends AbstractArchiveBuilder<U,V>,V extends ArchiveEntrySettings<V>>
rule
- The rule to append to the end of the rule list.this
IllegalStateException
- If the archive builder is closed.ArchiveBuilder.addRules(Collection)
,
ArchiveBuilder.removeRule(ArchiveEntrySettingsRule)
,
ArchiveBuilder.getRules()
public U addRules(Collection<? extends ArchiveEntrySettingsRule<? extends V>> rules) throws IllegalStateException
ArchiveBuilder
The rules will be used for entries added to the archive after this method has been called.
The rule list is used when determining the settings that an entry added to the archive should have. The actual settings that are used for entries that are added to the archive is determined using the algorithm described in the interface documentation above.
addRules
in interface ArchiveBuilder<U extends AbstractArchiveBuilder<U,V>,V extends ArchiveEntrySettings<V>>
rules
- The rules to append to the end of the rule list.this
IllegalStateException
- If the archive builder is closed.ArchiveBuilder.addRule(ArchiveEntrySettingsRule)
,
ArchiveBuilder.removeRule(ArchiveEntrySettingsRule)
,
ArchiveBuilder.getRules()
public boolean removeRule(ArchiveEntrySettingsRule<? extends V> rule) throws IllegalStateException
ArchiveBuilder
The rule list is used when determining the settings that an entry added to the archive should have. The actual settings that are used for entries that are added to the archive is determined using the algorithm described in the interface documentation above.
removeRule
in interface ArchiveBuilder<U extends AbstractArchiveBuilder<U,V>,V extends ArchiveEntrySettings<V>>
rule
- The rule to remove from the list.true
if a rule was removed from the list, false
if not. If no rule was removed from the list, that means that the
supplied rule was not present in the list to begin with.IllegalStateException
- If the archive builder is closed.ArchiveBuilder.addRule(ArchiveEntrySettingsRule)
,
ArchiveBuilder.getRules()
public List<ArchiveEntrySettingsRule<? extends V>> getRules() throws IllegalStateException
ArchiveBuilder
The actual settings that are used for entries that are added to the archive is determined using the algorithm described in the interface documentation above.
getRules
in interface ArchiveBuilder<U extends AbstractArchiveBuilder<U,V>,V extends ArchiveEntrySettings<V>>
IllegalStateException
- If the archive builder is closed.ArchiveBuilder.addRule(ArchiveEntrySettingsRule)
,
ArchiveBuilder.removeRule(ArchiveEntrySettingsRule)
protected V getEffectiveSettingsForFile(Object entity, org.entityfs.el.AbsoluteLocation location, V entrySettings)
The effective settings are created by combining first the default file
entry settings with all global rules that apply to the file entry, and
then by combining the resulting settings with the supplied settings
object (if the supplied object is not null
).
entity
- The file entity to add to the archive. This may be a
ReadableFile
or an InputStream
.location
- The absolute location where the entry should be put in
the archive.entrySettings
- The settings that the default settings and settings
from global rules should be combined with. This may be null
.protected V getEffectiveSettingsForFile(Object entity, org.entityfs.el.AbsoluteLocation location, ArchiveEntrySettingsRule<? extends V>[] rules)
The effective settings are created by combining first the default file entry settings with all global rules that apply to the file entry, and then by combining the resulting settings with the settings objects for all of the supplied rules that apply to the file entry.
entity
- The file entity to add to the archive. This may be a
ReadableFile
or an InputStream
.location
- The absolute location where the entry should be put in
the archive.rules
- The rules to evaluate for the file entry. This may be
null
.protected V getEffectiveSettingsForDirectory(Object entity, org.entityfs.el.AbsoluteLocation location, V entrySettings)
The effective settings are created by combining first the default
directory entry settings with all global rules that apply to the
directory entry, and then by combining the resulting settings with the
supplied settings object (if the supplied object is not null
).
entity
- The directory entity to add to the archive. This may be a
DirectoryView
or a File
.location
- The absolute location where the entry should be put in
the archive.entrySettings
- The settings that the default settings and settings
from global rules should be combined with. This may be null
.protected V getEffectiveSettingsForDirectory(Object entity, org.entityfs.el.AbsoluteLocation location, ArchiveEntrySettingsRule<? extends V>[] rules)
The effective settings are created by combining first the default directory entry settings with all global rules that apply to the directory entry, and then by combining the resulting settings with the settings objects for all of the supplied rules that apply to the directory entry.
entity
- The directory entity to add to the archive. This may be a
DirectoryView
or a File
.location
- The absolute location where the entry should be put in
the archive.rules
- The rules to evaluate for the directory entry. This may be
null
.protected abstract void addDirectoryCallback(org.entityfs.el.AbsoluteLocation location, Object d, 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.d
- The directory. This may be a DirectoryView
or a File
.effectiveSettings
- The effective settings for the entry.lastModified
- The time when the directory 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.protected abstract void addFileCallback(org.entityfs.el.AbsoluteLocation location, org.entityfs.ReadableFile f, 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.f
- The file.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(org.entityfs.NamedReadableFile f) throws IllegalStateException, org.entityfs.support.exception.WrappedIOException
ArchiveBuilder
If the file is in a locking FileSystem
, it is
temporarily locked for reading by this method.
The name of the added file entry will be the name of the added file. If
you want another name, use a
NamedReadableFileAdapter
.
add
in interface ArchiveBuilder<U extends AbstractArchiveBuilder<U,V>,V extends ArchiveEntrySettings<V>>
f
- The file to add to the archive.this
IllegalStateException
- If the archive builder is closed.org.entityfs.support.exception.WrappedIOException
- On I/O errors.public U add(org.entityfs.NamedReadableFile f, org.entityfs.el.AbsoluteLocation parentDirLocation) throws IllegalStateException, org.entityfs.support.exception.WrappedIOException
ArchiveBuilder
If the file is in a locking FileSystem
, it is
temporarily locked for reading by this method.
The name of the added file entry will be the name of the added file. If
you want another name, use a
NamedReadableFileAdapter
.
add
in interface ArchiveBuilder<U extends AbstractArchiveBuilder<U,V>,V extends ArchiveEntrySettings<V>>
f
- The file to add to the archive.parentDirLocation
- The location of the parent directory. It is
not required that this directory is present in the archive.this
IllegalStateException
- If the archive builder is closed.org.entityfs.support.exception.WrappedIOException
- On I/O errors.public U add(org.entityfs.NamedReadableFile f, org.entityfs.el.AbsoluteLocation parentDirLocation, V settings) throws IllegalStateException, org.entityfs.support.exception.WrappedIOException
ArchiveBuilder
If the file is in a locking FileSystem
, it is
temporarily locked for reading by this method.
The name of the added file entry will be the name of the added file. If
you want another name, use a
NamedReadableFileAdapter
.
add
in interface ArchiveBuilder<U extends AbstractArchiveBuilder<U,V>,V extends ArchiveEntrySettings<V>>
f
- The file to add to the archive.parentDirLocation
- The location of the parent directory. It is
not required that this directory is present in the archive.settings
- The custom settings to use for this file. 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 file
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(org.entityfs.DirectoryView d) throws IllegalStateException, org.entityfs.support.exception.WrappedIOException
ArchiveBuilder
If the directory is in a locking FileSystem
, it is
temporarily locked for reading by this method.
The name of the directory entry will be the name of the added directory.
add
in interface ArchiveBuilder<U extends AbstractArchiveBuilder<U,V>,V extends ArchiveEntrySettings<V>>
d
- The directory to add to the archive.this
IllegalStateException
- If the archive builder is closed.org.entityfs.support.exception.WrappedIOException
- On I/O errors.public U add(org.entityfs.DirectoryView d, org.entityfs.el.AbsoluteLocation parentDirLocation) throws IllegalStateException, org.entityfs.support.exception.WrappedIOException
ArchiveBuilder
If the directory is in a locking FileSystem
, it is
temporarily locked for reading by this method.
The name of the directory entry will be the name of the added directory.
add
in interface ArchiveBuilder<U extends AbstractArchiveBuilder<U,V>,V extends ArchiveEntrySettings<V>>
d
- The directory to add to the archive.parentDirLocation
- The location of the parent directory. It is
not required that this directory is present in the archive.this
IllegalStateException
- If the archive builder is closed.org.entityfs.support.exception.WrappedIOException
- On I/O errors.public U add(org.entityfs.DirectoryView d, org.entityfs.el.AbsoluteLocation parentDirLocation, V settings) throws IllegalStateException, org.entityfs.support.exception.WrappedIOException
ArchiveBuilder
If the directory is in a locking FileSystem
, it is
temporarily locked for reading by this method.
The name of the directory entry will be the name of the added directory.
add
in interface ArchiveBuilder<U extends AbstractArchiveBuilder<U,V>,V extends ArchiveEntrySettings<V>>
d
- The directory to add to the archive.parentDirLocation
- The location of the parent directory. It is
not required that this directory is present in the archive.settings
- The custom settings to use for this directory. 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
directory settings combined with settings from the global rules that
apply to this directory are used.this
IllegalStateException
- If the archive builder is closed.org.entityfs.support.exception.WrappedIOException
- On I/O errors.public U add(File f) throws IllegalStateException, org.entityfs.support.exception.WrappedIOException, org.entityfs.exception.EntityNotFoundException
ArchiveBuilder
The name of the file entry will be the name of the added file. If you
want another name for the entry, wrap the file in a
FileReadableFile
and then in a
NamedReadableFileAdapter
.
add
in interface ArchiveBuilder<U extends AbstractArchiveBuilder<U,V>,V extends ArchiveEntrySettings<V>>
f
- The file or directory to add to the archive.this
IllegalStateException
- If the archive builder is closed.org.entityfs.support.exception.WrappedIOException
- On I/O errors.org.entityfs.exception.EntityNotFoundException
- If the File
object does not
reference an existing file or directory.public U add(File f, org.entityfs.el.AbsoluteLocation parentDirLocation) throws IllegalStateException, org.entityfs.support.exception.WrappedIOException, org.entityfs.exception.EntityNotFoundException
ArchiveBuilder
The name of the file entry will be the name of the added file. If you
want another name for the entry, wrap the file in a
FileReadableFile
and then in a
NamedReadableFileAdapter
.
add
in interface ArchiveBuilder<U extends AbstractArchiveBuilder<U,V>,V extends ArchiveEntrySettings<V>>
f
- The file or directory to add to the archive.parentDirLocation
- The location of the parent directory. It is
not required that this directory is present in the archive.this
IllegalStateException
- If the archive builder is closed.org.entityfs.support.exception.WrappedIOException
- On I/O errors.org.entityfs.exception.EntityNotFoundException
- If the File
object does not
reference an existing file or directory.public U add(File f, org.entityfs.el.AbsoluteLocation parentDirLocation, V settings) throws IllegalStateException, org.entityfs.support.exception.WrappedIOException, org.entityfs.exception.EntityNotFoundException
ArchiveBuilder
The name of the file entry will be the name of the added file. If you
want another name for the entry, wrap the file in a
FileReadableFile
and then in a
NamedReadableFileAdapter
.
add
in interface ArchiveBuilder<U extends AbstractArchiveBuilder<U,V>,V extends ArchiveEntrySettings<V>>
f
- The file or directory to add to the archive.parentDirLocation
- The location of the parent directory. It is
not required that this directory is present 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
entry are used.this
IllegalStateException
- If the archive builder is closed.org.entityfs.support.exception.WrappedIOException
- On I/O errors.org.entityfs.exception.EntityNotFoundException
- If the File
object does not
reference an existing file or directory.public U addRecursively(org.entityfs.DirectoryView d, org.entityfs.el.AbsoluteLocation rootDirLocation) throws IllegalStateException, org.entityfs.support.exception.WrappedIOException
ArchiveBuilder
If the added directory is in a locking FileSystem
,
all added entities are temporarily locked by this method as they are
being added to the archive.
If an error occurs when adding an entry, the recursive add operation terminates and the rest of the entries that were to be added are ignored. The archive file will then contain all entries that had been added before the error occurred.
addRecursively
in interface ArchiveBuilder<U extends AbstractArchiveBuilder<U,V>,V extends ArchiveEntrySettings<V>>
d
- The directory to add recursively to the archive.rootDirLocation
- The location where to put the root of the added
directory tree. If this is the root directory (/
), the contents
of d
are added directly to the archive's root directory.this
.IllegalStateException
- If the archive builder is closed.org.entityfs.support.exception.WrappedIOException
- On I/O errors.public U addRecursively(org.entityfs.DirectoryView d, org.entityfs.el.AbsoluteLocation rootDirLocation, org.entityfs.support.filter.Filter<? super org.entityfs.EntityView> filter) throws IllegalStateException, org.entityfs.support.exception.WrappedIOException
ArchiveBuilder
If the added directory is in a locking FileSystem
,
all added entities are temporarily locked by this method as they are
being added to the archive.
If an error occurs when adding an entry, the recursive add operation terminates and the rest of the entries that were to be added are ignored. The archive file will then contain all entries that had been added before the error occurred.
addRecursively
in interface ArchiveBuilder<U extends AbstractArchiveBuilder<U,V>,V extends ArchiveEntrySettings<V>>
d
- The directory to add recursively to the archive.rootDirLocation
- The location where to put the root of the added
directory tree. If this is the root directory (/
), the contents
of d
are added directly to the archive's root directory.filter
- The filter that is used to decide if an entity is to be
added to the archive or not. This filter does not affect how the
method traverses the directory tree in any way.this
.IllegalStateException
- If the archive builder is closed.org.entityfs.support.exception.WrappedIOException
- On I/O errors.public U addRecursively(File f, org.entityfs.el.AbsoluteLocation rootDirLocation) throws IllegalStateException, org.entityfs.support.exception.WrappedIOException, org.entityfs.exception.EntityNotFoundException
ArchiveBuilder
If an error occurs when adding an entry, the recursive add operation terminates and the rest of the entries that were to be added are ignored. The archive file will then contain all entries that had been added before the error occurred.
addRecursively
in interface ArchiveBuilder<U extends AbstractArchiveBuilder<U,V>,V extends ArchiveEntrySettings<V>>
f
- The file or directory to add recursively to the archive.rootDirLocation
- The location where to put the root of the added
directory tree. If this is the root directory (/
), the contents
of f
(if it is a directory) are added directly to the archive's
root directory.this
.IllegalStateException
- If the archive builder is closed.org.entityfs.support.exception.WrappedIOException
- On I/O errors.org.entityfs.exception.EntityNotFoundException
- If the File
object does not
reference an existing file or directory.public U addRecursively(org.entityfs.DirectoryView d, org.entityfs.el.AbsoluteLocation rootDirLocation, org.entityfs.support.filter.Filter<? super org.entityfs.EntityView> filter, ArchiveEntrySettingsRule<? extends V>... rules) throws IllegalStateException, org.entityfs.support.exception.WrappedIOException
ArchiveBuilder
If the added directory is in a locking FileSystem
,
all added entities are temporarily locked by this method as they are
being added to the archive.
If an error occurs when adding an entry, the recursive add operation terminates and the rest of the entries that were to be added are ignored. The archive file will then contain all entries that had been added before the error occurred.
addRecursively
in interface ArchiveBuilder<U extends AbstractArchiveBuilder<U,V>,V extends ArchiveEntrySettings<V>>
d
- The directory to add recursively to the archive.rootDirLocation
- The location where to put the root of the added
directory tree. If this is the root directory (/
), the contents
of d
are added directly to the archive's root directory.filter
- The filter that is used to decide if an entity is to be
added to the archive or not. This filter does not affect how the
method traverses the directory tree in any way.rules
- Settings rules for this add operation.this
.IllegalStateException
- If the archive builder is closed.org.entityfs.support.exception.WrappedIOException
- On I/O errors.public U addRecursively(File f, org.entityfs.el.AbsoluteLocation rootDirLocation, ArchiveEntrySettingsRule<? extends V>... rules) throws IllegalStateException, org.entityfs.support.exception.WrappedIOException, org.entityfs.exception.EntityNotFoundException
ArchiveBuilder
If an error occurs when adding an entry, the recursive add operation terminates and the rest of the entries that were to be added are ignored. The archive file will then contain all entries that had been added before the error occurred.
addRecursively
in interface ArchiveBuilder<U extends AbstractArchiveBuilder<U,V>,V extends ArchiveEntrySettings<V>>
f
- The file or directory to add recursively to the archive.rootDirLocation
- The location where to put the root of the added
directory tree. If this is the root directory (/
), the contents
of f
(if it is a directory) are added directly to the archive's
root directory.rules
- Settings rules for this add operation.this
.IllegalStateException
- If the archive builder is closed.org.entityfs.support.exception.WrappedIOException
- On I/O errors.org.entityfs.exception.EntityNotFoundException
- If the File
object does not
reference an existing file or directory.