Class DownloadNodeProcessor

java.lang.Object
org.saidone.processors.AbstractNodeProcessor
org.saidone.processors.DownloadNodeProcessor
All Implemented Interfaces:
NodeProcessor

@Component public class DownloadNodeProcessor extends AbstractNodeProcessor
Downloads content and metadata of a node to the local filesystem.

For each processed node a folder matching its path is created under the configured output directory. The node's binary content is saved using its original name while the metadata is stored in an adjacent *.metadata.properties.xml file.

The output format is compatible with Alfresco bulk import.

  • Constructor Details

    • DownloadNodeProcessor

      public DownloadNodeProcessor()
  • Method Details

    • processNode

      public void processNode(String nodeId, ProcessorConfig config)
      Downloads the content and metadata of the node identified by nodeId.

      The node is fetched from Alfresco with its properties and path information. A folder mirroring the node's repository path is then created under the configured output directory. The node's metadata and binary content are written into this folder.

      Parameters:
      nodeId - id of the node to download
      config - processor configuration containing the output-dir argument
    • alfPropertiesToXmlString

      public static String alfPropertiesToXmlString(Properties properties)
      Serializes Alfresco properties to an XML string using the configured XmlMapper.
      Parameters:
      properties - properties to serialize
      Returns:
      XML representation of the properties
    • writeStringToFile

      public static void writeStringToFile(String path, String content) throws IOException
      Writes a string to the specified file using StandardCharsets.UTF_8.
      Parameters:
      path - output file path
      content - content to write
      Throws:
      IOException - if the file cannot be written