Class S3Publisher


  • @Component
    public class S3Publisher
    extends Object
    Publishes a folder on the disk to S3 while keeping the folder and file structure.
    Moreover, does the following:
    • Publishes index files on a different route, removing the trailing "/index" part.
    • Adds meta information to the uploaded files, e.g. the CWA-hash value.
    • Only performs the upload for files, which do not yet exist on the object store, and checks whether the existing files hash differ from the to-be-uploaded files hash. Only if the hash differs, the file will ultimately be uploaded
    • Currently not implemented: Set cache control headers
    • Currently not implemented: Supports multi threaded upload of files.
    • Method Detail

      • publish

        public void publish​(Path root)
                     throws IOException
        Synchronizes the files to S3. Current strategy is to never update diagnosis key archive files already published on S3, even if the retention and shifting policies cause a diff between subsequent distribution runs. Thus, by default distribution will only add new key files, but still modify indexes. This behaviour can however be controlled through the configuration parameter DistributionServiceConfig.forceUpdateKeyFiles
        Parameters:
        root - The path of the directory that shall be published.
        Throws:
        IOException - in case there were problems reading files from the disk.
        See Also:
        issue #650