Merge "Add a check in fstick that the reference file exists"

This commit is contained in:
Shawn Pearce 2012-10-25 18:01:04 -04:00 committed by Gerrit Code Review @ Eclipse.org
commit 71ac75fea3
1 changed files with 2 additions and 0 deletions

View File

@ -371,6 +371,8 @@ public static String lookup(Object l, String nameTemplate,
public static long fsTick(File lastFile) throws InterruptedException,
IOException {
long sleepTime = 1;
if (lastFile != null && !lastFile.exists())
throw new FileNotFoundException(lastFile.getPath());
File tmp = File.createTempFile("FileTreeIteratorWithTimeControl", null);
try {
long startTime = (lastFile == null) ? tmp.lastModified() : lastFile