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(org.newsclub.net.unix.rmi.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.org.newsclub.net.unix.rmi.RemoteCloseableImpl<org.newsclub.net.unix.rmi.RemoteFileInput> openForReading(File path) Opens the given file for reading.org.newsclub.net.unix.rmi.RemoteCloseableImpl<org.newsclub.net.unix.rmi.RemoteFileOutput> openForWriting(File path) Opens the given file for writing.
-
Constructor Details
-
StreamServiceImpl
public StreamServiceImpl(org.newsclub.net.unix.rmi.AFUNIXRMISocketFactory socketFactory) 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
public org.newsclub.net.unix.rmi.RemoteCloseableImpl<org.newsclub.net.unix.rmi.RemoteFileInput> openForReading(File path) throws IOException 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
public org.newsclub.net.unix.rmi.RemoteCloseableImpl<org.newsclub.net.unix.rmi.RemoteFileOutput> openForWriting(File path) throws IOException 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.
-