Class BaseStorageFilesystem
- java.lang.Object
-
- uk.ac.warwick.dcs.sherlock.engine.storage.BaseStorageFilesystem
-
public class BaseStorageFilesystem extends java.lang.Object
Handles file system access stuff, encryption etc
-
-
Constructor Summary
Constructors Constructor Description BaseStorageFilesystem()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.InputStream
loadFile(EntityFile file)
Loads a file from the filesystemjava.lang.String
loadFileAsString(EntityFile file)
Loads a file from the filesystemboolean
storeFile(EntityFile file, byte[] fileContent)
Stores a file on the filesystemboolean
storeTaskRawResults(EntityTask task)
Stores a tasks raw results on the filesystemjava.util.List<java.lang.Object>
validateFileStore(java.util.List<EntityFile> allFiles, java.util.List<EntityTask> allTasks)
Checks the filestore, ensures files are accounted for and that no extra files are present
-
-
-
Method Detail
-
loadFile
public java.io.InputStream loadFile(EntityFile file)
Loads a file from the filesystem- Parameters:
file
- the file to load- Returns:
- inputstream of the file content
-
loadFileAsString
public java.lang.String loadFileAsString(EntityFile file)
Loads a file from the filesystem- Parameters:
file
- the file to load- Returns:
- string of the file content
-
storeFile
public boolean storeFile(EntityFile file, byte[] fileContent)
Stores a file on the filesystem- Parameters:
file
- the file to storefileContent
- content of the file- Returns:
- successful
-
storeTaskRawResults
public boolean storeTaskRawResults(EntityTask task)
Stores a tasks raw results on the filesystem- Parameters:
task
- task to store- Returns:
- successful
-
validateFileStore
public java.util.List<java.lang.Object> validateFileStore(java.util.List<EntityFile> allFiles, java.util.List<EntityTask> allTasks)
Checks the filestore, ensures files are accounted for and that no extra files are present- Parameters:
allFiles
- Current files in databaseallTasks
- Current tasks in database- Returns:
- Objects to be removed from the database (files and tasks)
-
-