Class AbstractContentAccessor

  • All Implemented Interfaces:
    org.alfresco.service.cmr.repository.ContentAccessor
    Direct Known Subclasses:
    AbstractContentReader, AbstractContentWriter

    public abstract class AbstractContentAccessor
    extends Object
    implements org.alfresco.service.cmr.repository.ContentAccessor
    Provides basic support for content accessors.
    Author:
    Derek Hulley
    • Constructor Detail

      • AbstractContentAccessor

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

      • getContentData

        public org.alfresco.service.cmr.repository.ContentData getContentData()
        Specified by:
        getContentData in interface org.alfresco.service.cmr.repository.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 org.alfresco.service.cmr.repository.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 org.alfresco.service.cmr.repository.ContentAccessor
      • setMimetype

        public void setMimetype​(String mimetype)
        Specified by:
        setMimetype in interface org.alfresco.service.cmr.repository.ContentAccessor
        Parameters:
        mimetype - the underlying content's mimetype - null if unknown
      • getEncoding

        public String getEncoding()
        Specified by:
        getEncoding in interface org.alfresco.service.cmr.repository.ContentAccessor
        Returns:
        Returns the content encoding - null if unknown
      • setEncoding

        public void setEncoding​(String encoding)
        Specified by:
        setEncoding in interface org.alfresco.service.cmr.repository.ContentAccessor
        Parameters:
        encoding - the underlying content's encoding - null if unknown
      • getLocale

        public Locale getLocale()
        Specified by:
        getLocale in interface org.alfresco.service.cmr.repository.ContentAccessor
        Returns:
        Returns the content locale or null if unkown
      • setLocale

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

        protected FileChannel getCallbackFileChannel​(FileChannel directChannel,
                                                     List<org.alfresco.service.cmr.repository.ContentStreamListener> listeners)
                                              throws org.alfresco.service.cmr.repository.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:
        org.alfresco.service.cmr.repository.ContentIOException