private static String generateCleanFileName(String path) {
	    String fn = path;
	    int i = fn.lastIndexOf(".");
	    if (i > 0 && i < fn.length())
	    		fn = fn.substring(0, i);
	    i = path.lastIndexOf(File.separatorChar);
	    if (i > 0 && i < fn.length())
	    		fn = fn.substring(i, fn.length());
	    	fn = fn.replaceAll(" ", "_");
	    	fn = fn.replaceAll("[^A-Za-z0-9_]", "");
		return fn;
	}