public final class FileServiceImpl extends Object implements FileService, SimpleRMI.ServerListener
Constructor and Description |
---|
FileServiceImpl(Path basePath) |
Modifier and Type | Method and Description |
---|---|
InputStream |
concat(List<String> relativePaths,
boolean ignoreNonExistant) |
void |
delete(String relativePath)
Deletes the file or directory ( recursively )
|
void |
destroy()
Called upon server shutdown.
|
boolean |
exists(String relativePath)
Returns true if the file exists.
|
FileData |
getFileData(String relativePath) |
long |
getLength(String relativePath) |
PathInfo |
getRoot()
Returns the root directory supported by this file service
|
void |
init(GenericTCPServer.ServerContext context)
Called upon server start to inform the handler of context information
such as the listening address.
|
boolean |
isDirectory(String relativePath)
Returns true if the file exists and is a directory.
|
boolean |
isFile(String relativePath)
Returns true if the file exists and is a file ( not a directory ).
|
List<FileData> |
listPathData(String relativePath)
Lists the files and subdirectories under this directory
|
List<String> |
listPaths(String relativePath)
Lists the files and subdirectories under this directory
|
InputStream |
openInputStream(String relativePath)
Opens the file for reading.
|
OutputStream |
openOutputStream(String relativePath,
WriteMode mode)
Opens the file for writing.
|
public FileServiceImpl(Path basePath)
public boolean isFile(String relativePath)
FileService
isFile
in interface FileService
relativePath
- the file pathpublic boolean exists(String relativePath)
FileService
exists
in interface FileService
relativePath
- the file pathpublic boolean isDirectory(String relativePath)
FileService
isDirectory
in interface FileService
relativePath
- the file pathpublic FileData getFileData(String relativePath)
getFileData
in interface FileService
public InputStream openInputStream(String relativePath)
FileService
openInputStream
in interface FileService
relativePath
- the file pathpublic OutputStream openOutputStream(String relativePath, WriteMode mode)
FileService
openOutputStream
in interface FileService
relativePath
- the file pathmode
- the write modepublic List<String> listPaths(String relativePath)
FileService
listPaths
in interface FileService
relativePath
- the file pathpublic List<FileData> listPathData(String relativePath)
FileService
listPathData
in interface FileService
relativePath
- the file pathpublic void delete(String relativePath)
FileService
delete
in interface FileService
relativePath
- the file pathpublic void init(GenericTCPServer.ServerContext context)
SimpleRMI.ServerListener
init
in interface SimpleRMI.ServerListener
context
- the server contextpublic void destroy()
SimpleRMI.ServerListener
destroy
in interface SimpleRMI.ServerListener
public PathInfo getRoot()
FileService
getRoot
in interface FileService
public long getLength(String relativePath)
getLength
in interface FileService
public InputStream concat(List<String> relativePaths, boolean ignoreNonExistant)
concat
in interface FileService
Copyright © 2015 Actian Corporation. All Rights Reserved.