equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
56 public final List<String> arguments = new ArrayList<String>(); |
56 public final List<String> arguments = new ArrayList<String>(); |
57 |
57 |
58 public void parseArguments(String[] args) throws BadCommandLineException { |
58 public void parseArguments(String[] args) throws BadCommandLineException { |
59 for (int i = 0 ; i <args.length; i++) { |
59 for (int i = 0 ; i <args.length; i++) { |
60 if (args[i].charAt(0)== '-') { |
60 if (args[i].charAt(0)== '-') { |
61 int j = parseArgument(args,i); |
61 i += parseArgument(args, i); |
62 if(j==0) |
|
63 throw new BadCommandLineException( |
|
64 Messages.UNRECOGNIZED_PARAMETER.format(args[i])); |
|
65 i += j; |
|
66 } else { |
62 } else { |
67 arguments.add(args[i]); |
63 arguments.add(args[i]); |
68 } |
64 } |
69 } |
65 } |
70 } |
66 } |
88 episodeFile = new File(args[++i]); |
84 episodeFile = new File(args[++i]); |
89 return 1; |
85 return 1; |
90 } |
86 } |
91 |
87 |
92 if (args[i].equals(DISABLE_XML_SECURITY)) { |
88 if (args[i].equals(DISABLE_XML_SECURITY)) { |
93 if (i == args.length - 1) |
|
94 throw new BadCommandLineException( |
|
95 (Messages.OPERAND_MISSING.format(args[i]))); |
|
96 disableXmlSecurity = true; |
89 disableXmlSecurity = true; |
97 return 1; |
90 return 0; |
98 } |
91 } |
99 |
92 |
100 if (args[i].equals("-encoding")) { |
93 if (args[i].equals("-encoding")) { |
101 if (i == args.length - 1) |
94 if (i == args.length - 1) |
102 throw new BadCommandLineException( |
95 throw new BadCommandLineException( |
112 classpath = args[++i]; |
105 classpath = args[++i]; |
113 |
106 |
114 return 1; |
107 return 1; |
115 } |
108 } |
116 |
109 |
117 return 0; |
110 throw new BadCommandLineException( |
118 |
111 Messages.UNRECOGNIZED_PARAMETER.format(args[i])); |
119 } |
112 } |
120 |
113 |
121 /** |
114 /** |
122 * @return the disableXmlSecurity |
115 * @return the disableXmlSecurity |
123 */ |
116 */ |