AESBinaryManager does not delete temporary files
I am using AESBinaryManager as binary encryption which works well, but no temporary files are deleted because its father LocalBinaryManager set as protected the binaries path. Considering that tmp folder is created under this folder, Framework.trackFile can not delete the file and a warning is done. Below the warning message: WARN log: Protect file filename from deletion : check usage of Framework.trackFile
What am I doing wrong? is it a known error?
P.s. The files will be deleted on closing cause close method of LocalBinaryManager
LocalBinaryManager
// be sure FileTracker won't steal our files !
FileEventTracker.registerProtectedPath(base.getAbsolutePath());
FileEventTracker
protected boolean isFileProtected(File fileToDelete) {
for (String path : protectedPaths) {
// do not delete files under the protected directories
if (fileToDelete.getPath().startsWith(path)) {
log.warn("Protect file " + fileToDelete.getPath()
+ " from deletion : check usage of Framework.trackFile");
return true;
}
}
return false;
}
ty Antonio
Thanks for the report, I opened NXP-21428 to track this. You may follow the ticket to stay current on its status.
Hi Florent, First of All, thank you for your answer. I took a look at new code (trunk) and it seems not changed for this. In fact, the AESBinaryManager, also in the new code, uses the tmpDir initialized by LocalBinaryManager with value “tmp” in “binaries” that is a protected path. Therefore, the condition
if (fileToDelete.getPath().startsWith(path)) {
will be true and also temporary files will be protected.
Antonio
will be true and also temporary files will be protected.
Antonio
will be true and also temporary files will be protected.
Antonio