KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > tools > upgrade > common > arguments > ARG_clinstancefiles


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 package com.sun.enterprise.tools.upgrade.common.arguments;
25
26 import java.util.StringTokenizer JavaDoc;
27 import java.util.Vector JavaDoc;
28
29 /**
30  *
31  * @author Hans Hrasna
32  */

33 public class ARG_clinstancefiles extends ArgumentHandler {
34     
35     /** Creates a new instance of ARG_clinstancefiles */
36     public ARG_clinstancefiles(ParsedArgument pa) {
37         super(pa);
38         
39         System.out.print(sm.getString("enterprise.tools.upgrade.cli.clinstance_input"));
40         byte b[] = new byte[1024];
41         try {
42             int c = System.in.read(b);
43             if (c == -1) { // input stream closed, maybe by ^C
44
System.exit(1);
45             }
46             String JavaDoc clinstance = new String JavaDoc(b,0,c);
47             String JavaDoc clinstancetrim = clinstance.trim();
48             if (clinstancetrim.length() > 2) {
49                 StringTokenizer JavaDoc st = new StringTokenizer JavaDoc(clinstancetrim,",");
50                 Vector JavaDoc clinstanceList = new Vector JavaDoc();
51                 while(st.hasMoreTokens()) {
52                     clinstanceList.add(st.nextElement());
53                 }
54                 commonInfo.processClinstnceConfFiles(clinstanceList);
55             }
56         }catch(Exception JavaDoc e) {
57             _logger.log(java.util.logging.Level.SEVERE, sm.getString("enterprise.tools.upgrade.cli.unexpectedException"), e);
58         }
59     }
60     
61 }
62
Popular Tags