Skip to Main Content

Developer Community

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Temporary font files should be deleted after request is served.

user-slko2Jun 26 2023

createFont(int fontFormat, InputStream fontStream) method creates tmp files with name pattern “~+JF<<random_number>>.tmp ” for each request but deletes only on application stop.

As Security. getSecurityManager() is always null. so the font tracker is not getting created to track font files.

The below method in the font file always returns true. private static boolean hasTempPermission() {

   if (System.getSecurityManager() == null) {  
       return true;  
   }  
   File f = null;  
   boolean hasPerm = false;  
   try {  
       f = File.createTempFile("+~JT", ".tmp", null);  
       f.delete();  
       f = null;  
       hasPerm = true;  
   } catch (Throwable t) {  
       /\* inc. any kind of SecurityException \*/  
   }  
   return hasPerm;  

}

That's why create font function if condition to get font tracker not executing. if (!hasTempPermission()) {
tracker = CreatedFontTracker.getTracker();
}

Comments
Post Details
Added on Jun 26 2023
1 comment
425 views