{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/pulls/comments/53392086","id":53392086,"diff_hunk":"@@ -3,38 +3,52 @@\n import static com.google.common.base.Preconditions.checkNotNull;\n import static com.google.gcloud.storage.contrib.nio.CloudStorageFileSystem.FILE_TIME_UNKNOWN;\n \n-import com.google.appengine.tools.cloudstorage.GcsFileMetadata;\n import com.google.common.base.MoreObjects;\n import com.google.common.base.Optional;\n import com.google.common.collect.ImmutableMap;\n+import com.google.gcloud.storage.Acl;\n+import com.google.gcloud.storage.BlobInfo;\n \n import java.nio.file.attribute.FileTime;\n+import java.util.List;\n import java.util.Objects;\n \n import javax.annotation.Nullable;\n import javax.annotation.concurrent.Immutable;\n \n-/** Metadata for a Google Cloud Storage object. */\n+/**\n+ * Metadata for a Google Cloud Storage object.\n+ */\n @Immutable\n final class CloudStorageObjectAttributes implements CloudStorageFileAttributes {\n \n-  private final GcsFileMetadata metadata;\n+  private final BlobInfo info;\n+  private final String name;\n \n-  CloudStorageObjectAttributes(GcsFileMetadata metadata) {\n-    this.metadata = checkNotNull(metadata);\n+  CloudStorageObjectAttributes(BlobInfo info) {\n+    this.info = checkNotNull(info);\n+    this.name = info.name();\n+  }\n+\n+  CloudStorageObjectAttributes(String directoryName) {\n+    this.info = null;\n+    this.name = checkNotNull(directoryName);\n   }\n \n   @Override\n   public long size() {\n-    return metadata.getLength();\n+    if (null == info) {\n+      return 0;\n+    }\n+    return info.size();\n   }\n \n   @Override\n   public FileTime creationTime() {\n-    if (metadata.getLastModified() == null) {\n+    if (null == info || info.updateTime() == null) {","path":"gcloud-java-contrib/gcloud-java-nio/src/main/java/com/google/gcloud/storage/contrib/nio/CloudStorageObjectAttributes.java","position":53,"original_position":53,"commit_id":"de16eabb41af2d5b9126c807e84c49bbaef35d00","original_commit_id":"a407b302a0ed652bd9367ce4e9a5408865f62ad9","user":{"login":"jart","id":49262,"avatar_url":"https://avatars.githubusercontent.com/u/49262?v=3","gravatar_id":"","url":"https://api.github.com/users/jart","html_url":"https://github.com/jart","followers_url":"https://api.github.com/users/jart/followers","following_url":"https://api.github.com/users/jart/following{/other_user}","gists_url":"https://api.github.com/users/jart/gists{/gist_id}","starred_url":"https://api.github.com/users/jart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jart/subscriptions","organizations_url":"https://api.github.com/users/jart/orgs","repos_url":"https://api.github.com/users/jart/repos","events_url":"https://api.github.com/users/jart/events{/privacy}","received_events_url":"https://api.github.com/users/jart/received_events","type":"User","site_admin":false},"body":"Cloud storage doesn't have folders. Are you talking about pseudo directories? Because the behavior for performing IO on pseudo directories is to throw [CloudStoragePseudoDirectoryException](https://github.com/jean-philippe-martin/gcloud-java/blob/gcs-nio/gcloud-java-contrib/gcloud-java-nio/src/main/java/com/google/gcloud/storage/contrib/nio/CloudStoragePseudoDirectoryException.java)","created_at":"2016-02-18T22:18:43Z","updated_at":"2016-02-18T22:18:43Z","html_url":"https://github.com/GoogleCloudPlatform/gcloud-java/pull/649#discussion_r53392086","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/pulls/649","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/pulls/comments/53392086"},"html":{"href":"https://github.com/GoogleCloudPlatform/gcloud-java/pull/649#discussion_r53392086"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/pulls/649"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/pulls/649","id":59711313,"html_url":"https://github.com/GoogleCloudPlatform/gcloud-java/pull/649","diff_url":"https://github.com/GoogleCloudPlatform/gcloud-java/pull/649.diff","patch_url":"https://github.com/GoogleCloudPlatform/gcloud-java/pull/649.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/issues/649","number":649,"state":"open","locked":false,"title":"FakeStorageRPC and nio using gcloud-storage","user":{"login":"jean-philippe-martin","id":10458949,"avatar_url":"https://avatars.githubusercontent.com/u/10458949?v=3","gravatar_id":"","url":"https://api.github.com/users/jean-philippe-martin","html_url":"https://github.com/jean-philippe-martin","followers_url":"https://api.github.com/users/jean-philippe-martin/followers","following_url":"https://api.github.com/users/jean-philippe-martin/following{/other_user}","gists_url":"https://api.github.com/users/jean-philippe-martin/gists{/gist_id}","starred_url":"https://api.github.com/users/jean-philippe-martin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jean-philippe-martin/subscriptions","organizations_url":"https://api.github.com/users/jean-philippe-martin/orgs","repos_url":"https://api.github.com/users/jean-philippe-martin/repos","events_url":"https://api.github.com/users/jean-philippe-martin/events{/privacy}","received_events_url":"https://api.github.com/users/jean-philippe-martin/received_events","type":"User","site_admin":false},"body":" * Java NIO Filesystem support for gcs:// ported from AppEngine to GCloud API\r\n * wrote FakeStorageRPC so we can run unit tests\r\n * unit tests pass","created_at":"2016-02-17T21:25:52Z","updated_at":"2016-02-18T22:18:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"921a6e24e691c0d553eed3b80ef01fcd72c9f6d4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/pulls/649/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/pulls/649/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/issues/649/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/statuses/de16eabb41af2d5b9126c807e84c49bbaef35d00","head":{"label":"jean-philippe-martin:gcs-nio","ref":"gcs-nio","sha":"de16eabb41af2d5b9126c807e84c49bbaef35d00","user":{"login":"jean-philippe-martin","id":10458949,"avatar_url":"https://avatars.githubusercontent.com/u/10458949?v=3","gravatar_id":"","url":"https://api.github.com/users/jean-philippe-martin","html_url":"https://github.com/jean-philippe-martin","followers_url":"https://api.github.com/users/jean-philippe-martin/followers","following_url":"https://api.github.com/users/jean-philippe-martin/following{/other_user}","gists_url":"https://api.github.com/users/jean-philippe-martin/gists{/gist_id}","starred_url":"https://api.github.com/users/jean-philippe-martin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jean-philippe-martin/subscriptions","organizations_url":"https://api.github.com/users/jean-philippe-martin/orgs","repos_url":"https://api.github.com/users/jean-philippe-martin/repos","events_url":"https://api.github.com/users/jean-philippe-martin/events{/privacy}","received_events_url":"https://api.github.com/users/jean-philippe-martin/received_events","type":"User","site_admin":false},"repo":{"id":50390684,"name":"gcloud-java","full_name":"jean-philippe-martin/gcloud-java","owner":{"login":"jean-philippe-martin","id":10458949,"avatar_url":"https://avatars.githubusercontent.com/u/10458949?v=3","gravatar_id":"","url":"https://api.github.com/users/jean-philippe-martin","html_url":"https://github.com/jean-philippe-martin","followers_url":"https://api.github.com/users/jean-philippe-martin/followers","following_url":"https://api.github.com/users/jean-philippe-martin/following{/other_user}","gists_url":"https://api.github.com/users/jean-philippe-martin/gists{/gist_id}","starred_url":"https://api.github.com/users/jean-philippe-martin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jean-philippe-martin/subscriptions","organizations_url":"https://api.github.com/users/jean-philippe-martin/orgs","repos_url":"https://api.github.com/users/jean-philippe-martin/repos","events_url":"https://api.github.com/users/jean-philippe-martin/events{/privacy}","received_events_url":"https://api.github.com/users/jean-philippe-martin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jean-philippe-martin/gcloud-java","description":"Google Cloud Client Library for Java","fork":true,"url":"https://api.github.com/repos/jean-philippe-martin/gcloud-java","forks_url":"https://api.github.com/repos/jean-philippe-martin/gcloud-java/forks","keys_url":"https://api.github.com/repos/jean-philippe-martin/gcloud-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jean-philippe-martin/gcloud-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jean-philippe-martin/gcloud-java/teams","hooks_url":"https://api.github.com/repos/jean-philippe-martin/gcloud-java/hooks","issue_events_url":"https://api.github.com/repos/jean-philippe-martin/gcloud-java/issues/events{/number}","events_url":"https://api.github.com/repos/jean-philippe-martin/gcloud-java/events","assignees_url":"https://api.github.com/repos/jean-philippe-martin/gcloud-java/assignees{/user}","branches_url":"https://api.github.com/repos/jean-philippe-martin/gcloud-java/branches{/branch}","tags_url":"https://api.github.com/repos/jean-philippe-martin/gcloud-java/tags","blobs_url":"https://api.github.com/repos/jean-philippe-martin/gcloud-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jean-philippe-martin/gcloud-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jean-philippe-martin/gcloud-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/jean-philippe-martin/gcloud-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jean-philippe-martin/gcloud-java/statuses/{sha}","languages_url":"https://api.github.com/repos/jean-philippe-martin/gcloud-java/languages","stargazers_url":"https://api.github.com/repos/jean-philippe-martin/gcloud-java/stargazers","contributors_url":"https://api.github.com/repos/jean-philippe-martin/gcloud-java/contributors","subscribers_url":"https://api.github.com/repos/jean-philippe-martin/gcloud-java/subscribers","subscription_url":"https://api.github.com/repos/jean-philippe-martin/gcloud-java/subscription","commits_url":"https://api.github.com/repos/jean-philippe-martin/gcloud-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/jean-philippe-martin/gcloud-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/jean-philippe-martin/gcloud-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/jean-philippe-martin/gcloud-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/jean-philippe-martin/gcloud-java/contents/{+path}","compare_url":"https://api.github.com/repos/jean-philippe-martin/gcloud-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jean-philippe-martin/gcloud-java/merges","archive_url":"https://api.github.com/repos/jean-philippe-martin/gcloud-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jean-philippe-martin/gcloud-java/downloads","issues_url":"https://api.github.com/repos/jean-philippe-martin/gcloud-java/issues{/number}","pulls_url":"https://api.github.com/repos/jean-philippe-martin/gcloud-java/pulls{/number}","milestones_url":"https://api.github.com/repos/jean-philippe-martin/gcloud-java/milestones{/number}","notifications_url":"https://api.github.com/repos/jean-philippe-martin/gcloud-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jean-philippe-martin/gcloud-java/labels{/name}","releases_url":"https://api.github.com/repos/jean-philippe-martin/gcloud-java/releases{/id}","deployments_url":"https://api.github.com/repos/jean-philippe-martin/gcloud-java/deployments","created_at":"2016-01-26T00:17:47Z","updated_at":"2016-01-26T00:17:49Z","pushed_at":"2016-02-18T20:17:53Z","git_url":"git://github.com/jean-philippe-martin/gcloud-java.git","ssh_url":"git@github.com:jean-philippe-martin/gcloud-java.git","clone_url":"https://github.com/jean-philippe-martin/gcloud-java.git","svn_url":"https://github.com/jean-philippe-martin/gcloud-java","homepage":"http://googlecloudplatform.github.io/gcloud-java/","size":25537,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"GoogleCloudPlatform:gcs-nio","ref":"gcs-nio","sha":"2e2b450f2d84f9eaa308894775102ead9cb5e48c","user":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":26181278,"name":"gcloud-java","full_name":"GoogleCloudPlatform/gcloud-java","owner":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleCloudPlatform/gcloud-java","description":"Google Cloud Client Library for Java","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/releases{/id}","deployments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/deployments","created_at":"2014-11-04T17:57:16Z","updated_at":"2016-02-16T08:56:20Z","pushed_at":"2016-02-18T21:58:10Z","git_url":"git://github.com/GoogleCloudPlatform/gcloud-java.git","ssh_url":"git@github.com:GoogleCloudPlatform/gcloud-java.git","clone_url":"https://github.com/GoogleCloudPlatform/gcloud-java.git","svn_url":"https://github.com/GoogleCloudPlatform/gcloud-java","homepage":"http://googlecloudplatform.github.io/gcloud-java/","size":213436,"stargazers_count":64,"watchers_count":64,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":34,"mirror_url":null,"open_issues_count":110,"forks":34,"open_issues":110,"watchers":64,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/pulls/649"},"html":{"href":"https://github.com/GoogleCloudPlatform/gcloud-java/pull/649"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/issues/649"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/issues/649/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/pulls/649/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/pulls/649/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/statuses/de16eabb41af2d5b9126c807e84c49bbaef35d00"}}}}