Package com.jcabi.s3

Class Ocket.Text

java.lang.Object
com.jcabi.s3.Ocket.Text
All Implemented Interfaces:
Ocket, Comparable<Ocket>
Enclosing interface:
Ocket

@Loggable(1) public static final class Ocket.Text extends Object implements Ocket
Unicode text S3 object with supplementary functions.
Since:
0.1
  • Constructor Details

    • Text

      public Text(Ocket ocket)
      Public ctor.
      Parameters:
      ocket - Original ocket
  • Method Details

    • 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 write
      type - Content type
      Throws:
      IOException - If fails
    • bucket

      public Bucket bucket()
      Description copied from interface: Ocket
      Get bucket we're in.
      Specified by:
      bucket in interface Ocket
      Returns:
      Bucket
    • key

      public String key()
      Description copied from interface: Ocket
      Get object key.
      Specified by:
      key in interface Ocket
      Returns:
      Key
    • meta

      public software.amazon.awssdk.services.s3.model.HeadObjectResponse meta() throws IOException
      Description copied from interface: Ocket
      Object metadata.

      Throws OcketNotFoundException if this object doesn't exist in S3 bucket.

      Specified by:
      meta in interface Ocket
      Returns:
      Metadata
      Throws:
      IOException - If fails
    • exists

      public boolean exists() throws IOException
      Description copied from interface: Ocket
      Check whether this S3 object exists.
      Specified by:
      exists in interface Ocket
      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: Ocket
      Read content.

      Throws OcketNotFoundException if this object doesn't exist in S3 bucket.

      Specified by:
      read in interface Ocket
      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: Ocket
      Write new content to the object.
      Specified by:
      write in interface Ocket
      Parameters:
      input - Where to get content
      meta - Metadata to save
      Throws:
      IOException - If fails
    • compareTo

      public int compareTo(Ocket ocket)
      Specified by:
      compareTo in interface Comparable<Ocket>