summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenoit Lamarche <benoitlamarche@google.com>2015-06-19 11:17:31 +0200
committerBenoit Lamarche <benoitlamarche@google.com>2015-06-19 11:17:31 +0200
commit13d9519e3317057767feeb9d2ffaf49162fdb027 (patch)
tree8fec99d9777bd558a42ee261c796c4a696a4c5c2
parentb45c7ca3931f4f3cb150d9611ec78ed36678bcf7 (diff)
downloadtoolchain_jack-13d9519e3317057767feeb9d2ffaf49162fdb027.tar.gz
toolchain_jack-13d9519e3317057767feeb9d2ffaf49162fdb027.tar.bz2
toolchain_jack-13d9519e3317057767feeb9d2ffaf49162fdb027.zip
Check for source sub-file existence in CommonFilter
Files contained in source directories may contain symbolic links that have targets that don't exist. Change-Id: I7428f15415efb32f085d213b7c24f06ad515b386
-rw-r--r--jack/src/com/android/jack/incremental/CommonFilter.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/jack/src/com/android/jack/incremental/CommonFilter.java b/jack/src/com/android/jack/incremental/CommonFilter.java
index ff1c1920..7fcaf9da 100644
--- a/jack/src/com/android/jack/incremental/CommonFilter.java
+++ b/jack/src/com/android/jack/incremental/CommonFilter.java
@@ -187,11 +187,18 @@ public abstract class CommonFilter {
String path = subFile.getPath();
if (subFile.getName().endsWith(fileExt)) {
try {
- // File contained into folder are not checked by codec
- FileOrDirectory.checkPermissions(subFile, new FileLocation(subFile), Permission.READ);
+ // Let's check the files contained in the folder since they have not checked by codec
+ FileLocation location = new FileLocation(subFile);
+ // We still need to check existence, because of non-existing symbolic link targets
+ AbstractStreamFile.check(subFile, location);
+ FileOrDirectory.checkPermissions(subFile, location, Permission.READ);
fileNames.add(path);
} catch (WrongPermissionException e) {
throw new JackUserException(e);
+ } catch (NotFileException e) {
+ throw new JackUserException(e);
+ } catch (NoSuchFileException e) {
+ throw new JackUserException(e);
}
}
}