GoogleHadoopFileSystem extends GoogleHadoopFileSystemBase { @Override public URI getGcsPath(Path hadoopPath) { logger.atFinest().log("getGcsPath(hadoopPath: %s)", hadoopPath); Path resolvedPath = makeQualified(hadoopPath); String objectName = resolvedPath.toUri().getPath(); if (objectName != null && resolvedPath.isAbsolute()) { objectName = objectName.substring(1); } URI gcsPath = UriPaths.fromStringPathComponents(rootBucket, objectName, true); logger.atFinest().log("getGcsPath(hadoopPath: %s): %s", hadoopPath, gcsPath); return gcsPath; } GoogleHadoopFileSystem(); @VisibleForTesting  GoogleHadoopFileSystem(GoogleCloudStorageFileSystem gcsfs); @Override Path getHadoopPath(URI gcsPath); @Override URI getGcsPath(Path hadoopPath); @Override String getScheme(); @Override Path getFileSystemRoot(); @Override Path getDefaultWorkingDirectory(); static final String SCHEME; }
@Override @Test public void testGetGcsPath() throws URISyntaxException { GoogleHadoopFileSystem myghfs = (GoogleHadoopFileSystem) ghfs; URI gcsPath = new URI("gs: assertThat(myghfs.getGcsPath(new Path(gcsPath))).isEqualTo(gcsPath); }