Class OpenOfficeContentNetworkFile

  • All Implemented Interfaces:
    NetworkFileLegacyReferenceCount, org.alfresco.jlan.server.filesys.cache.NetworkFileStateInterface

    public class OpenOfficeContentNetworkFile
    extends ContentNetworkFile
    OpenOffice Content Network File Class

    Provides special handling for OpenOffice file saves that open the file, truncate, close, then open the file again to write the data, as this causes multiple versions to be generated when the file is versionable.

    Author:
    gkspencer
    • Constructor Detail

      • OpenOfficeContentNetworkFile

        protected OpenOfficeContentNetworkFile​(NodeService nodeService,
                                               ContentService contentService,
                                               MimetypeService mimetypeService,
                                               NodeRef nodeRef,
                                               String name)
        Class constructor
        Parameters:
        nodeService - NodeService
        contentService - ContentService
        mimetypeService - MimetypeService
        nodeRef - NodeRef
        name - String
    • Method Detail

      • getDelayedCloseCount

        public final int getDelayedCloseCount()
        Return the delayed close count
        Returns:
        int
      • incrementDelayedCloseCount

        public final void incrementDelayedCloseCount()
        Increment the delayed close count
      • truncatedToZeroLength

        public final boolean truncatedToZeroLength()
        Check if the last file operation was a truncate to zero length
        Returns:
        boolean
      • readFile

        public int readFile​(byte[] buffer,
                            int length,
                            int position,
                            long fileOffset)
                     throws IOException
        Read from the file.
        Overrides:
        readFile in class ContentNetworkFile
        Parameters:
        buffer - byte[]
        length - int
        position - int
        fileOffset - long
        Returns:
        Length of data read.
        Throws:
        IOException
      • writeFile

        public void writeFile​(byte[] buffer,
                              int length,
                              int position,
                              long fileOffset)
                       throws IOException
        Write a block of data to the file.
        Overrides:
        writeFile in class ContentNetworkFile
        Parameters:
        buffer - byte[]
        length - int
        position - int
        fileOffset - long
        Throws:
        IOException