presto-hive/src/main/java/io/prestosql/plugin/hive/s3/PrestoS3FileSystem.java/PrestoS3FileSystem/getBucketName
class PrestoS3FileSystem:    public static String getBucketName(URI uri)
    {
        if (uri.getHost() != null) {
            return uri.getHost();
        }

        if (uri.getUserInfo() == null) {
            return uri.getAuthority();
        }

        throw new IllegalArgumentException("Unable to determine S3 bucket from URI.");
    }