package ci.xlj.tools.nodescreator;

import ci.xlj.libs.jenkinsvisitor.JenkinsVisitor;
import ci.xlj.libs.utils.StringUtils;

public class NodesCreator {

	public static void main(String[] args) {

		if (!StringUtils.isValid(args)) {
			System.out.println("Invalid parameters. Please check and retry.");
			System.exit(-1);
		}

		JenkinsVisitor v = new JenkinsVisitor(args[0]);
		boolean isLogin = v.login(args[1], args[2]);

		if (isLogin) {
			StringBuilder b = new StringBuilder();
			b.append(args[3]).append(",").append(args[4]).append(",")
					.append(args[5]).append(",").append(args[6]).append(",")
					.append(args[7]);
			v.doPost(args[0] + "/plugin/pi-nodescreator/createNode",
					b.toString());

			if (v.getResponseStatusCode() == 200) {
				System.out.println("Node added.");
			} else {
				System.err.println("Error occured. Reasons:\n"
						+ v.getResponseContent());
			}

		}
	}
}

@@ -1,8 +1,869 @@
+/*%0D%0A * Licensed to the Apache Software Foundation (ASF) under one or more%0D%0A * contributor license agreements.  See the NOTICE file distributed with%0D%0A * this work for additional information regarding copyright ownership.%0D%0A * The ASF licenses this file to You under the Apache License, Version 2.0%0D%0A * (the %22License%22) you may not use this file except in compliance with%0D%0A * the License.  You may obtain a copy of the License at%0D%0A * %0D%0A *      http://www.apache.org/licenses/LICENSE-2.0%0D%0A * %0D%0A * Unless required by applicable law or agreed to in writing, software%0D%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0D%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0D%0A * See the License for the specific language governing permissions and%0D%0A * limitations under the License.%0D%0A */%0D%0A%0D%0A//      Contributors:      Xu Lijia%0D%0A%0D%0A
 package 
@@ -984,16 +984,52 @@
 ils;%0D%0A%0D%0A
+/**%0D%0A * @author kfzx-xulj%0D%0A *%0D%0A */%0D%0A
 public c

add license