Class HttpAlfrescoContentReader

All Implemented Interfaces:
ContentAccessor, ContentReader

public class HttpAlfrescoContentReader extends AbstractContentReader
The reader that does the actual communication with the Alfresco HTTP application.
Since:
2.1
Author:
Derek Hulley
See Also:
  • Constructor Details

  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class AbstractContentAccessor
    • exists

      public boolean exists()
    • getLastModified

      public long getLastModified()
    • getSize

      public long getSize()
    • 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 a reader onto the location referenced by this instance. The instance must always be a new instance.
      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
    • generateURL

      public static final String generateURL(String baseHttpUrl, String contentUrl, String ticket, boolean infoOnly)
      Helper to generate a URL based on the ContentStore URL and ticket.
      Parameters:
      baseHttpUrl - the first part of the URL pointing to the Alfresoc Web Application
      contentUrl - the content URL - never null
      ticket - the authentication ticket
      infoOnly - true to add the info-only flag
      Returns:
      Returns the URL with which to access the servlet