public class FileBasedDatasetServices extends Object implements DatasetServices
constructor
provided the path is defined in the overloaded constructor using
the setPath(Path)
methodModifier | Constructor and Description |
---|---|
protected |
FileBasedDatasetServices()
Constructor that can be used by sub-classes provided the path is defined
in the overloaded constructor using the
setPath(Path) method |
|
FileBasedDatasetServices(Path path)
Constructor that is a path to defined the location of the datasets
|
Modifier and Type | Method and Description |
---|---|
void |
addDataset(uno.informatics.data.Dataset dataset) |
List<uno.informatics.data.Dataset> |
getAllDatasets() |
org.corehunter.data.CoreHunterData |
getCoreHunterData(String datasetId) |
uno.informatics.data.Dataset |
getDataset(String datasetId) |
uno.informatics.data.SimpleEntity[] |
getHeaders(String datasetId) |
uno.informatics.data.Data |
getOriginalData(String datasetId,
org.corehunter.data.CoreHunterDataType dataType) |
Path |
getPath() |
void |
loadData(uno.informatics.data.Dataset dataset,
Path path,
uno.informatics.data.io.FileType fileType,
org.corehunter.data.CoreHunterDataType dataType,
Object... options) |
protected Object |
readFromFile(Path path)
Reads an object from a file.
|
void |
removeData(String datasetId) |
boolean |
removeDataset(String datasetId) |
void |
setPath(Path path) |
boolean |
updateDataset(uno.informatics.data.Dataset dataset) |
protected void |
writeToFile(Path path,
Object object)
Write an object to a file.
|
protected FileBasedDatasetServices() throws IOException
setPath(Path)
methodIOException
- if the path can not be set or is invalidpublic FileBasedDatasetServices(Path path) throws IOException
path
- the location of the datasetsIOException
- if the path can not be set or is invalidpublic final Path getPath()
public final void setPath(Path path) throws IOException
IOException
public List<uno.informatics.data.Dataset> getAllDatasets()
getAllDatasets
in interface DatasetServices
public uno.informatics.data.Dataset getDataset(String datasetId)
getDataset
in interface DatasetServices
public void addDataset(uno.informatics.data.Dataset dataset) throws uno.informatics.data.dataset.DatasetException
addDataset
in interface DatasetServices
uno.informatics.data.dataset.DatasetException
public boolean removeDataset(String datasetId) throws uno.informatics.data.dataset.DatasetException
removeDataset
in interface DatasetServices
uno.informatics.data.dataset.DatasetException
public boolean updateDataset(uno.informatics.data.Dataset dataset) throws uno.informatics.data.dataset.DatasetException
updateDataset
in interface DatasetServices
uno.informatics.data.dataset.DatasetException
public uno.informatics.data.SimpleEntity[] getHeaders(String datasetId) throws uno.informatics.data.dataset.DatasetException
getHeaders
in interface DatasetServices
uno.informatics.data.dataset.DatasetException
public org.corehunter.data.CoreHunterData getCoreHunterData(String datasetId) throws uno.informatics.data.dataset.DatasetException
getCoreHunterData
in interface DatasetServices
uno.informatics.data.dataset.DatasetException
public void removeData(String datasetId) throws uno.informatics.data.dataset.DatasetException
removeData
in interface DatasetServices
uno.informatics.data.dataset.DatasetException
public void loadData(uno.informatics.data.Dataset dataset, Path path, uno.informatics.data.io.FileType fileType, org.corehunter.data.CoreHunterDataType dataType, Object... options) throws IOException, uno.informatics.data.dataset.DatasetException
loadData
in interface DatasetServices
IOException
uno.informatics.data.dataset.DatasetException
public uno.informatics.data.Data getOriginalData(String datasetId, org.corehunter.data.CoreHunterDataType dataType) throws uno.informatics.data.dataset.DatasetException
getOriginalData
in interface DatasetServices
uno.informatics.data.dataset.DatasetException
protected Object readFromFile(Path path) throws IOException
writeToFile(Path, Object)
methodpath
- the path of the file to be readIOException
- if the object can not be read from the fileprotected void writeToFile(Path path, Object object) throws IOException
readFromFile(Path)
methodpath
- the path of the file to be writtenobject
- the object to be writtenIOException
- if the object can not be write to the fileCopyright © 2017. All rights reserved.