1111import java .util .logging .Logger ;
1212import java .util .logging .SimpleFormatter ;
1313
14- import sun .reflect .generics .reflectiveObjects .NotImplementedException ;
15-
1614/**
1715 * main.Main user-facing class. Directs all actions.
1816 */
1917public class Main {
2018
2119 //delimiters
22- public static String DELIM_SHARED = "|" ;
2320 public static String DIRECTORY_PATH_IN = "./main/sample_data/" ; //TODO allow custom path
2421 public static String DIRECTORY_PATH_CONF = "./main/config/" ; //TODO allow custom path
2522 public static String DIRECTORY_PATH_OUT = "../output/" ; //TODO allow custom path
26- private String EXPORT_FILENAME = "export" ; //name of each exported file in 'output/' (collection name)
23+ private String EXPORT_FILENAME = "export" ; //name of each exported file in 'output/' (collection name)
2724
2825 // configure logger
2926 private static Logger LOGGER = Logger .getLogger (Main .class .getName ());
3027
3128
32- // - public facing back end
33-
3429 /**
3530 * Main function responsible for taking in user input at the command line,
3631 * handling flags, and directing overall behavior of the program.
37- * @param args list of files (?)
3832 * @throws IOException
3933 * @throws ParseException
4034 */
@@ -43,7 +37,7 @@ public static void main(String[] args) throws IOException, ParseException {
4337 // - get input from the user command line - //
4438 String header = "A cataloguing tool for converting specially formatted text files containing dublin " +
4539 "core metadata into various formats\n " ;
46- String footer = "" ;
40+ String footer = "-- developed by @atla5 on behalf of RIT Wallace and BU Mugar libraries. " ;
4741 CommandLineParser posixParser = new PosixParser ();
4842 Options options = new Options ();
4943
@@ -101,13 +95,6 @@ public static void main(String[] args) throws IOException, ParseException {
10195 System .exit (0 );
10296 }
10397
104- //display help information for dublin core
105- if (commandLine .hasOption ('d' )) {
106- throw new NotImplementedException ();
107- //System.exit(0);
108- }
109-
110-
11198 /* - run the program in the absence of these tags */
11299
113100 //instantiate a new parser
@@ -141,16 +128,14 @@ public static void main(String[] args) throws IOException, ParseException {
141128
142129 int id = 1 ;
143130 //foreach file in the directory...
131+ File folder = new File (DIRECTORY_PATH_IN );
132+ File [] lsFiles = folder .listFiles ();
144133
145- String waldo = "sample-metadata-file.txt" ;
146- String sample = "1990-v123n04.txt" ;
147- String [] lsFiles = { waldo , sample };
148-
149- for (String filename : lsFiles ) {
150- String path = DIRECTORY_PATH_IN + filename ;
134+ for (File filename : lsFiles ) {
135+ String path = filename .getAbsolutePath ();
151136
152137 //todo: harvest metadata from file and use it to populate provenance information
153- p .processMetadataFile (processFileIntoStringArray (DIRECTORY_PATH_IN + filename ), id );
138+ p .processMetadataFile (processFileIntoStringArray (path ), id );
154139 id ++;
155140 }
156141 //end foreach file in directory...
0 commit comments