Class BeCPGZipDownloadExporter

java.lang.Object
fr.becpg.repo.download.BaseExporter
fr.becpg.repo.download.BeCPGZipDownloadExporter
All Implemented Interfaces:
org.alfresco.service.cmr.view.Exporter

public class BeCPGZipDownloadExporter extends BaseExporter
Handler for exporting node content to a ZIP file
Version:
$Id: $Id
Author:
Alex Miller
  • Field Details

    • log

      private static org.slf4j.Logger log
    • PATH_SEPARATOR

      private static final String PATH_SEPARATOR
      See Also:
    • zipStream

      protected org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream zipStream
    • downloadNodeRef

      private org.alfresco.service.cmr.repository.NodeRef downloadNodeRef
    • sequenceNumber

      private int sequenceNumber
    • total

      private long total
    • done

      private long done
    • totalFileCount

      private long totalFileCount
    • filesAddedCount

      private long filesAddedCount
    • transactionHelper

      private org.alfresco.repo.transaction.RetryingTransactionHelper transactionHelper
    • downloadStorage

      private org.alfresco.repo.download.DownloadStorage downloadStorage
    • dictionaryService

      private org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService
    • updateService

      private org.alfresco.repo.download.DownloadStatusUpdateService updateService
    • entityService

      private EntityService entityService
    • permissionService

      private org.alfresco.service.cmr.security.PermissionService permissionService
    • path

      private Deque<org.alfresco.util.Pair<String,org.alfresco.service.cmr.repository.NodeRef>> path
    • currentName

      private String currentName
    • outputStream

      private OutputStream outputStream
    • skippedNodeRefs

      private Set<org.alfresco.service.cmr.repository.NodeRef> skippedNodeRefs
  • Constructor Details

    • BeCPGZipDownloadExporter

      public BeCPGZipDownloadExporter(org.alfresco.service.cmr.security.PermissionService permissionService, EntityService entityService, File zipFile, org.alfresco.service.cmr.coci.CheckOutCheckInService checkOutCheckInService, org.alfresco.service.cmr.repository.NodeService nodeService, org.alfresco.repo.transaction.RetryingTransactionHelper transactionHelper, org.alfresco.repo.download.DownloadStatusUpdateService updateService, org.alfresco.repo.download.DownloadStorage downloadStorage, org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService, org.alfresco.service.cmr.repository.NodeRef downloadNodeRef, long total, long totalFileCount)
      Construct
      Parameters:
      zipFile - File
      checkOutCheckInService - CheckOutCheckInService
      nodeService - NodeService
      transactionHelper - RetryingTransactionHelper
      updateService - DownloadStatusUpdateService
      downloadStorage - DownloadStorage
      dictionaryService - DictionaryService
      downloadNodeRef - NodeRef
      total - long
      totalFileCount - long
      permissionService - a PermissionService object
      entityService - a EntityService object
  • Method Details

    • start

      public void start(org.alfresco.service.cmr.view.ExporterContext context)
      Specified by:
      start in interface org.alfresco.service.cmr.view.Exporter
      Overrides:
      start in class BaseExporter
    • startNode

      public void startNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)
      Specified by:
      startNode in interface org.alfresco.service.cmr.view.Exporter
      Overrides:
      startNode in class BaseExporter
    • hasReadPermissionOnReference

      private boolean hasReadPermissionOnReference(org.alfresco.service.cmr.repository.NodeRef nodeRef)
    • findMatchingSubPath

      private org.alfresco.service.cmr.repository.NodeRef findMatchingSubPath(org.alfresco.service.cmr.repository.NodeRef searchParentRef, org.alfresco.service.cmr.repository.NodeRef originalRef, org.alfresco.service.cmr.repository.NodeRef originalParentRef)
    • findMatchingChild

      private org.alfresco.service.cmr.repository.NodeRef findMatchingChild(org.alfresco.service.cmr.repository.NodeRef parentRef, org.alfresco.service.cmr.repository.Path subPathToMatch)
    • isVersionNodeRef

      private boolean isVersionNodeRef(org.alfresco.service.cmr.repository.NodeRef nodeRef)
    • convertVersionNodeRefToVersionedNodeRef

      protected org.alfresco.service.cmr.repository.NodeRef convertVersionNodeRefToVersionedNodeRef(org.alfresco.service.cmr.repository.NodeRef versionNodeRef)

      convertVersionNodeRefToVersionedNodeRef.

      Parameters:
      versionNodeRef - a NodeRef object
      Returns:
      a NodeRef object
    • contentImpl

      public void contentImpl(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName property, InputStream content, org.alfresco.service.cmr.repository.ContentData contentData, int index)
      Template method for actually dealing with the content. Called by the content method, after filtering for working copies.
      Specified by:
      contentImpl in class BaseExporter
      Parameters:
      nodeRef - a NodeRef object
      property - a QName object
      content - a InputStream object
      contentData - a ContentData object
      index - a int
    • endNode

      public void endNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)
      Specified by:
      endNode in interface org.alfresco.service.cmr.view.Exporter
      Overrides:
      endNode in class BaseExporter
    • end

      public void end()
      Specified by:
      end in interface org.alfresco.service.cmr.view.Exporter
      Overrides:
      end in class BaseExporter
    • getPath

      private String getPath()
    • copyStream

      private void copyStream(OutputStream output, InputStream in) throws IOException
      Copy input stream to output stream
      Parameters:
      output - output stream
      in - input stream
      Throws:
      IOException
    • checkCancelled

      private void checkCancelled()
    • updateStatus

      private void updateStatus()
    • getNextSequenceNumber

      public int getNextSequenceNumber()

      getNextSequenceNumber.

      Returns:
      a int
    • getDone

      public long getDone()

      Getter for the field done.

      Returns:
      a long
    • getTotal

      public long getTotal()

      Getter for the field total.

      Returns:
      a long
    • getFilesAdded

      public long getFilesAdded()

      getFilesAdded.

      Returns:
      a long
    • getTotalFiles

      public long getTotalFiles()

      getTotalFiles.

      Returns:
      a long