public interface FileResource
A file resource is identified by the pair (name,generationId). Name is an arbitrary String supplied by the caller. GenerationId is a non-repeating sequence number constructed by the database. Within a database a (name,generationId) pair uniquely identifies a version of a file resource for all time. Newer generation numbers reflect newer versions of the file.
A database supports the concept of a designated current version of a fileResource. The management of the current version is transactional. The following rules apply
For the benefit of replication, a database optionally retains historic versions of stored files. These old versions are useful when processing old transactions in the stage.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
JAR_DIRECTORY_NAME
The name of the jar directory
|
Modifier and Type | Method and Description |
---|---|
long |
add(java.lang.String name,
java.io.InputStream source)
Add a file resource, copying from the input stream.
|
StorageFile |
getAsFile(java.lang.String name,
long generationId)
Get the StorageFile for a file resource.
|
char |
getSeparatorChar() |
void |
remove(java.lang.String name,
long currentGenerationId)
Remove the current generation of a file resource from
the database.
|
void |
removeJarDir(java.lang.String f)
During hard upgrade to <= 10.9, remove a jar directory (at post-commit
time) from the database.
|
long |
replace(java.lang.String name,
long currentGenerationId,
java.io.InputStream source)
Replace a file resource with a new version.
|
static final java.lang.String JAR_DIRECTORY_NAME
long add(java.lang.String name, java.io.InputStream source) throws StandardException
name
- the name of the file resource.source
- an input stream for reading the content of
the file resource.StandardException
- some error occured.void remove(java.lang.String name, long currentGenerationId) throws StandardException
name
- the name of the fileResource to remove.StandardException
- some error occured.void removeJarDir(java.lang.String f) throws StandardException
f
- StandardException
- if an error occurslong replace(java.lang.String name, long currentGenerationId, java.io.InputStream source) throws StandardException
The InputStream will be closed by this method.
name
- the name of the file resource.source
- an input stream for reading the content of
the file resource.StandardException
- some error occured.StorageFile getAsFile(java.lang.String name, long generationId)
name
- The name of the fileResourcegenerationId
- the generationId of the fileResourcechar getSeparatorChar()
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.