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
ConstructorDescriptionStreamServiceImpl
(AFUNIXRMISocketFactory socketFactory) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected boolean
Checks if the given path may be accessed for reading.protected boolean
Checks 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
openForReading
Description copied from interface:StreamService
Opens the given file for reading.- Specified by:
openForReading
in interfaceStreamService
- Parameters:
path
- The file to open.- Returns:
- A remote instance for the file.
- Throws:
IOException
- on error.
-
openForWriting
Description copied from interface:StreamService
Opens the given file for writing.- Specified by:
openForWriting
in 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:
true
if permitted.
-
mayWrite
Checks if the given path may be accessed for writing.- Parameters:
path
- The path to check.- Returns:
true
if permitted.
-