com.openindex.openestate.tool.utils
Class HashGenerator

java.lang.Object
  extended by com.openindex.openestate.tool.utils.HashGenerator

public class HashGenerator
extends Object

Hilfsprogramm zur Erzeugung von Hash-Werten aus bestehenden Dateien.
$Id: HashGenerator.java 1829 2012-10-14 14:24:52Z andy $

Author:
Andreas Rudolph

Field Summary
static String ALGORITHM_MD5
           
static String ALGORITHM_SHA
           
 
Constructor Summary
HashGenerator()
           
 
Method Summary
static void generate(File dir, FileFilter fileFilter, String algo, Map<String,String> hashMap, boolean recursive)
           
static void generate(File dir, String[] fileTypes, String algo, Map<String,String> hashMap, boolean recursive)
           
static void generate(File dir, String algo, Map<String,String> hashMap, boolean recursive)
           
static void main(String[] args)
           
static byte[] messageDigest(File file, String algo)
           
static byte[] messageDigest(InputStream in, String algo)
           
static byte[] messageDigest(String txt, String algo)
           
static String messageDigestAsString(byte[] encryptMsg)
           
static String messageDigestAsString(File file, String algo)
           
static String messageDigestAsString(String txt, String algo)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALGORITHM_SHA

public static final String ALGORITHM_SHA
See Also:
Constant Field Values

ALGORITHM_MD5

public static final String ALGORITHM_MD5
See Also:
Constant Field Values
Constructor Detail

HashGenerator

public HashGenerator()
Method Detail

messageDigest

public static byte[] messageDigest(String txt,
                                   String algo)
                            throws NoSuchAlgorithmException,
                                   IOException
Throws:
NoSuchAlgorithmException
IOException

messageDigest

public static byte[] messageDigest(File file,
                                   String algo)
                            throws NoSuchAlgorithmException,
                                   IOException
Throws:
NoSuchAlgorithmException
IOException

messageDigest

public static byte[] messageDigest(InputStream in,
                                   String algo)
                            throws NoSuchAlgorithmException,
                                   IOException
Throws:
NoSuchAlgorithmException
IOException

messageDigestAsString

public static String messageDigestAsString(File file,
                                           String algo)
                                    throws NoSuchAlgorithmException,
                                           IOException
Throws:
NoSuchAlgorithmException
IOException

messageDigestAsString

public static String messageDigestAsString(String txt,
                                           String algo)
                                    throws NoSuchAlgorithmException,
                                           IOException
Throws:
NoSuchAlgorithmException
IOException

messageDigestAsString

public static String messageDigestAsString(byte[] encryptMsg)
                                    throws NoSuchAlgorithmException,
                                           IOException
Throws:
NoSuchAlgorithmException
IOException

generate

public static void generate(File dir,
                            String algo,
                            Map<String,String> hashMap,
                            boolean recursive)
                     throws Exception
Throws:
Exception

generate

public static void generate(File dir,
                            String[] fileTypes,
                            String algo,
                            Map<String,String> hashMap,
                            boolean recursive)
                     throws Exception
Throws:
Exception

generate

public static void generate(File dir,
                            FileFilter fileFilter,
                            String algo,
                            Map<String,String> hashMap,
                            boolean recursive)
                     throws Exception
Throws:
Exception

main

public static void main(String[] args)


Copyright © 2012 OpenEstate. All Rights Reserved.