Class InMemoryBucketEntry


  • public class InMemoryBucketEntry
    extends Object
    InMemoryBucketEntry represents a GCS bucket in-memory by containing mappings to objects in the bucket alongside bucket-level metadata including storage location, storage class, etc. It is intended to be used only internally by the InMemoryGoogleCloudStorage class.
    • Constructor Detail

      • InMemoryBucketEntry

        public InMemoryBucketEntry​(String bucketName,
                                   long creationTimeMillis,
                                   long modificationTimeMillis,
                                   CreateBucketOptions options)
        Parameters:
        bucketName - The name representing the bucketName portion of a GCS path, e.g. gs://<bucketName>/<objectName>.
    • Method Detail

      • add

        public void add​(InMemoryObjectEntry obj)
        Inserts an InMemoryObjectEntry representing objectName; replaces any existing object.
      • get

        public InMemoryObjectEntry get​(String objectName)
        Retrieves a previously inserted InMemoryObjectEntry, or null if it doesn't exist.
      • remove

        public InMemoryObjectEntry remove​(String objectName)
        Removes a previously inserted InMemoryObjectEntry and returns it; returns null if it didn't exist.
      • getInfo

        public GoogleCloudStorageItemInfo getInfo()
        Gets the GoogleCloudStorageItemInfo associated with this BucketEntry; the 'size' of a bucket is always 0.
      • getObjectNames

        public Set<String> getObjectNames()
        Returns the Set containing all objectNames previously inserted into this bucket.
      • size

        public int size()
        Returns the number of objects in this bucket.