Package com.powsybl.commons.datasource
Class ZipFileDataSource
- java.lang.Object
-
- com.powsybl.commons.datasource.ZipFileDataSource
-
- All Implemented Interfaces:
DataSource
,ReadOnlyDataSource
public class ZipFileDataSource extends Object implements DataSource
- Author:
- Geoffroy Jamgotchian
-
-
Constructor Summary
Constructors Constructor Description ZipFileDataSource(Path zipFile)
ZipFileDataSource(Path directory, String baseName)
ZipFileDataSource(Path directory, String baseName, DataSourceObserver observer)
ZipFileDataSource(Path directory, String zipFileName, String baseName)
ZipFileDataSource(Path directory, String zipFileName, String baseName, DataSourceObserver observer)
-
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
-
ZipFileDataSource
public ZipFileDataSource(Path directory, String zipFileName, String baseName, DataSourceObserver observer)
-
ZipFileDataSource
public ZipFileDataSource(Path directory, String baseName, DataSourceObserver observer)
-
ZipFileDataSource
public ZipFileDataSource(Path zipFile)
-
-
Method Detail
-
getBaseName
public String getBaseName()
- Specified by:
getBaseName
in interfaceReadOnlyDataSource
-
exists
public boolean exists(String suffix, String ext) throws IOException
- Specified by:
exists
in interfaceReadOnlyDataSource
- Throws:
IOException
-
exists
public boolean exists(String fileName)
- Specified by:
exists
in interfaceReadOnlyDataSource
-
newInputStream
public InputStream newInputStream(String suffix, String ext) throws IOException
- Specified by:
newInputStream
in interfaceReadOnlyDataSource
- Throws:
IOException
-
newInputStream
public InputStream newInputStream(String fileName) throws IOException
- Specified by:
newInputStream
in interfaceReadOnlyDataSource
- Throws:
IOException
-
newOutputStream
public OutputStream newOutputStream(String fileName, boolean append) throws IOException
- Specified by:
newOutputStream
in interfaceDataSource
- Throws:
IOException
-
newOutputStream
public OutputStream newOutputStream(String suffix, String ext, boolean append) throws IOException
- Specified by:
newOutputStream
in interfaceDataSource
- Throws:
IOException
-
listNames
public Set<String> listNames(String regex) throws IOException
- Specified by:
listNames
in interfaceReadOnlyDataSource
- Throws:
IOException
-
-