Class CloudStoragePath

java.lang.Object
com.google.cloud.storage.contrib.nio.CloudStoragePath
All Implemented Interfaces:
Comparable<Path>, Iterable<Path>, Path, Watchable

@Immutable public final class CloudStoragePath extends Object implements Path
A Google Cloud Storage specific implementation of the java.nio.file.Path interface. An instance of this class locates an object or a "pseudo-directory" in GCS. This implementation allows one to use Java's standard file system API to deal with remote objects as if they are local files.

Example of using java.nio.file.Files to read all lines from a remote object:


 Path path = Paths.get(URI.create("gs://bucket/lolcat.csv"));
 List<String> lines = Files.readAllLines(path, StandardCharsets.UTF_8);