Skip to content

Commit 79f3e17

Browse files
jartmziccard
authored andcommitted
---
yaml --- r: 3449 b: refs/heads/master c: 9784842 h: refs/heads/master i: 3447: 7dbdfc2
1 parent 2dfdd00 commit 79f3e17

25 files changed

Lines changed: 400 additions & 306 deletions

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 045dce208a88b7df5fd0a97d3f12b420d8e0f1d3
2+
refs/heads/master: 9784842ef3755e0256529f3ea60378d800d50917
33
refs/heads/travis: e21ee7b88a5edc3f3d8c71f90c3fc32abf7e8dd6
44
refs/heads/gh-pages: 4e0561bb4504bf647db669a14417b2b2c87ba45d
55
refs/heads/pubsub-alpha: 1a0e970f265af871e02274085b9662b3fe29058b

trunk/gcloud-java-contrib/gcloud-java-nio/src/main/java/com/google/cloud/storage/contrib/nio/CloudStorageConfiguration.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@
66

77
import java.util.Map;
88

9-
/** CloudStorageConfiguration is the configuration class for
10-
* {@link CloudStorageFileSystem#forBucket}. */
9+
/**
10+
* Configuration for a {@link CloudStorageFileSystem} instance.
11+
*/
1112
@AutoValue
1213
public abstract class CloudStorageConfiguration {
1314

14-
/** Returns the path of the current working directory. Defaults to the root directory.
15+
/**
16+
* Returns path of the current working directory. This defaults to the root directory.
1517
*/
1618
public abstract String workingDirectory();
1719

@@ -107,7 +109,6 @@ public Builder blockSize(int value) {
107109
return this;
108110
}
109111

110-
111112
/** Creates a new instance, but does not destroy the builder.
112113
*/
113114
public CloudStorageConfiguration build() {

trunk/gcloud-java-contrib/gcloud-java-nio/src/main/java/com/google/cloud/storage/contrib/nio/CloudStorageFileAttributeView.java

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.google.cloud.storage.contrib.nio;
22

3-
import static com.google.common.base.Verify.verifyNotNull;
3+
import static com.google.common.base.Preconditions.checkNotNull;
44

55
import com.google.cloud.storage.BlobInfo;
66
import com.google.cloud.storage.Storage;
@@ -15,21 +15,22 @@
1515
import javax.annotation.Nullable;
1616
import javax.annotation.concurrent.Immutable;
1717

18-
/** Metadata view for a Google Cloud Storage object.
18+
/**
19+
* Metadata view for a Google Cloud Storage object.
1920
*/
2021
@Immutable
2122
public final class CloudStorageFileAttributeView implements BasicFileAttributeView {
2223

23-
//private final CloudStorageFileSystemProvider provider;
2424
private final Storage storage;
2525
private final CloudStoragePath path;
2626

2727
CloudStorageFileAttributeView(Storage storage, CloudStoragePath path) {
28-
this.storage = verifyNotNull(storage);
29-
this.path = verifyNotNull(path);
28+
this.storage = checkNotNull(storage);
29+
this.path = checkNotNull(path);
3030
}
3131

32-
/** Returns {@value CloudStorageFileSystem#GCS_VIEW}.
32+
/**
33+
* Returns {@value CloudStorageFileSystem#GCS_VIEW}.
3334
*/
3435
@Override
3536
public String name() {
@@ -38,8 +39,7 @@ public String name() {
3839

3940
@Override
4041
public CloudStorageFileAttributes readAttributes() throws IOException {
41-
if (path.seemsLikeADirectory()
42-
&& path.getFileSystem().config().usePseudoDirectories()) {
42+
if (path.seemsLikeADirectory() && path.getFileSystem().config().usePseudoDirectories()) {
4343
return new CloudStoragePseudoDirectoryAttributes(path);
4444
}
4545
BlobInfo blobInfo = storage.get(path.getBlobId());
@@ -62,8 +62,8 @@ public void setTimes(FileTime lastModifiedTime, FileTime lastAccessTime, FileTim
6262
public boolean equals(@Nullable Object other) {
6363
return this == other
6464
|| other instanceof CloudStorageFileAttributeView
65-
&& Objects.equals(storage, ((CloudStorageFileAttributeView) other).storage)
66-
&& Objects.equals(path, ((CloudStorageFileAttributeView) other).path);
65+
&& Objects.equals(storage, ((CloudStorageFileAttributeView) other).storage)
66+
&& Objects.equals(path, ((CloudStorageFileAttributeView) other).path);
6767
}
6868

6969
@Override
@@ -73,9 +73,6 @@ public int hashCode() {
7373

7474
@Override
7575
public String toString() {
76-
return MoreObjects.toStringHelper(this)
77-
.add("storage", storage)
78-
.add("path", path)
79-
.toString();
76+
return MoreObjects.toStringHelper(this).add("storage", storage).add("path", path).toString();
8077
}
8178
}

trunk/gcloud-java-contrib/gcloud-java-nio/src/main/java/com/google/cloud/storage/contrib/nio/CloudStorageFileSystem.java

Lines changed: 37 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ public static CloudStorageFileSystem forBucket(String bucket) {
5959
* @see #forBucket(String)
6060
*/
6161
public static CloudStorageFileSystem forBucket(String bucket, CloudStorageConfiguration config) {
62-
checkArgument(!bucket.startsWith(URI_SCHEME + ":"),
63-
"Bucket name must not have schema: %s", bucket);
62+
checkArgument(
63+
!bucket.startsWith(URI_SCHEME + ":"), "Bucket name must not have schema: %s", bucket);
6464
return new CloudStorageFileSystem(
6565
new CloudStorageFileSystemProvider(), bucket, checkNotNull(config));
6666
}
@@ -100,9 +100,7 @@ public static CloudStorageFileSystem forBucket(String bucket, CloudStorageConfig
100100
private final CloudStorageConfiguration config;
101101

102102
CloudStorageFileSystem(
103-
CloudStorageFileSystemProvider provider,
104-
String bucket,
105-
CloudStorageConfiguration config) {
103+
CloudStorageFileSystemProvider provider, String bucket, CloudStorageConfiguration config) {
106104
checkArgument(!bucket.isEmpty(), "bucket");
107105
this.provider = provider;
108106
this.bucket = bucket;
@@ -114,47 +112,56 @@ public CloudStorageFileSystemProvider provider() {
114112
return provider;
115113
}
116114

117-
/** Returns the Cloud Storage bucket name being served by this file system.
118-
*/
115+
/**
116+
* Returns the Cloud Storage bucket name being served by this file system.
117+
*/
119118
public String bucket() {
120119
return bucket;
121120
}
122121

123-
/** Returns the configuration object for this filesystem instance.
124-
*/
122+
/**
123+
* Returns the configuration object for this filesystem instance.
124+
*/
125125
public CloudStorageConfiguration config() {
126126
return config;
127127
}
128128

129-
/** Converts a cloud storage object name to a {@link Path} object.
130-
*/
129+
/**
130+
* Converts a cloud storage object name to a {@link Path} object.
131+
*/
131132
@Override
132133
public CloudStoragePath getPath(String first, String... more) {
133-
checkArgument(!first.startsWith(URI_SCHEME + ":"),
134-
"GCS FileSystem.getPath() must not have schema and bucket name: %s", first);
134+
checkArgument(
135+
!first.startsWith(URI_SCHEME + ":"),
136+
"GCS FileSystem.getPath() must not have schema and bucket name: %s",
137+
first);
135138
return CloudStoragePath.getPath(this, first, more);
136139
}
137140

138-
/** Does nothing.
139-
*/
141+
/**
142+
* Does nothing.
143+
*/
140144
@Override
141145
public void close() {}
142146

143-
/** Returns {@code true}.
144-
*/
147+
/**
148+
* Returns {@code true}.
149+
*/
145150
@Override
146151
public boolean isOpen() {
147152
return true;
148153
}
149154

150-
/** Returns {@code false}.
151-
*/
155+
/**
156+
* Returns {@code false}.
157+
*/
152158
@Override
153159
public boolean isReadOnly() {
154160
return false;
155161
}
156162

157-
/** Returns {@value UnixPath#SEPARATOR}.
163+
/**
164+
* Returns {@value UnixPath#SEPARATOR}.
158165
*/
159166
@Override
160167
public String getSeparator() {
@@ -176,22 +183,26 @@ public Set<String> supportedFileAttributeViews() {
176183
return SUPPORTED_VIEWS;
177184
}
178185

179-
/** Always throws {@link UnsupportedOperationException}. */
186+
/**
187+
* Throws {@link UnsupportedOperationException} because this feature hasn't been implemented yet.
188+
*/
180189
@Override
181190
public PathMatcher getPathMatcher(String syntaxAndPattern) {
182191
// TODO: Implement me.
183192
throw new UnsupportedOperationException();
184193
}
185194

186-
/** Always throws {@link UnsupportedOperationException}.
187-
*/
195+
/**
196+
* Throws {@link UnsupportedOperationException} because this feature hasn't been implemented yet.
197+
*/
188198
@Override
189199
public UserPrincipalLookupService getUserPrincipalLookupService() {
190200
// TODO: Implement me.
191201
throw new UnsupportedOperationException();
192202
}
193203

194-
/** Always throws {@link UnsupportedOperationException}.
204+
/**
205+
* Throws {@link UnsupportedOperationException} because this feature hasn't been implemented yet.
195206
*/
196207
@Override
197208
public WatchService newWatchService() throws IOException {
@@ -203,8 +214,8 @@ public WatchService newWatchService() throws IOException {
203214
public boolean equals(@Nullable Object other) {
204215
return this == other
205216
|| other instanceof CloudStorageFileSystem
206-
&& Objects.equals(config, ((CloudStorageFileSystem) other).config)
207-
&& Objects.equals(bucket, ((CloudStorageFileSystem) other).bucket);
217+
&& Objects.equals(config, ((CloudStorageFileSystem) other).config)
218+
&& Objects.equals(bucket, ((CloudStorageFileSystem) other).bucket);
208219
}
209220

210221
@Override

0 commit comments

Comments
 (0)