Class GoogleStorageLocation


  • public class GoogleStorageLocation
    extends Object
    Represents a Google Cloud Storage location provided by the user.
    Since:
    1.2
    • Constructor Detail

      • GoogleStorageLocation

        public GoogleStorageLocation​(String gcsLocationUriString)
        Constructs a GoogleStorageLocation based on the provided Google Storage URI string. The URI string is of the form: gs://<BUCKET_NAME>/<PATH_TO_FILE>
        Parameters:
        gcsLocationUriString - a Google Storage URI string to a bucket/folder/file.
    • Method Detail

      • isBucket

        public boolean isBucket()
        Check if the location references a bucket and not a blob.
        Returns:
        if the location describes a bucket
      • isFile

        public boolean isFile()
        Returns whether this GoogleStorageLocation represents a file or not.
        Returns:
        true if the location describes a file
      • isFolder

        public boolean isFolder()
        Returns whether this GoogleStorageLocation represents a folder.
        Returns:
        true if the location describes a folder
      • getBucketName

        public String getBucketName()
        Returns the Google Storage bucket name.
        Returns:
        the name of the Google Storage bucket
      • getBlobName

        public String getBlobName()
        Returns the path to the blob/folder relative from the bucket root. Returns null if the GoogleStorageLocation specifies a bucket itself.
        Returns:
        a path to the blob or folder; null if the location is to a bucket.
      • uri

        public URI uri()
        Returns the GCS URI of the location.
        Returns:
        the URI object of the Google Storage location.
      • uriString

        public String uriString()
        Returns the Google Storage URI string for the location.
        Returns:
        the URI string of the Google Storage location.