Package com.jcabi.s3
Class Ocket.Text
- java.lang.Object
-
- com.jcabi.s3.Ocket.Text
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.jcabi.s3.Ocket
Ocket.Empty, Ocket.Text
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Bucketbucket()Get bucket we're in.intcompareTo(Ocket ocket)booleanexists()Check whether this S3 object exists.Stringkey()Get object key.com.amazonaws.services.s3.model.ObjectMetadatameta()Object metadata.Stringread()Read content as string.voidread(OutputStream output)Read content.voidwrite(InputStream input, com.amazonaws.services.s3.model.ObjectMetadata meta)Write new content to the object.voidwrite(String text)Write content as string.voidwrite(String text, String type)Write content as string, with a specified content type.
-
-
-
Constructor Detail
-
Text
public Text(Ocket ocket)
Public ctor.- Parameters:
ocket- Original ocket
-
-
Method Detail
-
read
public String read() throws IOException
Read content as string.- Returns:
- Content
- Throws:
IOException- If fails
-
write
public void write(String text) throws IOException
Write content as string.- Parameters:
text- Text to write- Throws:
IOException- If fails
-
write
public void write(String text, String type) throws IOException
Write content as string, with a specified content type.- Parameters:
text- Text to writetype- Content type- Throws:
IOException- If fails
-
meta
public com.amazonaws.services.s3.model.ObjectMetadata meta() throws IOExceptionDescription copied from interface:OcketObject metadata.Throws
OcketNotFoundExceptionif this object doesn't exist in S3 bucket.- Specified by:
metain interfaceOcket- Returns:
- Metadata
- Throws:
IOException- If fails
-
exists
public boolean exists() throws IOExceptionDescription copied from interface:OcketCheck whether this S3 object exists.- Specified by:
existsin interfaceOcket- Returns:
- TRUE if it exists in S3, FALSE otherwise
- Throws:
IOException- If fails
-
read
public void read(OutputStream output) throws IOException
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, com.amazonaws.services.s3.model.ObjectMetadata 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. Should contains input length for large object, otherwise multi-part uploads won't be possible.- Throws:
IOException- If fails
-
compareTo
public int compareTo(Ocket ocket)
- Specified by:
compareToin interfaceComparable<Ocket>
-
-