public void deleteDiskCacheFiles ( ) { final String methodName = "deleteDiskCacheFiles()" ; final File f = new File ( swapDirPath ) ; final CacheOnDisk cod = this ; traceDebug ( methodName , "cacheName=" + this . cacheName ) ; AccessController . doPrivileged ( new PrivilegedAction ( ) { public Object run ( ) { // delete files File fl [ ] = f . listFiles ( ) ; for ( int i = 0 ; i < fl . length ; i ++ ) { try { fl [ i ] . delete ( ) ; } catch ( Throwable t ) { com . ibm . ws . ffdc . FFDCFilter . processException ( t , "com.ibm.ws.cache.CacheOnDisk.deleteDiskCacheFiles" , "908" , cod ) ; traceDebug ( methodName , "cacheName=" + cod . cacheName + "\nException: " + ExceptionUtility . getStackTrace ( t ) ) ; } } return null ; } } ) ; }
Call this method to delete all disk cache files per cache instance .