
com.metreeca.gcp.services.GCPStore Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of metreeca-gcp Show documentation
Show all versions of metreeca-gcp Show documentation
Connector kit for Google Cloud.
The newest version!
/*
* Copyright © 2013-2022 Metreeca srl
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.metreeca.gcp.services;
import com.metreeca.rest.services.Store;
import com.google.cloud.storage.*;
import java.io.*;
import java.nio.channels.Channels;
import java.nio.file.NoSuchFileException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* Google Cloud blob store.
*
* Retrieves blobs managed by the Google Cloud Storage service.
*
* For both {@linkplain #read(String) read} and {@linkplain #write(String) write} operations, blob identifiers not
* matching a full GCS URI (i.e. {@code gs://{bucket}/{object}}) or link URL (i.e. {@code
* https://storage.cloud.google.com/{bucket}/{object}}) are interpreted as object names in the default project bucket
* (i.e. {@code {project}.appspot.com}).
*
* @see Google Cloud Plaform - Storage
*/
public final class GCPStore implements Store {
private static final Pattern IdPattern=Pattern
.compile("(?:https://storage\\.cloud\\.google\\.com/|gs://)(?[^/]+)/(?
© 2015 - 2025 Weber Informatics LLC | Privacy Policy