Computes a 'hashvalue' for a file content.
It reads the content of a file, convert that to String and use the
String.hashCode() method.
try {
if (!file.canRead()) {
return null;
}
java.io.FileInputStream fis = new java.io.FileInputStream(file);
byte[] content = new byte[fis.available()];
fis.read(content);
fis.close();
String s = new String(content);
int hash = s.hashCode();
return Integer.toString(hash);
} catch (Exception e) {
return null;
}