aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/vfs/PathFragment.java
diff options
context:
space:
mode:
authorGravatar ccalvarin <ccalvarin@google.com>2017-09-26 11:13:33 -0400
committerGravatar John Cater <jcater@google.com>2017-09-27 09:58:47 -0400
commitfb3293c3e0fadd655bb7db691040cc9ccd6c0650 (patch)
treee566a6fe63cd6ac0db1ff11fd45751ef72bfd1e4 /src/main/java/com/google/devtools/build/lib/vfs/PathFragment.java
parentd27ed80762380c0fe9da9fc512c5d40a86acc59f (diff)
Make UnionFileSystem accept all paths Bazel can throw at it.
Instead of relying on a character-by-character StringTrie, segment paths based on PathFragments. This means UnionFS can accept any path that Bazel stores internally, removing the ASCII limitations. This also means removing the ability to have a filesystem bound for sub-PathFragments, /foo/barbar, /foo/barqux could have the same filesystem bound at /foo/bar. This feature was tested for when a use case was envisioned, but it was never used, so removing it is safe. RELNOTES: None. PiperOrigin-RevId: 170054656
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/vfs/PathFragment.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/vfs/PathFragment.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/vfs/PathFragment.java b/src/main/java/com/google/devtools/build/lib/vfs/PathFragment.java
index cc9aa199d3..c47a5f7122 100644
--- a/src/main/java/com/google/devtools/build/lib/vfs/PathFragment.java
+++ b/src/main/java/com/google/devtools/build/lib/vfs/PathFragment.java
@@ -58,6 +58,9 @@ public abstract class PathFragment implements Comparable<PathFragment>, Serializ
/** An empty path fragment. */
public static final PathFragment EMPTY_FRAGMENT = create("");
+ /** The path fragment representing the root directory. */
+ public static final PathFragment ROOT_FRAGMENT = create(ROOT_DIR);
+
/**
* A helper object for manipulating the various internal {@link PathFragment} implementations.
*