summaryrefslogtreecommitdiffstats
path: root/sched/src/com
diff options
context:
space:
mode:
authorBenoit Lamarche <benoitlamarche@google.com>2015-01-13 17:02:35 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-01-13 17:02:35 +0000
commite868e2bb5b075fd8e68992508e39995047ce13a1 (patch)
treeed692462a93e4346dc2ed40d7ca8c5c87ca919c3 /sched/src/com
parent23adbde780d761462b7260b0937bead67da69cad (diff)
parenteb7a8bedb44312ddc04ec766d82e77e986dc35b7 (diff)
downloadtoolchain_jack-e868e2bb5b075fd8e68992508e39995047ce13a1.tar.gz
toolchain_jack-e868e2bb5b075fd8e68992508e39995047ce13a1.tar.bz2
toolchain_jack-e868e2bb5b075fd8e68992508e39995047ce13a1.zip
Merge "Add relative VPath support to MessageDigestInputVFS" into ub-jack
Diffstat (limited to 'sched/src/com')
-rw-r--r--sched/src/com/android/sched/vfs/MessageDigestInputVFS.java16
1 files changed, 11 insertions, 5 deletions
diff --git a/sched/src/com/android/sched/vfs/MessageDigestInputVFS.java b/sched/src/com/android/sched/vfs/MessageDigestInputVFS.java
index c844629b..f0591bd3 100644
--- a/sched/src/com/android/sched/vfs/MessageDigestInputVFS.java
+++ b/sched/src/com/android/sched/vfs/MessageDigestInputVFS.java
@@ -102,9 +102,12 @@ public class MessageDigestInputVFS extends MessageDigestVFS implements InputVFS
public class MessageDigestInputVDir implements InputVDir {
@Nonnull
private final InputVDir dir;
+ @Nonnull
+ private final VPath pathToRoot;
- private MessageDigestInputVDir (@Nonnull InputVDir dir) {
+ private MessageDigestInputVDir (@Nonnull InputVDir dir, @Nonnull VPath pathToRoot) {
this.dir = dir;
+ this.pathToRoot = pathToRoot;
}
@Override
@@ -134,15 +137,18 @@ public class MessageDigestInputVFS extends MessageDigestVFS implements InputVFS
@Nonnull
public MessageDigestInputVDir getInputVDir(@Nonnull VPath path)
throws NotFileOrDirectoryException, NoSuchFileException {
- return new MessageDigestInputVDir(dir.getInputVDir(path));
+ VPath newPathToRoot = pathToRoot.clone();
+ newPathToRoot.appendPath(path);
+ return new MessageDigestInputVDir(dir.getInputVDir(path), newPathToRoot);
}
@Override
@Nonnull
public MessageDigestInputVFile getInputVFile(@Nonnull VPath path)
throws NotFileOrDirectoryException, NoSuchFileException {
- // XXX Add relative VPath support
- return new MessageDigestInputVFile(dir.getInputVFile(path), digests.get(path));
+ VPath filePathToRoot = pathToRoot.clone();
+ filePathToRoot.appendPath(path);
+ return new MessageDigestInputVFile(dir.getInputVFile(path), digests.get(filePathToRoot));
}
@Override
@@ -153,7 +159,7 @@ public class MessageDigestInputVFS extends MessageDigestVFS implements InputVFS
}
public MessageDigestInputVFS(@Nonnull InputVFS vfs) {
- this.root = new MessageDigestInputVDir(vfs.getRootInputVDir());
+ this.root = new MessageDigestInputVDir(vfs.getRootInputVDir(), VPath.ROOT);
this.vfs = vfs;
// Reading digest directory is best effort