protected Class < ? > getNIOFileResourceClass ( ) { final String method = "getNIOFileResourceClass" ; //$NON-NLS-1$ if ( tryNIO && nioFileResourceClass == null ) { try { nioFileResourceClass = classLoader . loadClass ( "com.ibm.jaggr.core.impl.resource.NIOFileResource" ) ; //$NON-NLS-1$ } catch ( ClassNotFoundException e ) { tryNIO = false ; // Don't try this again. if ( log . isLoggable ( Level . WARNING ) ) { log . logp ( Level . WARNING , CLAZZ , method , e . getMessage ( ) ) ; log . logp ( Level . WARNING , CLAZZ , method , WARN_MESSAGE ) ; } } catch ( UnsupportedClassVersionError e ) { tryNIO = false ; // Don't try this again. if ( log . isLoggable ( Level . WARNING ) ) { log . logp ( Level . WARNING , CLAZZ , method , e . getMessage ( ) ) ; log . logp ( Level . WARNING , CLAZZ , method , WARN_MESSAGE ) ; } } } return nioFileResourceClass ; }
Utility method for acquiring a reference to the NIOFileResource class without asking the class loader every single time after we know it s not there .