public class FileDataSource extends java.lang.Object implements DataSource
Constructor and Description |
---|
FileDataSource(java.nio.file.Path directory,
java.lang.String baseName) |
FileDataSource(java.nio.file.Path directory,
java.lang.String baseName,
DataSourceObserver observer) |
Modifier and Type | Method and Description |
---|---|
boolean |
exists(java.lang.String fileName) |
boolean |
exists(java.lang.String suffix,
java.lang.String ext) |
java.lang.String |
getBaseName() |
protected java.io.InputStream |
getCompressedInputStream(java.io.InputStream is) |
protected java.io.OutputStream |
getCompressedOutputStream(java.io.OutputStream os) |
protected java.lang.String |
getCompressionExt() |
java.util.Set<java.lang.String> |
listNames(java.lang.String regex) |
java.io.InputStream |
newInputStream(java.lang.String fileName) |
java.io.InputStream |
newInputStream(java.lang.String suffix,
java.lang.String ext) |
java.io.OutputStream |
newOutputStream(java.lang.String fileName,
boolean append) |
java.io.OutputStream |
newOutputStream(java.lang.String suffix,
java.lang.String ext,
boolean append) |
public FileDataSource(java.nio.file.Path directory, java.lang.String baseName)
public FileDataSource(java.nio.file.Path directory, java.lang.String baseName, DataSourceObserver observer)
public java.lang.String getBaseName()
getBaseName
in interface ReadOnlyDataSource
protected java.lang.String getCompressionExt()
protected java.io.InputStream getCompressedInputStream(java.io.InputStream is) throws java.io.IOException
java.io.IOException
protected java.io.OutputStream getCompressedOutputStream(java.io.OutputStream os) throws java.io.IOException
java.io.IOException
public java.io.OutputStream newOutputStream(java.lang.String suffix, java.lang.String ext, boolean append) throws java.io.IOException
newOutputStream
in interface DataSource
java.io.IOException
public java.io.OutputStream newOutputStream(java.lang.String fileName, boolean append) throws java.io.IOException
newOutputStream
in interface DataSource
java.io.IOException
public boolean exists(java.lang.String suffix, java.lang.String ext) throws java.io.IOException
exists
in interface ReadOnlyDataSource
java.io.IOException
public boolean exists(java.lang.String fileName) throws java.io.IOException
exists
in interface ReadOnlyDataSource
java.io.IOException
public java.io.InputStream newInputStream(java.lang.String suffix, java.lang.String ext) throws java.io.IOException
newInputStream
in interface ReadOnlyDataSource
java.io.IOException
public java.io.InputStream newInputStream(java.lang.String fileName) throws java.io.IOException
newInputStream
in interface ReadOnlyDataSource
java.io.IOException
public java.util.Set<java.lang.String> listNames(java.lang.String regex) throws java.io.IOException
listNames
in interface ReadOnlyDataSource
java.io.IOException