public class FileDataSource extends Object implements DataSource
Constructor and Description |
---|
FileDataSource(Path directory,
String baseName) |
FileDataSource(Path directory,
String baseName,
DataSourceObserver observer) |
Modifier and Type | Method and Description |
---|---|
boolean |
exists(String fileName) |
boolean |
exists(String suffix,
String ext) |
String |
getBaseName() |
protected InputStream |
getCompressedInputStream(InputStream is) |
protected OutputStream |
getCompressedOutputStream(OutputStream os) |
protected String |
getCompressionExt() |
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) |
public FileDataSource(Path directory, String baseName, DataSourceObserver observer)
public String getBaseName()
getBaseName
in interface ReadOnlyDataSource
protected String getCompressionExt()
protected InputStream getCompressedInputStream(InputStream is) throws IOException
IOException
protected OutputStream getCompressedOutputStream(OutputStream os) throws IOException
IOException
public OutputStream newOutputStream(String suffix, String ext, boolean append) throws IOException
newOutputStream
in interface DataSource
IOException
public OutputStream newOutputStream(String fileName, boolean append) throws IOException
newOutputStream
in interface DataSource
IOException
public boolean exists(String suffix, String ext) throws IOException
exists
in interface ReadOnlyDataSource
IOException
public boolean exists(String fileName) throws IOException
exists
in interface ReadOnlyDataSource
IOException
public InputStream newInputStream(String suffix, String ext) throws IOException
newInputStream
in interface ReadOnlyDataSource
IOException
public InputStream newInputStream(String fileName) throws IOException
newInputStream
in interface ReadOnlyDataSource
IOException
public Set<String> listNames(String regex) throws IOException
listNames
in interface ReadOnlyDataSource
IOException
Copyright © 2020. All rights reserved.