Package com.jcabi.s3.fake
Class FkOcket
java.lang.Object
com.jcabi.s3.fake.FkOcket
- All Implemented Interfaces:
Ocket,Comparable<Ocket>
Mock/fake ocket.
- Since:
- 0.6
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.jcabi.s3.Ocket
Ocket.Empty, Ocket.Text -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbucket()Get bucket we're in.intbooleanexists()Check whether this S3 object exists.file()Get my file.key()Get object key.software.amazon.awssdk.services.s3.model.HeadObjectResponsemeta()Object metadata.voidread(OutputStream output) Read content.toString()voidwrite(InputStream input, software.amazon.awssdk.services.s3.model.HeadObjectResponse meta) Write new content to the object.
-
Constructor Details
-
FkOcket
Ctor.- Throws:
IOException- If fails- Since:
- 0.17
-
FkOcket
Ctor.- Parameters:
bucket- Bucketkey- Key- Throws:
IOException- If fails- Since:
- 0.17
-
FkOcket
Ctor.- Parameters:
file- Dir we're inbucket- Bucketkey- Key- Since:
- 0.17
-
FkOcket
Ctor.- Parameters:
file- Dir we're inbucket- Bucketkey- Key
-
FkOcket
Ctor.- Parameters:
file- Dir we're inbucket- Bucketkey- Key- Since:
- 0.17
-
-
Method Details
-
toString
-
bucket
Description copied from interface:OcketGet bucket we're in. -
key
Description copied from interface:OcketGet object key. -
meta
public software.amazon.awssdk.services.s3.model.HeadObjectResponse meta()Description copied from interface:OcketObject metadata.Throws
OcketNotFoundExceptionif this object doesn't exist in S3 bucket. -
exists
public boolean exists()Description copied from interface:OcketCheck whether this S3 object exists. -
read
Description copied from interface:OcketRead content.Throws
OcketNotFoundExceptionif this object doesn't exist in S3 bucket.- Specified by:
readin interfaceOcket- Parameters:
output- Where to write- Throws:
IOException- If fails
-
write
public void write(InputStream input, software.amazon.awssdk.services.s3.model.HeadObjectResponse meta) throws IOException Description copied from interface:OcketWrite new content to the object.- Specified by:
writein interfaceOcket- Parameters:
input- Where to get contentmeta- Metadata to save- Throws:
IOException- If fails
-
compareTo
- Specified by:
compareToin interfaceComparable<Ocket>
-
file
Get my file.- Returns:
- File
-