gov.nih.nlm.mms
Class ChecksumValidator

java.lang.Object
  extended bygov.nih.nlm.mms.ChecksumValidator

public class ChecksumValidator
extends Object

Validates byte counts and MD5s for the NLM files.

Author:
Deborah Shapiro

Field Summary
protected  List extra_files
           
protected  GlassPaneListener gpl
           
protected  List main_files
           
 
Constructor Summary
ChecksumValidator(File dir, GlassPaneListener gpl)
          Instantiates a ChecksumValidator.
 
Method Summary
static Object displayTextFile(Component parent, String title, File file, int rows, int cols)
          Displays a text file for approval or disapproval.
 boolean validate()
          Validates the user selections for directories based on file length checks and MD5 checksums.
 boolean validateByteCountsOnly()
          Validates the user selections for directories based on file length checks.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

gpl

protected GlassPaneListener gpl

main_files

protected final List main_files

extra_files

protected final List extra_files
Constructor Detail

ChecksumValidator

public ChecksumValidator(File dir,
                         GlassPaneListener gpl)
Instantiates a ChecksumValidator.

Parameters:
dir - the directory containing the NLM files
gpl - GlassPaneListener
Method Detail

validate

public boolean validate()
                 throws IOException,
                        NoSuchAlgorithmException
Validates the user selections for directories based on file length checks and MD5 checksums.

Returns:
true if validation passes false otherwise
Throws:
IOException
NoSuchAlgorithmException

validateByteCountsOnly

public boolean validateByteCountsOnly()
                               throws IOException,
                                      NoSuchAlgorithmException
Validates the user selections for directories based on file length checks.

Returns:
true if validation passes false otherwise
Throws:
IOException
NoSuchAlgorithmException

displayTextFile

public static Object displayTextFile(Component parent,
                                     String title,
                                     File file,
                                     int rows,
                                     int cols)
Displays a text file for approval or disapproval. This method opens a dialog box displaying the given File.

Parameters:
parent - the parent Component
title - title for the display
file - the message
rows - the number of rows to be displayed at one time without scrolling
cols - the number of columns to be displayed at one time without scrolling
Returns:
user selected result


Copyright ©2005