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
(org.newsclub.net.unix.rmi.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.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:
close
in interfaceAutoCloseable
- Specified by:
close
in 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: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
public org.newsclub.net.unix.rmi.RemoteCloseableImpl<org.newsclub.net.unix.rmi.RemoteFileOutput> openForWriting(File path) throws IOException 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.
-