Class S3ConfigFactory
- java.lang.Object
-
- com.atlassian.confluence.impl.pages.attachments.filesystem.S3ConfigFactory
-
public class S3ConfigFactory extends Object
Factory for creatingAttachmentDataFileSysteminstances. If there are S3 properties set, then anObjectStorageAttachmentDataFileSystemwill be returned. Otherwise, it returns an instance ofContentDirectoryStructureAttachmentDataFileSystemAdapter.
-
-
Field Summary
Fields Modifier and Type Field Description static StringS3_BUCKET_NAME_PROPERTY_NAMEProperty storing S3 bucket name.static StringS3_BUCKET_REGION_PROPERTY_NAMEProperty storing S3 bucket region.static StringS3_ENDPOINT_OVERRIDEProperty storing S3 bucket region.
-
Constructor Summary
Constructors Constructor Description S3ConfigFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetConfigProperty(com.atlassian.config.ApplicationConfiguration appConfig, String propertyName)Loads property from different sources in this order (lower, overrides higher) 1.static Optional<com.atlassian.dc.filestore.impl.s3.S3Config>getInstance(com.atlassian.config.ApplicationConfiguration appConfig)Produces instance ofS3Configbased on the defined properties.
-
-
-
Field Detail
-
S3_BUCKET_NAME_PROPERTY_NAME
public static final String S3_BUCKET_NAME_PROPERTY_NAME
Property storing S3 bucket name. The env variable is: CONFLUENCE_FILESTORE_ATTACHMENTS_S3_BUCKET_NAME- See Also:
- Constant Field Values
-
S3_BUCKET_REGION_PROPERTY_NAME
public static final String S3_BUCKET_REGION_PROPERTY_NAME
Property storing S3 bucket region. The env variable is: CONFLUENCE_FILESTORE_ATTACHMENTS_S3_BUCKET_REGION- See Also:
- Constant Field Values
-
S3_ENDPOINT_OVERRIDE
public static final String S3_ENDPOINT_OVERRIDE
Property storing S3 bucket region. The env variable is: CONFLUENCE_FILESTORE_ATTACHMENTS_S3_ENDPOINT_OVERRIDE- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static Optional<com.atlassian.dc.filestore.impl.s3.S3Config> getInstance(com.atlassian.config.ApplicationConfiguration appConfig)
Produces instance ofS3Configbased on the defined properties.- Parameters:
appConfig- application configuration- Returns:
- new instance of S3 Config
-
getConfigProperty
@Nullable public static String getConfigProperty(com.atlassian.config.ApplicationConfiguration appConfig, String propertyName)
Loads property from different sources in this order (lower, overrides higher) 1. application config 2. environmental variable 3. system property- Parameters:
appConfig- application configpropertyName- property name to load- Returns:
- value of the property if defined, null otherwise
-
-