+\r
+ //lorna: TODO get the classification name from the dwca zip file name\r
+ classificationName = "Scratchpad classification";//"Amaryllidaceae";\r
+\r
+ // Directory path here\r
+ String path = "C:/Users/l.morris/Downloads/dwca_scratchpads/nine";\r
+ URI sourceUrl;\r
+ //URI sourceUrl = URI.create("file:////PESIIMPORT3/vibrant/dwca/dwca_emonocots_zingiberaceae.zip");\r
+\r
+ String zipFile;\r
+ File folder = new File(path);\r
+ File[] listOfFiles = folder.listFiles(); \r
+\r
+ for (int i = 0; i < listOfFiles.length; i++) \r
+ {\r
+\r
+ if (listOfFiles[i].isFile()) \r
+ {\r
+ zipFile = listOfFiles[i].getName();\r
+\r
+ if (zipFile.endsWith(".zip"))\r
+ {\r
+ //classificationName = zipFile.split(".zip")[0];\r
+ classificationName = zipFile.split("dwca_")[1];\r
+ classificationName = classificationName.split("_")[0];\r
+ System.out.println(classificationName);\r
+ //start the Scratchpad name with uppercase.\r
+ char[] stringArray = classificationName.toCharArray();\r
+ stringArray[0] = Character.toUpperCase(stringArray[0]);\r
+ classificationName = new String(stringArray) + " (Scratchpads)";\r
+ System.out.println(classificationName);\r
+ //System.exit(999);\r
+\r
+ sourceUrl = URI.create("file:///" + path + "/" + zipFile);\r
+ System.out.println(sourceUrl);\r
+ me.doImport(sourceUrl, cdmDestination, classificationUuid, title, hbm2dll);\r
+ //System.exit(999);\r
+ }\r
+ }\r
+ }\r
+ \r
+ //System.exit(999);\r
+ //list all files in the directory\r
+ //get the URI of each\r
+ //URI sourceUrl = URI.create("file:///C:/Users/l.morris/Downloads/amaryllidaceae.zip");\r
+ \r
+ //Lorna iterate through the dwca directly getting each dwca.zip and generate a URI for each source\r
+ //me.doImport(source, cdmDestination, classificationUuid, title, hbm2dll);\r