1 /* |
1 /* |
2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2012, 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 |
37 * |
37 * |
38 * @author Bhakti Mehta |
38 * @author Bhakti Mehta |
39 */ |
39 */ |
40 public class Options { |
40 public class Options { |
41 |
41 |
|
42 public static final String DISABLE_XML_SECURITY = "-disableXmlSecurity"; |
|
43 |
42 // honor CLASSPATH environment variable, but it will be overrided by -cp |
44 // honor CLASSPATH environment variable, but it will be overrided by -cp |
43 public String classpath = System.getenv("CLASSPATH"); |
45 public String classpath = System.getenv("CLASSPATH"); |
44 |
46 |
45 public File targetDir = null; |
47 public File targetDir = null; |
46 |
48 |
47 public File episodeFile = null; |
49 public File episodeFile = null; |
|
50 |
|
51 private boolean disableXmlSecurity = false; |
48 |
52 |
49 // encoding is not required for JDK5, 6, but JDK 7 javac is much more strict - see issue 6859289 |
53 // encoding is not required for JDK5, 6, but JDK 7 javac is much more strict - see issue 6859289 |
50 public String encoding = null; |
54 public String encoding = null; |
51 |
55 |
52 public final List<String> arguments = new ArrayList<String>(); |
56 public final List<String> arguments = new ArrayList<String>(); |
83 (Messages.OPERAND_MISSING.format(args[i]))); |
87 (Messages.OPERAND_MISSING.format(args[i]))); |
84 episodeFile = new File(args[++i]); |
88 episodeFile = new File(args[++i]); |
85 return 1; |
89 return 1; |
86 } |
90 } |
87 |
91 |
|
92 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; |
|
97 return 1; |
|
98 } |
|
99 |
88 if (args[i].equals("-encoding")) { |
100 if (args[i].equals("-encoding")) { |
89 if (i == args.length - 1) |
101 if (i == args.length - 1) |
90 throw new BadCommandLineException( |
102 throw new BadCommandLineException( |
91 (Messages.OPERAND_MISSING.format(args[i]))); |
103 (Messages.OPERAND_MISSING.format(args[i]))); |
92 encoding = args[++i]; |
104 encoding = args[++i]; |