Package com.powsybl.afs.storage
Class AppStorageDataSource
- java.lang.Object
-
- com.powsybl.afs.storage.AppStorageDataSource
-
- All Implemented Interfaces:
com.powsybl.commons.datasource.DataSource
,com.powsybl.commons.datasource.ReadOnlyDataSource
public class AppStorageDataSource extends Object implements com.powsybl.commons.datasource.DataSource
A datasource corresponding to a data blob stored in the file system. A data blob is associated to a node and a name identifying it among data blobs of this node.- Author:
- Geoffroy Jamgotchian
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AppStorageDataSource.FileName
static interface
AppStorageDataSource.Name
static interface
AppStorageDataSource.NameHandler<T>
static class
AppStorageDataSource.SuffixAndExtension
-
Constructor Summary
Constructors Constructor Description AppStorageDataSource(AppStorage storage, String nodeId, String nodeName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
exists(String fileName)
boolean
exists(String suffix, String ext)
String
getBaseName()
Set<String>
listNames(String regex)
InputStream
newInputStream(String fileName)
InputStream
newInputStream(String suffix, String ext)
OutputStream
newOutputStream(String fileName, boolean append)
OutputStream
newOutputStream(String suffix, String ext, boolean append)
-
-
-
Constructor Detail
-
AppStorageDataSource
public AppStorageDataSource(AppStorage storage, String nodeId, String nodeName)
-
-
Method Detail
-
getBaseName
public String getBaseName()
- Specified by:
getBaseName
in interfacecom.powsybl.commons.datasource.ReadOnlyDataSource
-
newOutputStream
public OutputStream newOutputStream(String suffix, String ext, boolean append)
- Specified by:
newOutputStream
in interfacecom.powsybl.commons.datasource.DataSource
-
newOutputStream
public OutputStream newOutputStream(String fileName, boolean append)
- Specified by:
newOutputStream
in interfacecom.powsybl.commons.datasource.DataSource
-
exists
public boolean exists(String suffix, String ext)
- Specified by:
exists
in interfacecom.powsybl.commons.datasource.ReadOnlyDataSource
-
exists
public boolean exists(String fileName)
- Specified by:
exists
in interfacecom.powsybl.commons.datasource.ReadOnlyDataSource
-
newInputStream
public InputStream newInputStream(String suffix, String ext) throws IOException
- Specified by:
newInputStream
in interfacecom.powsybl.commons.datasource.ReadOnlyDataSource
- Throws:
IOException
-
newInputStream
public InputStream newInputStream(String fileName) throws IOException
- Specified by:
newInputStream
in interfacecom.powsybl.commons.datasource.ReadOnlyDataSource
- Throws:
IOException
-
listNames
public Set<String> listNames(String regex) throws IOException
- Specified by:
listNames
in interfacecom.powsybl.commons.datasource.ReadOnlyDataSource
- Throws:
IOException
-
-