Package com.bc.ceres.metadata
Class DefaultSimpleFileSystem
- java.lang.Object
-
- com.bc.ceres.metadata.DefaultSimpleFileSystem
-
- All Implemented Interfaces:
SimpleFileSystem
public class DefaultSimpleFileSystem extends Object implements SimpleFileSystem
An implementation of theSimpleFileSystem
interface relying onFile
.- Since:
- Ceres 0.13.2
-
-
Constructor Summary
Constructors Constructor Description DefaultSimpleFileSystem()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Reader
createReader(String path)
Returns a reader for the given path.Writer
createWriter(String path)
Returns a writer for the given path.boolean
isFile(String path)
Checks, if the given path is a file or not (then e.g.String[]
list(String path)
Lists all elements inside the given directory path.
-
-
-
Method Detail
-
createReader
public Reader createReader(String path) throws IOException
Description copied from interface:SimpleFileSystem
Returns a reader for the given path.- Specified by:
createReader
in interfaceSimpleFileSystem
- Parameters:
path
- The path in the filesystem- Returns:
- a reader instance
- Throws:
IOException
- If an I/O error occurs
-
createWriter
public Writer createWriter(String path) throws IOException
Description copied from interface:SimpleFileSystem
Returns a writer for the given path.- Specified by:
createWriter
in interfaceSimpleFileSystem
- Parameters:
path
- The path in the filesystem- Returns:
- a writer instance
- Throws:
IOException
- If an I/O error occurs
-
list
public String[] list(String path) throws IOException
Description copied from interface:SimpleFileSystem
Lists all elements inside the given directory path.- Specified by:
list
in interfaceSimpleFileSystem
- Parameters:
path
- The path in the filesystem- Returns:
- An array of strings naming the files and directories in the
directory denoted by this directory path. The array will be
empty if the directory is empty. Returns
null
if this path does not denote a directory. - Throws:
IOException
- If an I/O error occurs
-
isFile
public boolean isFile(String path)
Description copied from interface:SimpleFileSystem
Checks, if the given path is a file or not (then e.g. a directory)- Specified by:
isFile
in interfaceSimpleFileSystem
- Parameters:
path
- to a file or directory- Returns:
- true, if given path is a file on the fs
-
-