Package org.mycore.datamodel.ifs2
Class MCRFileStore
java.lang.Object
org.mycore.datamodel.ifs2.MCRStore
org.mycore.datamodel.ifs2.MCRFileStore
Stores file collections containing files and directories.
For each store, properties must be defined, for example
MCR.IFS2.Store.ID.Class=org.mycore.datamodel.ifs2.MCRFileStore
MCR.IFS2.Store.ID.BaseDir=/foo/bar MCR.IFS2.Store.ID.SlotLayout=4-2-2
- Author:
- Frank Lützenkirchen
-
Nested Class Summary
Nested classes/interfaces inherited from class org.mycore.datamodel.ifs2.MCRStore
MCRStore.MCRStoreConfig
-
Field Summary
Fields inherited from class org.mycore.datamodel.ifs2.MCRStore
ASCENDING, baseDirectory, DESCENDING, id, idLength, lastID, LOGGER, offset, prefix, slotLength, suffix
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreate()
Creates and stores a new, empty file collection using the next free ID in the store.create
(int id) Creates and stores a new, empty file collection with the given IDvoid
delete
(int id) Deletes the data stored under the given ID from the storevoid
Repairs metadata of all file collections stored hereretrieve
(int id) Returns the file collection stored under the given ID, or null when no collection is stored for the given ID.Methods inherited from class org.mycore.datamodel.ifs2.MCRStore
exists, getBaseDirectory, getHighestStoredID, getID, getNextFreeID, getSlot, getStoreConfig, getStoredIDs, init, init, isEmpty, listIDs, setStoreConfig
-
Constructor Details
-
MCRFileStore
public MCRFileStore()
-
-
Method Details
-
create
Creates and stores a new, empty file collection using the next free ID in the store.- Returns:
- a newly created file collection
- Throws:
IOException
-
create
Creates and stores a new, empty file collection with the given ID- Parameters:
id
- the ID of the file collection- Returns:
- a newly created file collection
- Throws:
IOException
- when a file collection with the given ID already exists
-
delete
Description copied from class:MCRStore
Deletes the data stored under the given ID from the store- Overrides:
delete
in classMCRStore
- Parameters:
id
- the ID of the document to be deleted- Throws:
IOException
-
retrieve
Returns the file collection stored under the given ID, or null when no collection is stored for the given ID.- Parameters:
id
- the file collection's ID- Returns:
- the file collection with the given ID, or null
- Throws:
IOException
-
repairAllMetadata
Repairs metadata of all file collections stored here- Throws:
IOException
-