Class FkBucket

java.lang.Object
com.jcabi.s3.fake.FkBucket
All Implemented Interfaces:
Bucket, Comparable<Bucket>

@Immutable @Loggable(1) public final class FkBucket extends Object implements Bucket
Mock/fake bucket.
Since:
0.6
  • Constructor Details

    • FkBucket

      public FkBucket() throws IOException
      Ctor.
      Throws:
      IOException - If fails
      Since:
      0.17
    • 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 Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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
    • compareTo

      public int compareTo(Bucket bucket)
      Specified by:
      compareTo in interface Comparable<Bucket>