commandbox.system.services

Class S3Service

lucee.Component
    extended by commandbox.system.services.S3Service

Copyright Since 2014 CommandBox by Ortus Solutions, Corp www.coldbox.org | www.ortussolutions.com I convert s3 paths (s3://bucket/path) to signed HTTPS urls

Class Attributes:
  • singleton
  •  
  • synchronized : false
  •  
  • accessors : true
  •  
  • persistent : false
  •  
  • author : Brad Wood, Luis Majano, Denny Valliant
  •  
    Property Summary
    type property default serializable required
    struct bucketRegionCache


    • access = public
    • returntype = any
    true false
    any configService


    • access = public
    • returntype = any
    • inject = configService
    true false
    any fileSystemUtil


    • access = public
    • returntype = any
    • inject = FileSystem
    true false
    string iamRolePath
          Local URL to query for IAM role.

    • access = public
    • returntype = any
    true false
    any systemSettings


    • access = public
    • returntype = any
    • inject = SystemSettings
    true false
    any wirebox


    • access = public
    • returntype = any
    • inject = wirebox
    true false
    Constructor Summary
    init()
          Constructor.
    Method Summary
    private any encodeUrl([any urlPath], [any encodeForwardSlash='true'])
    private any generatePresignedPath([any method], [any bucket], [any objectKey], [any bucketRegion], [any credentials])
    string generateSignedURL(string s3Path, [boolean verbose='false'])
         Generate a signed HTTPS URL from a S3 path.
    string getBucketRegionCache()
    string getConfigService()
    string getFileSystemUtil()
    string getIamRolePath()
    string getSystemSettings()
    string getWirebox()
    private any iso8601([any dateToFormat='[runtime expression]'])
    private any makeHTTPRequest([any urlPath], [any method='GET'], [any redirect='true'], [any timeout='20'], [any headers='[runtime expression]'], [any allowProxy='true'])
    any onDIComplete()
    private any resolveAwsSettings([any bucket], [any verbose='false'])
    private any resolveBucketRegion([any bucket], [any defaultRegion], [any verbose='false'])
    private any resolveCredentials([any endpointSettings], [any credentialsFile], [any profile], [any verbose='false'])
    any setBucketRegionCache(struct bucketRegionCache)
    any setConfigService(any configService)
    any setFileSystemUtil(any fileSystemUtil)
    any setIamRolePath(string iamRolePath)
    any setSystemSettings(any systemSettings)
    any setWirebox(any wirebox)
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init()

    Constructor


    Property Detail

    bucketRegionCache

    property struct bucketRegionCache

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    configService

    property any configService

    Attributes:
    access - public
    required - false
    returntype - any
    inject - configService
    serializable - true

    fileSystemUtil

    property any fileSystemUtil

    Attributes:
    access - public
    required - false
    returntype - any
    inject - FileSystem
    serializable - true

    iamRolePath

    property string iamRolePath

    Local URL to query for IAM role

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    systemSettings

    property any systemSettings

    Attributes:
    access - public
    required - false
    returntype - any
    inject - SystemSettings
    serializable - true

    wirebox

    property any wirebox

    Attributes:
    access - public
    required - false
    returntype - any
    inject - wirebox
    serializable - true

    Method Detail

    encodeUrl

    private any encodeUrl([any urlPath], [any encodeForwardSlash='true'])

    Parameters:
    urlPath
    encodeForwardSlash

    generatePresignedPath

    private any generatePresignedPath([any method], [any bucket], [any objectKey], [any bucketRegion], [any credentials])

    Parameters:
    method
    bucket
    objectKey
    bucketRegion
    credentials

    generateSignedURL

    public string generateSignedURL(string s3Path, [boolean verbose='false'])

    Generate a signed HTTPS URL from a S3 path.

    Parameters:
    s3Path - Path to S3 object specified in the format s3://bucket/path/to/object
    verbose - Set to true to log additional information

    getBucketRegionCache

    public string getBucketRegionCache()


    getConfigService

    public string getConfigService()


    getFileSystemUtil

    public string getFileSystemUtil()


    getIamRolePath

    public string getIamRolePath()


    getSystemSettings

    public string getSystemSettings()


    getWirebox

    public string getWirebox()


    iso8601

    private any iso8601([any dateToFormat='[runtime expression]'])

    Parameters:
    dateToFormat

    makeHTTPRequest

    private any makeHTTPRequest([any urlPath], [any method='GET'], [any redirect='true'], [any timeout='20'], [any headers='[runtime expression]'], [any allowProxy='true'])

    Parameters:
    urlPath
    method
    redirect
    timeout
    headers
    allowProxy

    onDIComplete

    public any onDIComplete()


    resolveAwsSettings

    private any resolveAwsSettings([any bucket], [any verbose='false'])

    Parameters:
    bucket
    verbose

    resolveBucketRegion

    private any resolveBucketRegion([any bucket], [any defaultRegion], [any verbose='false'])

    Parameters:
    bucket
    defaultRegion
    verbose

    resolveCredentials

    private any resolveCredentials([any endpointSettings], [any credentialsFile], [any profile], [any verbose='false'])

    Parameters:
    endpointSettings
    credentialsFile
    profile
    verbose

    setBucketRegionCache

    public any setBucketRegionCache(struct bucketRegionCache)

    Parameters:
    bucketRegionCache

    setConfigService

    public any setConfigService(any configService)

    Parameters:
    configService

    setFileSystemUtil

    public any setFileSystemUtil(any fileSystemUtil)

    Parameters:
    fileSystemUtil

    setIamRolePath

    public any setIamRolePath(string iamRolePath)

    Parameters:
    iamRolePath

    setSystemSettings

    public any setSystemSettings(any systemSettings)

    Parameters:
    systemSettings

    setWirebox

    public any setWirebox(any wirebox)

    Parameters:
    wirebox