public static void main(String[] args){
		if (args.length != 2){
			throw new RuntimeException("invalid number of arguments. Must receive two argument specifying working directory and server hostname!!!");
		}
		workingDir = args[0].replace("\\", "/");
		if (workingDir.charAt(workingDir.length() - 1) != '/')
			workingDir += '/';
		new File(workingDir).mkdirs();
		btHost = args[1];
		System.out.println(btHost);
		
		siteUID = loadSiteUID();
		
		AirNowParser parser = new AirNowParser(workingDir);
		
		System.out.println("getting file list!");
		String[] fileList = new File(workingDir + "data/").list(new datFilter());
		int count = 0;
		AirNowData data = new AirNowData();
		System.out.println(fileList.length + " files to parse!");
		
		LinkedList<String> filesBeingUploaded = new LinkedList<String>();
		
		new File(workingDir + "data/imported/").mkdirs();
		
		for (String fileName : fileList){
			System.out.println("parsing " + fileName);
			try {
				FileInputStream fis = new FileInputStream(workingDir + "data/" + fileName);
				AirNowData newData = parser.parseData(fis);
				fis.close();
				if (newData != null){
					filesBeingUploaded.add(fileName);
					System.out.println("Parse success");
					count++;
					
					if (count == MAX_FILES_PER_UPLOAD){
						count = 0;
						if (uploadData(data)){
							moveFiles(filesBeingUploaded);
							filesBeingUploaded.clear();
							data = newData;
						}
						else{
							data.merge(newData);
						}
					}
					else{
						data.merge(newData);
					}
				}
				else{
					System.out.println("Parse failed!");
				}		
				
			} catch (IOException e) {
				System.out.println("Parse failed");
			}	
		}
		if (uploadData(data)){
			moveFiles(filesBeingUploaded);
		}
		System.out.println("Finished! Exiting!");
		System.exit(0); //sometimes doesn't like to end the process on return?
	}