From 13d9519e3317057767feeb9d2ffaf49162fdb027 Mon Sep 17 00:00:00 2001 From: Benoit Lamarche Date: Fri, 19 Jun 2015 11:17:31 +0200 Subject: 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 --- jack/src/com/android/jack/incremental/CommonFilter.java | 11 +++++++++-- 1 file 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 ff1c192..7fcaf9d 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); } } } -- cgit v1.1