+ if (!tempFile.exists()) {
+ return false;
+ }
+ // File exists, so check if it was created recently
+ final long fileAge = System.currentTimeMillis() - tempFile.lastModified();
+ return fileAge < 1000000L; // overwrite if the temp file is still there after 1000s