Class FileBasedStorage
- java.lang.Object
-
- de.unirostock.sems.ModelCrawler.storage.ModelStorage
-
- de.unirostock.sems.ModelCrawler.storage.FileBasedStorage
-
- All Implemented Interfaces:
Closeable
,Serializable
,AutoCloseable
- Direct Known Subclasses:
FileStorage
,FtpStorage
public abstract class FileBasedStorage extends ModelStorage
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
FileBasedStorage.VersionInfo
-
Nested classes/interfaces inherited from class de.unirostock.sems.ModelCrawler.storage.ModelStorage
ModelStorage.Types
-
-
Field Summary
Fields Modifier and Type Field Description protected Config
config
protected URL
httpAccessPath
-
Constructor Summary
Constructors Constructor Description FileBasedStorage()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
close()
Closes the connector and cleans things upprotected abstract void
closeConnection()
void
connect()
Connects to the storage destination, is supposed to be called before every other operation.protected abstract InputStream
getFile(String path)
URL
getHttpAccessPath()
protected abstract void
initConnection()
protected abstract void
linkFiles(String sourcePath, String targetPath)
URI
linkModelVersion(String fileId, String sourceVersionId, String targetVersionId)
Links the source Version to the target Version (The target Version should exist already).protected abstract void
makeDirs(String path)
void
setHttpAccessPath(URL httpAccessPath)
protected abstract void
storeFile(InputStream source, String path)
protected abstract void
storeFile(InputStream source, String path, boolean override)
URI
storeModel(Change modelChange)
Puts a model into the storage system and returns the URI.-
Methods inherited from class de.unirostock.sems.ModelCrawler.storage.ModelStorage
storeModelChangeSet
-
-
-
-
Method Detail
-
initConnection
protected abstract void initConnection() throws StorageException
- Throws:
StorageException
-
closeConnection
protected abstract void closeConnection()
-
makeDirs
protected abstract void makeDirs(String path) throws StorageException
- Throws:
StorageException
-
storeFile
protected abstract void storeFile(InputStream source, String path) throws StorageException
- Throws:
StorageException
-
storeFile
protected abstract void storeFile(InputStream source, String path, boolean override) throws StorageException
- Throws:
StorageException
-
getFile
protected abstract InputStream getFile(String path) throws StorageException
- Throws:
StorageException
-
linkFiles
protected abstract void linkFiles(String sourcePath, String targetPath) throws StorageException
- Throws:
StorageException
-
connect
public void connect() throws StorageException
Description copied from class:ModelStorage
Connects to the storage destination, is supposed to be called before every other operation.- Specified by:
connect
in classModelStorage
- Throws:
StorageException
- the storage exception
-
close
public void close()
Description copied from class:ModelStorage
Closes the connector and cleans things up- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classModelStorage
-
storeModel
public URI storeModel(Change modelChange) throws StorageException
Description copied from class:ModelStorage
Puts a model into the storage system and returns the URI.- Specified by:
storeModel
in classModelStorage
- Parameters:
modelChange
- the model change- Returns:
- the uri to the model
- Throws:
StorageException
- the storage exception
-
linkModelVersion
public URI linkModelVersion(String fileId, String sourceVersionId, String targetVersionId) throws StorageException
Description copied from class:ModelStorage
Links the source Version to the target Version (The target Version should exist already).- Specified by:
linkModelVersion
in classModelStorage
- Parameters:
fileId
- the file idsourceVersionId
- the source version idtargetVersionId
- the target version id- Returns:
- the uri
- Throws:
StorageException
- the storage exception
-
getHttpAccessPath
public URL getHttpAccessPath()
-
setHttpAccessPath
public void setHttpAccessPath(URL httpAccessPath)
-
-