com.altair.hwm.toolkit.utils
Class HWMFileCheckSum

java.lang.Object
  extended by com.altair.hwm.toolkit.utils.HWMFileCheckSum

public class HWMFileCheckSum
extends java.lang.Object

Title: HWMFileCheckSum Description: This utility class finds/checks the check-sum of the a given file. Company: Altair Engineering, Inc.


Constructor Summary
HWMFileCheckSum()
           
 
Method Summary
static boolean CompareCheckSumOfFiles(java.lang.String strFilePath_1, java.lang.String strFilePath_2)
          This method tries to compare the checksums of two files.
static boolean CompareFileCheckSum(java.lang.String strFilePath, long nCompareValue)
          This method tries to compare the checksum of the file requested with the .
static long GetFileCheckSum(java.lang.String strFilePath)
          This method tries to find and return the CheckSum of a file.
static void main(java.lang.String[] args)
          This method is for stand-alone testing purpose only.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HWMFileCheckSum

public HWMFileCheckSum()
Method Detail

main

public static void main(java.lang.String[] args)
This method is for stand-alone testing purpose only. It prints out the CheckSum of the requested file in args[0].

Parameters:
args[0] - :: The path of the file whose CheckSum needs to be determined.

GetFileCheckSum

public static long GetFileCheckSum(java.lang.String strFilePath)
                            throws java.io.IOException
This method tries to find and return the CheckSum of a file.

Parameters:
strFileName - :: The path of the file whose CheckSum needs to be determined.
Returns:
:: Returns the CheckSum of the file if successfull, otherwise it returns "-1" or throws an exception.
Throws:
java.io.IOException

CompareFileCheckSum

public static boolean CompareFileCheckSum(java.lang.String strFilePath,
                                          long nCompareValue)
                                   throws java.io.IOException
This method tries to compare the checksum of the file requested with the .

Parameters:
strFileName - :: The path of the file whose CheckSum needs to be determined and compared.
nCompareValue - :: The value against which to compare the file's CheckSum.
Returns:
:: Returns true if the file's checksum is equals to the compare value, otherwise returns false.
Throws:
java.io.IOException

CompareCheckSumOfFiles

public static boolean CompareCheckSumOfFiles(java.lang.String strFilePath_1,
                                             java.lang.String strFilePath_2)
                                      throws java.io.IOException
This method tries to compare the checksums of two files.

Parameters:
strFilePath_1 - :: The path of the first file whose CheckSum needs to be determined and compared.
strFilePath_2 - :: The path of the second file whose CheckSum needs to be determined and compared.
Returns:
:: Returns true if the checksum of both files is equal, otherwise returns false.
Throws:
java.io.IOException