Package com.example.blogs.app.storage
Class S3BucketLinkBuilderLocal
java.lang.Object
com.example.blogs.app.storage.S3BucketLinkBuilderLocal
- All Implemented Interfaces:
FileLinkBuilder
@Service
@Profile("local")
public class S3BucketLinkBuilderLocal
extends Object
implements FileLinkBuilder
Builds S3 file access links by combining base URL, bucket name, and file metadata.
-
Constructor Summary
ConstructorsConstructorDescriptionS3BucketLinkBuilderLocal(String awsEndpoint, String bucketName) Constructs S3 link builder with resolved base URL and bucket configuration. -
Method Summary
-
Constructor Details
-
S3BucketLinkBuilderLocal
public S3BucketLinkBuilderLocal(@Value("${aws.endpoint}") String awsEndpoint, @Value("${aws.s3.bucket-name}") String bucketName) Constructs S3 link builder with resolved base URL and bucket configuration.- Parameters:
awsEndpoint- optional custom AWS endpointbucketName- the S3 bucket name
-
-
Method Details
-
buildLink
Builds a complete S3 URL for accessing a file. Combines base URL, bucket name, file path, UUID, and extension.- Specified by:
buildLinkin interfaceFileLinkBuilder- Parameters:
filePath- the storage path of the fileuuid- the unique identifier of the filefileExtension- the file extension including the dot (e.g., ".png")- Returns:
- the complete S3 file access URL
-