Skip to content
z-ziyang edited this page Sep 18, 2016 · 3 revisions

package com.mithra.dialTest;

import java.io.File;

import com.mithra.dialTest.common.Constant;

/** *

  • @author z81019502

*/ public class TemplateDialTestMain {

public static void main(String[] args) {
	System.out.println("Start !!");
	
	if (args.length == 0) {
		System.out.println("The request path is not null!");
		System.exit(0);
	}
	String url = args[0];

	if (url.equals("")) {
		System.out.println("The request path is not null!");
		System.exit(0);
	}
	if (args.length > 1) {
		String generatePath = args[1];
		if (!generatePath.equals("")) {
			Constant.TEMPLATE_BASE_PATH = generatePath;
		}
	}

	initDir();
	GenerateYamlFactory generator = new GenerateYamlFactory(url);
	generator.generateYamlTempl();
	System.out.println("Done !!");
}

public static void initDir() {
	File reseponseFile = new File(Constant.RESPONSE_BASE_PATH);
	if (!reseponseFile.exists() && !reseponseFile.isDirectory()) {
		reseponseFile.mkdirs();
	}

	File bodyFile = new File(Constant.TEMPLATE_BODY_BASE_PATH);
	if (!bodyFile.exists() && !bodyFile.isDirectory()) {
		bodyFile.mkdirs();
	}
}

}

Clone this wiki locally