Class FkBucket

  • All Implemented Interfaces:
    Bucket, Comparable<Bucket>

    @Immutable
    @Loggable(1)
    public final class FkBucket
    extends Object
    implements Bucket
    Mock/fake bucket.
    Since:
    0.6
    Version:
    $Id: a3b0920c180560d8f6ff69121b2c9c8752111e49 $
    Author:
    Yegor Bugayenko (yegor256@gmail.com)
    • Constructor Detail

      • FkBucket

        public FkBucket​(String name)
                 throws IOException
        Ctor.
        Parameters:
        name - Name of the bucket
        Throws:
        IOException - If fails
        Since:
        0.17
      • FkBucket

        public FkBucket​(File file,
                        String name)
        Ctor.
        Parameters:
        file - Directory to keep files in
        name - Name of the bucket
      • FkBucket

        public FkBucket​(Path file,
                        String name)
        Ctor.
        Parameters:
        file - Directory to keep files in
        name - Name of the bucket
        Since:
        0.17
      • FkBucket

        public FkBucket​(String file,
                        String name)
        Ctor.
        Parameters:
        file - Directory to keep files in
        name - Name of the bucket
        Since:
        0.17
    • Method Detail

      • region

        public Region region()
        Description copied from interface: Bucket
        Get region we're in.
        Specified by:
        region in interface Bucket
        Returns:
        Region
      • name

        public String name()
        Description copied from interface: Bucket
        Get bucket name.
        Specified by:
        name in interface Bucket
        Returns:
        Bucket name
      • ocket

        public Ocket ocket​(String key)
        Description copied from interface: Bucket
        Get object.
        Specified by:
        ocket in interface Bucket
        Parameters:
        key - Name of it in the bucket
        Returns:
        Ocket
      • exists

        public boolean exists()
        Description copied from interface: Bucket
        Checks if the bucket exists.
        Specified by:
        exists in interface Bucket
        Returns:
        If the bucket exists true, otherwise false
      • remove

        public void remove​(String key)
        Description copied from interface: Bucket
        Delete object from bucket.
        Specified by:
        remove in interface Bucket
        Parameters:
        key - Name of it in the bucket
      • list

        public Iterable<String> list​(String pfx)
        Description copied from interface: Bucket
        List object names with a given prefix.
        Specified by:
        list in interface Bucket
        Parameters:
        pfx - Prefix to use
        Returns:
        Iterable of names