Package com.jcabi.s3

Class Ocket.Empty

  • All Implemented Interfaces:
    Ocket, Comparable<Ocket>
    Enclosing interface:
    Ocket

    @Loggable(1)
    public static final class Ocket.Empty
    extends Object
    implements Ocket
    Ocket with no content at all.
    • Constructor Detail

      • Empty

        public Empty()
    • Method Detail

      • 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 com.amazonaws.services.s3.model.ObjectMetadata meta()
        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
      • exists

        public boolean exists()
        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
      • read

        public void read​(OutputStream output)
        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
      • write

        public void write​(InputStream input,
                          com.amazonaws.services.s3.model.ObjectMetadata meta)
        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. Should contains input length for large object, otherwise multi-part uploads won't be possible.