class S3Bucket extends Logging with Serializable
A representation of an Amazon's S3 bucket. This class wraps an com.amazonaws.services.s3.AmazonS3Client and provides a higher level interface for pushing and pulling files to and from a bucket.
- Alphabetic
- By Inheritance
- S3Bucket
- Serializable
- Logging
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
S3Bucket(bucketName: String, credentialsProvider: () ⇒ AWSCredentialsProvider = () => CredentialStore)
- bucketName
the name of the bucket
- credentialsProvider
optional AWS credentials provider to use (since AWSCredentials are not serializable). If the parameter is not supplied, they will be retrieved from the eu.shiftforward.apso.aws.CredentialStore.
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
backup(key: String): Boolean
Backups a remote file with the given
key.Backups a remote file with the given
key. A backup consists in copying the supplied file to a backup folder under the same bucket and folder the file is currently in.- key
the remote pathname to backup
- returns
true if the backup was successful, false otherwise.
- val bucketName: String
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
createDirectory(key: String): Boolean
Creates an empty directory at the given
keylocationCreates an empty directory at the given
keylocation- key
the remote pathname to the directory
- returns
true if the directory was created successfully, false otherwise.
-
def
delete(key: String): Boolean
Deletes the file in the location specified by
keyin the bucket.Deletes the file in the location specified by
keyin the bucket.- key
the remote pathname for the file
- returns
true if the deletion was successful, false otherwise.
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(obj: Any): Boolean
- Definition Classes
- S3Bucket → AnyRef → Any
-
def
exists(key: String): Boolean
Checks if the file in the location specified by
keyin the bucket exists.Checks if the file in the location specified by
keyin the bucket exists.- key
the remote pathname for the file
- returns
true if the file exists, false otherwise.
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
getFilesWithMatchingPrefix(prefix: String, includeDirectories: Boolean = false): Iterator[String]
Returns a list of filenames and directories in a bucket matching a given prefix.
Returns a list of filenames and directories in a bucket matching a given prefix.
- prefix
the prefix to match
- returns
a list of filenames in a bucket matching a given prefix.
-
def
getObjectsWithMatchingPrefix(prefix: String, includeDirectories: Boolean = false): Iterator[S3ObjectSummary]
Returns a list of objects in a bucket matching a given prefix.
Returns a list of objects in a bucket matching a given prefix.
- prefix
the prefix to match
- returns
a list of objects in a bucket matching a given prefix.
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
isDirectory(key: String): Boolean
Checks if the location specified by
keyis a directory.Checks if the location specified by
keyis a directory.- key
the remote pathname to the directory
- returns
true if the path is a directory, false otherwise.
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
lazy val
log: Logger
The
Loggerobject.The
Loggerobject. This logger will have the same name as the concrete class into which this trait is mixed-in.- Definition Classes
- Logging
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
pull(key: String, destination: String): Boolean
Pulls a remote file with the given
key, to the local storage in the pathname provided bydestination.Pulls a remote file with the given
key, to the local storage in the pathname provided bydestination.- key
the remote pathname to pull from
- destination
the local pathname to pull to
- returns
true if the pull was successful, false otherwise
-
def
push(key: String, inputStream: InputStream, length: Option[Long]): Boolean
Pushes a given
InputStreamto the location specified bykeyin the bucket.Pushes a given
InputStreamto the location specified bykeyin the bucket.- key
the remote pathname for the file
- inputStream
the
InputStreamto push- length
the content lenght (setting this to
Nonecan impact performance- returns
true if the push was successful, false otherwise.
-
def
push(key: String, file: File): Boolean
Pushes a given local
Fileto the location specified bykeyin the bucket.Pushes a given local
Fileto the location specified bykeyin the bucket.- key
the remote pathname for the file
- file
the local
Fileto push- returns
true if the push was successful, false otherwise.
-
def
setAcl(key: String, acl: CannedAccessControlList): Unit
Sets an access control list on a given Amazon S3 object.
Sets an access control list on a given Amazon S3 object.
- key
the remote pathname for the file
- acl
the
CannedAccessControlListto be applied to the Amazon S3 object
-
def
size(key: String): Long
Returns size of the file in the location specified by
keyin the bucket.Returns size of the file in the location specified by
keyin the bucket. If the file doesn't exist the return value is 0.- key
the remote pathname for the file
- returns
the size of the file in the location specified by
keyin the bucket if the exists, 0 otherwise.
- def stream(key: String, offset: Long = 0L): InputStream
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )