Class AbstractContentAccessor

java.lang.Object
org.alfresco.repo.content.AbstractContentAccessor
All Implemented Interfaces:
ContentAccessor
Direct Known Subclasses:
AbstractContentReader, AbstractContentWriter

public abstract class AbstractContentAccessor extends Object implements ContentAccessor
Provides basic support for content accessors.
Author:
Derek Hulley
  • Constructor Details

    • AbstractContentAccessor

      protected AbstractContentAccessor(String contentUrl)
      Parameters:
      contentUrl - the content URL
  • Method Details

    • finalize

      protected void finalize() throws Throwable
      Overrides:
      finalize in class Object
      Throws:
      Throwable
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getContentData

      public ContentData getContentData()
      Specified by:
      getContentData in interface ContentAccessor
    • channelOpened

      protected final void channelOpened()
      Derived classes can call this method to ensure that necessary trace logging is performed when the IO Channel is opened.
    • getContentUrl

      public String getContentUrl()
      Specified by:
      getContentUrl in interface ContentAccessor
    • setContentUrl

      protected void setContentUrl(String contentUrl)
      Allow derived implementations to set the Content URL. This allows for implementations where the URL is not known when the accessor is first constructed.
      Parameters:
      contentUrl - the new content URL
    • getMimetype

      public String getMimetype()
      Specified by:
      getMimetype in interface ContentAccessor
    • setMimetype

      public void setMimetype(String mimetype)
      Specified by:
      setMimetype in interface ContentAccessor
      Parameters:
      mimetype - the underlying content's mimetype - null if unknown
    • getEncoding

      public String getEncoding()
      Specified by:
      getEncoding in interface ContentAccessor
      Returns:
      Returns the content encoding - null if unknown
    • setEncoding

      public void setEncoding(String encoding)
      Specified by:
      setEncoding in interface ContentAccessor
      Parameters:
      encoding - the underlying content's encoding - null if unknown
    • getLocale

      public Locale getLocale()
      Specified by:
      getLocale in interface ContentAccessor
      Returns:
      Returns the content locale or null if unkown
    • setLocale

      public void setLocale(Locale locale)
      Specified by:
      setLocale in interface ContentAccessor
      Parameters:
      locale - the content's locale, if known.
    • getCallbackFileChannel

      protected FileChannel getCallbackFileChannel(FileChannel directChannel, List<ContentStreamListener> listeners) throws ContentIOException
      Generate a callback instance of the FileChannel.
      Parameters:
      directChannel - the delegate that to perform the actual operations
      listeners - the listeners to call
      Returns:
      Returns a new channel that functions just like the original, except that it issues callbacks to the listeners
      Throws:
      ContentIOException