public static String getChecksum ( String url , ResourceReaderHandler rsReader , JawrConfig jawrConfig ) throws IOException , ResourceNotFoundException { String checksum = null ; InputStream is = null ; boolean generatedBinaryResource = jawrConfig . getGeneratorRegistry ( ) . isGeneratedBinaryResource ( url ) ; try { if ( ! generatedBinaryResource ) { url = PathNormalizer . asPath ( url ) ; } is = rsReader . getResourceAsStream ( url ) ; if ( is != null ) { checksum = CheckSumUtils . getChecksum ( is , jawrConfig . getBinaryHashAlgorithm ( ) ) ; } else { throw new ResourceNotFoundException ( url ) ; } } catch ( FileNotFoundException e ) { throw new ResourceNotFoundException ( url ) ; } finally { IOUtils . close ( is ) ; } return checksum ; }
Return the checksum of the path given in parameter if the resource is not found null will b returned .