public abstract class FileBasedStorage extends ModelStorage
Modifier and Type | Class and Description |
---|---|
protected static class |
FileBasedStorage.VersionInfo |
ModelStorage.Types
Modifier and Type | Field and Description |
---|---|
protected Config |
config |
protected URL |
httpAccessPath |
Constructor and Description |
---|
FileBasedStorage() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the connector and cleans things up
|
protected 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.
|
storeModelChangeSet
protected abstract void initConnection() throws StorageException
StorageException
protected abstract void closeConnection()
protected abstract void makeDirs(String path) throws StorageException
StorageException
protected abstract void storeFile(InputStream source, String path) throws StorageException
StorageException
protected abstract void storeFile(InputStream source, String path, boolean override) throws StorageException
StorageException
protected abstract InputStream getFile(String path) throws StorageException
StorageException
protected abstract void linkFiles(String sourcePath, String targetPath) throws StorageException
StorageException
public void connect() throws StorageException
ModelStorage
connect
in class ModelStorage
StorageException
- the storage exceptionpublic void close()
ModelStorage
close
in interface Closeable
close
in interface AutoCloseable
close
in class ModelStorage
public URI storeModel(Change modelChange) throws StorageException
ModelStorage
storeModel
in class ModelStorage
modelChange
- the model changeStorageException
- the storage exceptionpublic URI linkModelVersion(String fileId, String sourceVersionId, String targetVersionId) throws StorageException
ModelStorage
linkModelVersion
in class ModelStorage
fileId
- the file idsourceVersionId
- the source version idtargetVersionId
- the target version idStorageException
- the storage exceptionpublic URL getHttpAccessPath()
public void setHttpAccessPath(URL httpAccessPath)
Copyright © 2019 SEMS (Simulation Experiment Management for Systems Biology). All rights reserved.