code: public static String sha1(File file) {
  		InputStream is = null;
  		try {
  			is = new FileInputStream(file);
  			return sha1(is);
  		} catch (FileNotFoundException fnfe) {
  			throw new RuntimeIOException.FileNotFound(file);
  		} finally {
  			// This must be in a catch block because sha1(InputStream) may throw RuntimeIOException.
  			if (is != null) {
  				try {
  					is.close();
  				} catch (IOException ioe) {
  					log.warn("Failed to close stream for File: " + file, ioe);
  					throw new RuntimeIOException(ioe);
  				}
  			}
  		}
  	}
docs: Calculates SHA1 for the contents of the supplied InputStream.
  
  @param file File
  @return String with SHA1 calculated from the contents of <code>file</code>.
  
  @throws RuntimeIOException