mil.dod.th.ose.logging/src/mil/dod/th/ose/logging/LogWriter.java
private void checkNumberOfLogFiles()
    {
        final int numberOfLogFiles = getAllLogFiles().length; 
        
        for (int timesToDelete = numberOfLogFiles - m_LogMaxFileCount; timesToDelete >= 1; timesToDelete--)
        {
            final File[] existingLogFiles = getAllLogFiles();
            File logToBeDeleted = existingLogFiles[0];
            
            for (int i = 1; i < existingLogFiles.length; i++)
            {
                final File logBeingChecked = existingLogFiles[i];
                
                logToBeDeleted = 
                        logBeingChecked.lastModified() > logToBeDeleted.lastModified() 
                        ? logToBeDeleted : logBeingChecked;
            }
            
            logToBeDeleted.delete();
        }
    }
/**
     * Method that checks the number of log files that are currently existing and determines whether or not the total 
     * number of files is greater than the maximum allowed. If the total is greater than the maximum, then the oldest 
     * log files in the designated log directory are deleted.
     */
Method that checks the number of log files that are currently existing and determines whether or not the total
number of files is greater than the maximum allowed. If the total is greater than the maximum, then the oldest
log files in the designated log directory are deleted.
Method that checks the number of log files that are currently existing and determines whether or not the total number of files is greater than the maximum allowed . If the total is greater than the maximum then the oldest log files in the designated log directory are deleted .
private void checkNumberOfLogFiles()
    {
        final int numberOfLogFiles = getAllLogFiles().length; 
        for (int timesToDelete = numberOfLogFiles - m_LogMaxFileCount; timesToDelete >= 1; timesToDelete--)
        {
            final File[] existingLogFiles = getAllLogFiles();
            File logToBeDeleted = existingLogFiles[0];
            for (int i = 1; i < existingLogFiles.length; i++)
            {
                final File logBeingChecked = existingLogFiles[i];
                logToBeDeleted = 
                        logBeingChecked.lastModified() > logToBeDeleted.lastModified() 
                        ? logToBeDeleted : logBeingChecked;
            }
            logToBeDeleted.delete();
        }
    }
private void checkNumberOfLogFiles ( ) { final int numberOfLogFiles = getAllLogFiles ( ) . length ; for ( int timesToDelete = numberOfLogFiles - m_LogMaxFileCount ; timesToDelete >= 1 ; timesToDelete -- ) { final File [ ] existingLogFiles = getAllLogFiles ( ) ; File logToBeDeleted = existingLogFiles [ 0 ] ; for ( int i = 1 ; i < existingLogFiles . length ; i ++ ) { final File logBeingChecked = existingLogFiles [ i ] ; logToBeDeleted = logBeingChecked . lastModified ( ) > logToBeDeleted . lastModified ( ) ? logToBeDeleted : logBeingChecked ; } logToBeDeleted . delete ( ) ; } }
Method that checks the number of log files that are currently existing and determines whether or not the total
 number of files is greater than the maximum allowed.
Method that checks the number of log files that are currently existing and determines whether or not the total number of files is greater than the maximum allowed .