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 sha256 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.
        Parameters:
        root - The path of the directory that shall be published.
        Throws:
        IOException - in case there were problems reading files from the disk.