Skip to content

Commit c16080d

Browse files
---
yaml --- r: 5463 b: refs/heads/master c: 6d844c9 h: refs/heads/master i: 5461: 6e5ff51 5459: d8ef45d 5455: 414cb8e
1 parent 2d21d20 commit c16080d

4 files changed

Lines changed: 107 additions & 58 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: c268bb0e8151a62274d535ee4e761d48d4827d75
2+
refs/heads/master: 6d844c9465c62f78c6414314ca408f0e2aa06bf5
33
refs/heads/travis: dae77e558b884bc1b165155482d76c8e40b0fca4
44
refs/heads/gh-pages: 4936f6d1c43be1ab76229d2743bae07f4b4124b3
55
refs/tags/0.0.9: 22f1839238f66c39e67ed4dfdcd273b1ae2e8444

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import com.google.common.base.MoreObjects;
3434
import com.google.common.base.Throwables;
3535
import com.google.common.collect.AbstractIterator;
36+
import com.google.common.net.UrlEscapers;
3637
import com.google.common.primitives.Ints;
3738

3839
import java.io.BufferedInputStream;
@@ -210,6 +211,12 @@ public CloudStoragePath getPath(URI uri) {
210211
getFileSystem(CloudStorageUtil.stripPathFromUri(uri)), uri.getPath());
211212
}
212213

214+
/** Convenience method: replaces spaces with "%20", builds a URI, and calls getPath(uri). */
215+
public CloudStoragePath getPath(String uriInStringForm) {
216+
String escaped = UrlEscapers.urlFragmentEscaper().escape(uriInStringForm);
217+
return getPath(URI.create(escaped));
218+
}
219+
213220
@Override
214221
public SeekableByteChannel newByteChannel(
215222
Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) throws IOException {

0 commit comments

Comments
 (0)