Class S3BucketLinkBuilderProd

java.lang.Object
com.example.blogs.app.storage.S3BucketLinkBuilderProd
All Implemented Interfaces:
FileLinkBuilder

@Service @Profile("prod") public class S3BucketLinkBuilderProd extends Object implements FileLinkBuilder
Production implementation of FileLinkBuilder for constructing S3 file access URLs. Active only in the production profile.
  • Constructor Details

    • S3BucketLinkBuilderProd

      public S3BucketLinkBuilderProd(@Value("${aws.s3.base-url}") String s3BaseUrl)
      Constructs S3 link builder with resolved base URL and bucket configuration.
      Parameters:
      s3BaseUrl - the S3 base URL from configuration
  • Method Details

    • buildLink

      public String buildLink(String filePath, String uuid, String fileExtension)
      Builds a complete S3 URL for accessing a file. Combines base URL, bucket name, file path, UUID, and extension.
      Specified by:
      buildLink in interface FileLinkBuilder
      Parameters:
      filePath - the storage path of the file
      uuid - the unique identifier of the file
      fileExtension - the file extension including the dot (e.g., ".png")
      Returns:
      the complete S3 file access URL