java.lang.Object
com.atlassian.confluence.impl.pages.attachments.objectstorage.S3ConfigFactory

public class S3ConfigFactory extends Object
Factory for creating AttachmentDataFileSystem instances. If there are S3 properties set, then an ObjectStorageAttachmentDataFileSystem will be returned. Otherwise, it returns an instance of ContentDirectoryStructureAttachmentDataFileSystemAdapter.
  • Field Details

    • S3_BUCKET_NAME_PROPERTY_NAME

      public static final String S3_BUCKET_NAME_PROPERTY_NAME
      Property storing S3 bucket name.
      See Also:
    • S3_BUCKET_REGION_PROPERTY_NAME

      public static final String S3_BUCKET_REGION_PROPERTY_NAME
      Property storing S3 bucket region.
      See Also:
    • S3_ENDPOINT_OVERRIDE

      public static final String S3_ENDPOINT_OVERRIDE
      Property storing S3 service endpoint override.
      See Also:
    • S3_MAX_CONNECTIONS

      public static final String S3_MAX_CONNECTIONS
      Property for setting the maximum number of connections allowed in the connection pool used by S3 Apache HTTP Client. See for more info Integer value as a string
      See Also:
    • S3_CONNECTION_ACQUISITION_TIMEOUT_MILLIS

      public static final String S3_CONNECTION_ACQUISITION_TIMEOUT_MILLIS
      Property for setting the amount of time to wait when acquiring a connection from the pool used by S3 Apache HTTP client before giving up and timing out. See for more info Millisecond value as a string
      See Also:
  • Method Details

    • getInstance

      public static Optional<com.atlassian.dc.filestore.impl.s3.S3Config> getInstance(com.atlassian.config.ApplicationConfiguration appConfig, ClusterConfigurationHelperInternal clusterConfigurationHelper, LicenseService licenseService)
      Produces instance of S3Config based on the defined properties.
      Parameters:
      appConfig - Application Configuration
      Returns:
      new instance of S3Config or empty Optional if S3 properties have not been configured
    • getConfigProperty

      public static @Nullable String getConfigProperty(com.atlassian.config.ApplicationConfiguration appConfig, ClusterConfigurationHelperInternal clusterConfigurationHelper, String propertyName)
      Loads property from different sources in this order: 1. system property 2. shared home config file 3. local home config file
      Parameters:
      appConfig - application config
      propertyName - property name to load
      Returns:
      value of the property if defined, null otherwise