java.lang.Object
org.newsclub.net.unix.demo.rmi.fd.StreamServiceImpl
- All Implemented Interfaces:
Closeable,AutoCloseable,Remote,StreamService
An implementation of
StreamService.- Author:
- Christian Kohlschütter
-
Constructor Summary
ConstructorsConstructorDescriptionStreamServiceImpl(AFUNIXRMISocketFactory socketFactory) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected booleanChecks if the given path may be accessed for reading.protected booleanChecks if the given path may be accessed for writing.openForReading(File path) Opens the given file for reading.openForWriting(File path) Opens the given file for writing.
-
Constructor Details
-
StreamServiceImpl
Creates a new instance.- Parameters:
socketFactory- The socket factory to use.
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
openForReading
Description copied from interface:StreamServiceOpens the given file for reading.- Specified by:
openForReadingin interfaceStreamService- Parameters:
path- The file to open.- Returns:
- A remote instance for the file.
- Throws:
IOException- on error.
-
openForWriting
Description copied from interface:StreamServiceOpens the given file for writing.- Specified by:
openForWritingin interfaceStreamService- Parameters:
path- The file to open.- Returns:
- A remote instance for the file.
- Throws:
IOException- on error.
-
mayRead
Checks if the given path may be accessed for reading.- Parameters:
path- The path to check.- Returns:
trueif permitted.
-
mayWrite
Checks if the given path may be accessed for writing.- Parameters:
path- The path to check.- Returns:
trueif permitted.
-