<br/>
* 2. User can located the formatted files to a specified folder.<br/>
* 3. If a file is formatted partly already. Delete all blank characters first, and then format the file.<br/>
*/
public class JsFormatter {
/* ============ constants begin =================== */
/** Usage */
public static String USAGE = \"Usage: JsFormatter -d path/directory JsFormatter -f path/filename.js\";
/** Type: Directory = \"0\"; File = \"1\" */
public interface Type {
/** Directory: 0 */
public static String DIRECTORY = \"0\";
/** File: 1 */
public static String FILE = \"1\";
}
/* ============ constants end =================== */
/**
* Entry point of the project.
*
* @param args Like \"-d /path/directory\" or \"-f /path/file.js\"
*/
public static void main(String args) {
String startMsg = \"Processing\";
String finishMsg = \"Finished.\"; [Page]
// Parameters check.
if(args.length != 2) {
System.err.println(USAGE);
return;
}
// Get the two parameters.
String type = args[0];
String path = args;
&nb