Class EmptyContentReader

All Implemented Interfaces:
ContentAccessor, ContentReader

public class EmptyContentReader extends AbstractContentReader
A blank reader for which exists() always returns false.
Author:
Derek Hulley
  • Constructor Details

    • EmptyContentReader

      public EmptyContentReader(String contentUrl)
      Parameters:
      contentUrl - the content URL
  • Method Details

    • createReader

      protected ContentReader createReader() throws ContentIOException
      Description copied from class: AbstractContentReader
      A factory method for subclasses to implement that will ensure the proper implementation of the ContentReader.getReader() method.

      Only the instance need be constructed. The required mimetype, encoding, etc will be copied across by this class.

      Specified by:
      createReader in class AbstractContentReader
      Returns:
      Returns an instance of the this class
      Throws:
      ContentIOException
    • getDirectReadableChannel

      protected ReadableByteChannel getDirectReadableChannel() throws ContentIOException
      Description copied from class: AbstractContentReader
      Provides low-level access to read content from the repository.

      This is the only of the content reading methods that needs to be implemented by derived classes. All other content access methods make use of this in their underlying implementations.

      Specified by:
      getDirectReadableChannel in class AbstractContentReader
      Returns:
      Returns a channel from which content can be read
      Throws:
      ContentIOException - if the channel could not be opened or the underlying content has disappeared
    • exists

      public boolean exists()
    • getLastModified

      public long getLastModified()
    • getSize

      public long getSize()