Verify6 - /* * Assignment Submission Zip File Verifier * *...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
/** * Assignment Submission Zip File Verifier * * * Notes: * Currently this program is case sensitive except for the .zip extension * Only files of the zip format are supported. * Zip supported is implemented by using the* classes * * * * Instructions: * The names int the FILELIST String[] are to be checked for their presence in the zip_File_Name file * * Operation: * The name of the file to be tested is given as an argument to main(. .). * The program checks to see if the file exists and exits if such is not the case * If a directory of the same name as zip_File_Name exists the program exits to prevent odd behavior * The program then compares the files in zip_File_Name against those present in the FILELIST array. * If there are extraneous files they are printed. * Next, any missing files are listed as well by comparing all the files in FILELIST versus those in zip_File_Name * */ import java.util.Vector; import; import*; import java.util.Enumeration; import; public class Verify6 { //Specify required files in FILELIST public static final String[] FILELIST = { "", "", "assign6-problem3.txt" }; /* * This converts the FILELIST into a Vector for ease of use * This Vector is used from here on it and is refered to as REQUIRED_FILE_NAMES */ private static final Vector<String> REQUIRED_FILE_NAMES = new Vector<String>(); static { for( String str: FILELIST ) { REQUIRED_FILE_NAMES.add(str); } } public static void main( String[] args ) { if( args.length != 1 || !args[0].toLowerCase().endsWith(".zip") ) { printUsageAndExit(); } String zip_File_Name = args[0]; System.out.println( "\nWarning: This program does NOT verify the CORRECTNESS of the
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/03/2009 for the course CS 01-111 taught by Professor Pradiphari during the Fall '09 term at Rutgers.

Page1 / 5

Verify6 - /* * Assignment Submission Zip File Verifier * *...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online