GoogleCloudStorageFileSystem { public FileInfo getFileInfo(URI path) throws IOException { checkArgument(path != null, "path must not be null"); StorageResourceId resourceId = StorageResourceId.fromUriPath(path, true); FileInfo fileInfo = FileInfo.fromItemInfo( getFileInfoInternal(resourceId, gcs.getOptions().isInferImplicitDirectoriesEnabled())); logger.atFinest().log("getFileInfo(path: %s): %s", path, fileInfo); return fileInfo; } GoogleCloudStorageFileSystem(
      Credential credential, GoogleCloudStorageFileSystemOptions options); @VisibleForTesting  GoogleCloudStorageFileSystem(GoogleCloudStorage gcs); @VisibleForTesting  GoogleCloudStorageFileSystem(
      GoogleCloudStorage gcs, GoogleCloudStorageFileSystemOptions options); GoogleCloudStorageFileSystemOptions getOptions(); static CreateObjectOptions objectOptionsFromFileOptions(CreateFileOptions options); WritableByteChannel create(URI path); WritableByteChannel create(URI path, CreateFileOptions options); SeekableByteChannel open(URI path); SeekableByteChannel open(URI path, GoogleCloudStorageReadOptions readOptions); void delete(URI path, boolean recursive); boolean exists(URI path); void mkdirs(URI path); void mkdirsInternal(StorageResourceId resourceId); void rename(URI src, URI dst); void compose(List<URI> sources, URI destination, String contentType); List<URI> listFileNames(FileInfo fileInfo); List<URI> listFileNames(FileInfo fileInfo, boolean recursive); List<FileInfo> listAllFileInfoForPrefix(URI prefix); ListPage<FileInfo> listAllFileInfoForPrefixPage(URI prefix, String pageToken); List<FileInfo> listFileInfo(URI path); FileInfo getFileInfo(URI path); List<FileInfo> getFileInfos(List<URI> paths); void close(); @VisibleForTesting void mkdir(URI path); GoogleCloudStorage getGcs(); static final String SCHEME; static final URI GCS_ROOT; static final ListObjectOptions LIST_SINGLE_OBJECT_OPTIONS; }
@Test public void testFileInfo() throws IOException { assertThat(gcsfs.getFileInfo(GoogleCloudStorageFileSystem.GCS_ROOT).getPath()) .isEqualTo(GoogleCloudStorageFileSystem.GCS_ROOT); assertThat(gcsfs.getFileInfo(GoogleCloudStorageFileSystem.GCS_ROOT).getItemInfo()) .isEqualTo(GoogleCloudStorageItemInfo.ROOT_INFO); }