reformat code to meet coding guidelines
- fixed testPermanentDeleteFile sometimes failed - speed optimization - reformat code