Package org.fcrepo.migration.foxml
Class DirectoryScanningIDResolver
- java.lang.Object
-
- org.fcrepo.migration.foxml.DirectoryScanningIDResolver
-
- All Implemented Interfaces:
InternalIDResolver
- Direct Known Subclasses:
AkubraFSIDResolver,LegacyFSIDResolver
public abstract class DirectoryScanningIDResolver extends Object implements InternalIDResolver
An InternalIDResolver implementation that generates an index of datastream ids (filenames) to file paths for the contents of a datastream directory. The directory is expected to contain just other directories and/or FOXML files. The FOXML files are expected to have a filename that is reversibly mapped from a fedora internal id for that datastream version.- Author:
- mdurbin
-
-
Constructor Summary
Constructors Constructor Description DirectoryScanningIDResolver(File cachedIndexDir, File dsRoot)directory scanning ID resolver
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclose()Closes any open resources.protected abstract StringgetInternalIdForFile(File f)Determines the internal id for the given file.CachedContentresolveInternalID(String id)Gets the datastream for an internal ID.
-
-
-
Constructor Detail
-
DirectoryScanningIDResolver
public DirectoryScanningIDResolver(File cachedIndexDir, File dsRoot) throws IOException
directory scanning ID resolver- Parameters:
cachedIndexDir- the index directory. If it exists, the old cache will be used, if it doesn't a new cache will be built at that location. If it is null, a new cache will be built in the temp file space that will be deleted upon application shutdown.dsRoot- the datastream root- Throws:
IOException- IO exception creating temp and index files/directories
-
-
Method Detail
-
close
public void close() throws IOException
Description copied from interface:InternalIDResolverCloses any open resources.- Specified by:
closein interfaceInternalIDResolver- Throws:
IOException
-
resolveInternalID
public CachedContent resolveInternalID(String id)
Description copied from interface:InternalIDResolverGets the datastream for an internal ID.- Specified by:
resolveInternalIDin interfaceInternalIDResolver- Parameters:
id- the internal id referenced within a FOXML file.- Returns:
- the binary content for the datastream referenced by the internal id
-
getInternalIdForFile
protected abstract String getInternalIdForFile(File f)
Determines the internal id for the given file.- Parameters:
f- file to check for- Returns:
- string containing internal id for the file
-
-