beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dhalp...@apache.org
Subject [4/7] beam git commit: Remove '/' entirely from determining FileSystem scheme
Date Fri, 12 May 2017 21:59:23 GMT
Remove '/' entirely from determining FileSystem scheme


Project: http://git-wip-us.apache.org/repos/asf/beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/fbb0de12
Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/fbb0de12
Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/fbb0de12

Branch: refs/heads/master
Commit: fbb0de129d881b6b6a1ae37fc8d75075c9d8df86
Parents: c2a3628
Author: Dan Halperin <dhalperi@google.com>
Authored: Fri May 12 11:13:00 2017 -0700
Committer: Dan Halperin <dhalperi@google.com>
Committed: Fri May 12 14:59:10 2017 -0700

----------------------------------------------------------------------
 .../core/src/main/java/org/apache/beam/sdk/io/FileSystems.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/beam/blob/fbb0de12/sdks/java/core/src/main/java/org/apache/beam/sdk/io/FileSystems.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/io/FileSystems.java b/sdks/java/core/src/main/java/org/apache/beam/sdk/io/FileSystems.java
index 08e0def..4341fab 100644
--- a/sdks/java/core/src/main/java/org/apache/beam/sdk/io/FileSystems.java
+++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/io/FileSystems.java
@@ -66,8 +66,8 @@ import org.apache.beam.sdk.values.KV;
 public class FileSystems {
 
   public static final String DEFAULT_SCHEME = "default";
-  private static final Pattern URI_SCHEME_PATTERN = Pattern.compile(
-      "(?<scheme>[a-zA-Z][-a-zA-Z0-9+.]*):/.*");
+  private static final Pattern FILE_SCHEME_PATTERN =
+      Pattern.compile("(?<scheme>[a-zA-Z][-a-zA-Z0-9+.]*):.*");
 
   private static final AtomicReference<Map<String, FileSystem>> SCHEME_TO_FILESYSTEM
=
       new AtomicReference<Map<String, FileSystem>>(
@@ -416,7 +416,7 @@ public class FileSystems {
     // from their use in the URI spec. ('*' is not reserved).
     // Here, we just need the scheme, which is so circumscribed as to be
     // very easy to extract with a regex.
-    Matcher matcher = URI_SCHEME_PATTERN.matcher(spec);
+    Matcher matcher = FILE_SCHEME_PATTERN.matcher(spec);
 
     if (!matcher.matches()) {
       return "file";


Mime
View raw message