< prev index next >

src/java.xml.ws/share/classes/javax/xml/ws/spi/FactoryFinder.java

Print this page

        

@@ -25,12 +25,10 @@
 
 package javax.xml.ws.spi;
 
 import java.io.*;
 
-import java.nio.file.Files;
-import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.Properties;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 import javax.xml.ws.WebServiceException;

@@ -113,31 +111,33 @@
     }
 
     private static Object fromJDKProperties(String factoryId,
                                             String fallbackClassName,
                                             ClassLoader classLoader) {
-        Path path = null;
+        File f = null;
         try {
             String JAVA_HOME = System.getProperty("java.home");
-            path = Paths.get(JAVA_HOME, "conf", "jaxws.properties");
+            f = Paths.get(JAVA_HOME, "conf", "jaxws.properties").toFile();
 
             // to ensure backwards compatibility
-            if (!Files.exists(path)) {
-                path = Paths.get(JAVA_HOME, "lib", "jaxws.properties");
+            if (!f.exists()) {
+                f = Paths.get(JAVA_HOME, "lib", "jaxws.properties").toFile();
             }
 
-            if (!Files.exists(path)) {
+            if (f.exists()) {
                 Properties props = new Properties();
-                try (InputStream inStream = Files.newInputStream(path)) {
+                try (InputStream inStream = new FileInputStream(f)) {
                     props.load(inStream);
                 }
                 String factoryClassName = props.getProperty(factoryId);
                 return ServiceLoaderUtil.newInstance(factoryClassName,
                         fallbackClassName, classLoader, EXCEPTION_HANDLER);
             }
         } catch (Exception ignored) {
-            logger.log(Level.SEVERE, "Error reading JAX-WS configuration from ["  + path +
+            String absolutePath = f != null ? f.getAbsolutePath() : "null";
+            logger.log(Level.SEVERE, "Error reading JAX-WS configuration from ["  +
+                    absolutePath +
                     "] file. Check it is accessible and has correct format.", ignored);
         }
         return null;
     }
 
< prev index next >