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

0 votes

0 answers

2288 views

ANSWER

We've fixed a number of issues related to temporary file management in Nuxeo LTS 2016 (8.10). Could you please upgrade to this version and test again? Also please include the exact scenario you use to upload files.
01/03/2017

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

01/04/2017

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

01/04/2017



Thanks for the report, I opened NXP-21428 to track this. You may follow the ticket to stay current on its status.

0 votes



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

0 votes