Class ReOcket

  • All Implemented Interfaces:
    Ocket, Comparable<Ocket>

    @Immutable
    @Loggable(1)
    public final class ReOcket
    extends Object
    implements Ocket
    Ocket that retries a few times before giving up.
    Since:
    0.5
    Version:
    $Id: 1dd1fd68fef92d57712077f48e2bb9ebd0b54fde $
    Author:
    Yegor Bugayenko (yegor256@gmail.com)
    • Constructor Detail

      • ReOcket

        public ReOcket​(Ocket okt)
        Public ctor.
        Parameters:
        okt - Ocket we're in
    • 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

        @RetryOnFailure(verbose=false)
        public com.amazonaws.services.s3.model.ObjectMetadata 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

        @RetryOnFailure(verbose=false)
        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
      • write

        @RetryOnFailure(verbose=false)
        public void write​(InputStream input,
                          com.amazonaws.services.s3.model.ObjectMetadata 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. Should contains input length for large object, otherwise multi-part uploads won't be possible.
        Throws:
        IOException - If fails