src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/Options.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -34,10 +34,11 @@
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLClassLoader;
 import java.nio.charset.Charset;
 import java.nio.charset.IllegalCharsetNameException;
+import java.text.MessageFormat;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.StringTokenizer;
 
 /**

@@ -90,10 +91,16 @@
     /**
      * -Xnocompile
      */
     public boolean nocompile;
 
+    /**
+     * Disable secure xml processing.
+     * -XdisableSecureXmlProcessing
+     */
+    public boolean disableSecureXmlProcessing = false;
+
     public enum Target {
         V2_0, V2_1, V2_2;
 
         /**
          * Returns true if this version is equal or later than the given one.

@@ -178,17 +185,10 @@
 
     public boolean isExtensionMode() {
         return compatibilityMode == EXTENSION;
     }
 
-    /**
-     * Target direcoty when producing files.
-     */
-    public File targetDir = new File(".");
-
-
-
     public boolean debug = false;
 
     /**
      * -Xdebug - gives complete stack trace
      */

@@ -211,11 +211,14 @@
      * Remove generated files
      */
     public void removeGeneratedFiles(){
         for(File file : generatedFiles){
             if (file.getName().endsWith(".java")) {
-                file.delete();
+                boolean deleted = file.delete();
+                if (verbose && !deleted) {
+                    System.out.println(MessageFormat.format("{0} could not be deleted.", file));
+                }
             }
         }
         generatedFiles.clear();
     }
 

@@ -233,11 +236,14 @@
      */
     public void deleteGeneratedFiles() {
         synchronized (generatedFiles) {
             for (File file : generatedFiles) {
                 if (file.getName().endsWith(".java")) {
-                    file.delete();
+                    boolean deleted = file.delete();
+                    if (verbose && !deleted) {
+                        System.out.println(MessageFormat.format("{0} could not be deleted.", file));
+                    }
                 }
             }
             generatedFiles.clear();
         }
     }

@@ -346,10 +352,13 @@
                 }
             } catch (IllegalCharsetNameException icne) {
                 throw new BadCommandLineException(WscompileMessages.WSCOMPILE_UNSUPPORTED_ENCODING(encoding));
             }
             return 2;
+        } else if (args[i].equals("-XdisableSecureXmlProcessing")) {
+            disableSecureXmlProcessing= true;
+            return 1;
         }
         return 0;
     }
 
     /**