class HMSDebuggerComponent {

    public boolean isFileDeleteable( String logArchiveName )
        throws HmsException
    {
        if ( isParameterNotNullNonEmpty( logArchiveName ) && logArchiveName.matches( HMS_ARCHIVE_REGEX ) )
        {
            try
            {
                Date parsedDate = parseDateFromFileName( logArchiveName );
                Date currentDate = new Date();
                long duration = currentDate.getTime() - parsedDate.getTime();

                long diffInMinutes = TimeUnit.MILLISECONDS.toMinutes( duration );

                if ( ( diffInMinutes - ( logClearDurationInHours * 60 ) ) > 0 )
                {
                    return true;
                }
            }
            catch ( HmsException e )
            {
                String err = "Exception occured when trying to get file duration since it was created for  file [ "
                    + logArchiveName + " ]";
                logger.error( err, e );
                throw new HmsException( err, e );
            }
            return false;
        }
        else
        {
            String err = "Cannot get Date from log Archive name [ " + logArchiveName
                + " ], because either it is null or empty. or it doesnot matches the regular expression [ "
                + HMS_ARCHIVE_REGEX + " ]";
            logger.error( err );
            throw new HmsException( err );
        }
    }

}