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 a single node.
      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 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 UTF-8 encoding.
      Parameters:
      path - output file path
      content - content to write
      Throws:
      IOException - if the file cannot be written