Class StreamServiceImpl

java.lang.Object
org.newsclub.net.unix.demo.rmi.fd.StreamServiceImpl
All Implemented Interfaces:
Closeable, AutoCloseable, Remote, StreamService

public class StreamServiceImpl extends Object implements StreamService, Closeable
An implementation of StreamService.
Author:
Christian Kohlschütter
  • Constructor Summary

    Constructors
    Constructor
    Description
    StreamServiceImpl(org.newsclub.net.unix.rmi.AFUNIXRMISocketFactory socketFactory)
    Creates a new instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    protected boolean
    mayRead(File path)
    Checks if the given path may be accessed for reading.
    protected boolean
    mayWrite(File path)
    Checks if the given path may be accessed for writing.
    org.newsclub.net.unix.rmi.RemoteCloseableImpl<org.newsclub.net.unix.rmi.RemoteFileInput>
    Opens the given file for reading.
    org.newsclub.net.unix.rmi.RemoteCloseableImpl<org.newsclub.net.unix.rmi.RemoteFileOutput>
    Opens the given file for writing.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • StreamServiceImpl

      public StreamServiceImpl(org.newsclub.net.unix.rmi.AFUNIXRMISocketFactory socketFactory) throws RemoteException
      Creates a new instance.
      Parameters:
      socketFactory - The socket factory to use.
      Throws:
      RemoteException - on error.
  • Method Details

    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      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 interface StreamService
      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 interface StreamService
      Parameters:
      path - The file to open.
      Returns:
      A remote instance for the file.
      Throws:
      IOException - on error.
    • mayRead

      protected boolean mayRead(File path)
      Checks if the given path may be accessed for reading.
      Parameters:
      path - The path to check.
      Returns:
      true if permitted.
    • mayWrite

      protected boolean mayWrite(File path)
      Checks if the given path may be accessed for writing.
      Parameters:
      path - The path to check.
      Returns:
      true if permitted.