@Immutable @Loggable(value=1) public final class FkOcket extends Object implements Ocket
Ocket.Empty, Ocket.Text
Constructor and Description |
---|
FkOcket()
Ctor.
|
FkOcket(File file,
String bucket,
String key)
Ctor.
|
FkOcket(Path file,
String bucket,
String key)
Ctor.
|
FkOcket(String bucket,
String key)
Ctor.
|
FkOcket(String file,
String bucket,
String key)
Ctor.
|
Modifier and Type | Method and Description |
---|---|
Bucket |
bucket()
Get bucket we're in.
|
int |
compareTo(Ocket ocket) |
boolean |
exists()
Check whether this S3 object exists.
|
File |
file()
Get my file.
|
String |
key()
Get object key.
|
com.amazonaws.services.s3.model.ObjectMetadata |
meta()
Object metadata.
|
void |
read(OutputStream output)
Read content.
|
void |
write(InputStream input,
com.amazonaws.services.s3.model.ObjectMetadata meta)
Write new content to the object.
|
public FkOcket() throws IOException
IOException
- If failspublic FkOcket(String bucket, String key) throws IOException
bucket
- Bucketkey
- KeyIOException
- If failspublic FkOcket(Path file, String bucket, String key)
file
- Dir we're inbucket
- Bucketkey
- Keypublic FkOcket(File file, String bucket, String key)
file
- Dir we're inbucket
- Bucketkey
- Keypublic com.amazonaws.services.s3.model.ObjectMetadata meta()
Ocket
Throws OcketNotFoundException
if this object
doesn't exist in S3 bucket.
public boolean exists()
Ocket
public void read(OutputStream output) throws IOException
Ocket
Throws OcketNotFoundException
if this object
doesn't exist in S3 bucket.
read
in interface Ocket
output
- Where to writeIOException
- If failspublic void write(InputStream input, com.amazonaws.services.s3.model.ObjectMetadata meta) throws IOException
Ocket
write
in interface Ocket
input
- Where to get contentmeta
- Metadata to save. Should contains input length for large
object, otherwise multi-part uploads won't be possible.IOException
- If failspublic int compareTo(Ocket ocket)
compareTo
in interface Comparable<Ocket>
public File file()
Copyright © 2012–2017 jcabi.com. All rights reserved.