All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.opentripplanner.ext.datastore.gs.AbstractGsDataSource Maven / Gradle / Ivy

There is a newer version: 2.5.0
Show newest version
package org.opentripplanner.ext.datastore.gs;

import com.google.cloud.storage.BlobId;
import org.opentripplanner.datastore.DataSource;
import org.opentripplanner.datastore.FileType;

abstract class AbstractGsDataSource implements DataSource {
    private final BlobId blobId;
    private final FileType type;

     AbstractGsDataSource(BlobId blobId, FileType type) {
        this.blobId = blobId;
        this.type = type;
    }

    BlobId blobId() {
        return blobId;
    }

    String bucketName() {
        return blobId.getBucket();
    }

    @Override
    public final String name() {
        return blobId.getName();
    }

    @Override
    public final String path() {
        return GsHelper.toUriString(blobId);
    }

    @Override
    public final FileType type() {
        return type;
    }

    @Override
    public final String toString() {
        return type + " " + path();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy