jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncSystemProperty.java

Print this page
rev 474 : 8001235: Improve JAXP HTTP handling
Reviewed-by: lancea, skoivu


 148       {
 149         // Needs to return the version number of the spec we conform to.
 150         return new XString("1.0");
 151       }
 152       catch (Exception ex)
 153       {
 154         return new XString(result);
 155       }
 156     }
 157     else
 158       return new XString(result);
 159   }
 160 
 161   /**
 162    * Retrieve a propery bundle from a specified file
 163    *
 164    * @param file The string name of the property file.  The name
 165    * should already be fully qualified as path/filename
 166    * @param target The target property bag the file will be placed into.
 167    */
 168   public void loadPropertyFile(String file, Properties target)
 169   {
 170     try
 171     {
 172       // Use SecuritySupport class to provide priveleged access to property file
 173 
 174       InputStream is = SecuritySupport.getResourceAsStream(ObjectFactory.findClassLoader(),
 175                                               file);
 176 
 177       // get a buffered version
 178       BufferedInputStream bis = new BufferedInputStream(is);
 179 
 180       target.load(bis);  // and load up the property bag from this
 181       bis.close();  // close out after reading
 182     }
 183     catch (Exception ex)
 184     {
 185       // ex.printStackTrace();
 186       throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(ex);
 187     }
 188   }


 148       {
 149         // Needs to return the version number of the spec we conform to.
 150         return new XString("1.0");
 151       }
 152       catch (Exception ex)
 153       {
 154         return new XString(result);
 155       }
 156     }
 157     else
 158       return new XString(result);
 159   }
 160 
 161   /**
 162    * Retrieve a propery bundle from a specified file
 163    *
 164    * @param file The string name of the property file.  The name
 165    * should already be fully qualified as path/filename
 166    * @param target The target property bag the file will be placed into.
 167    */
 168   private void loadPropertyFile(String file, Properties target)
 169   {
 170     try
 171     {
 172       // Use SecuritySupport class to provide priveleged access to property file
 173 
 174       InputStream is = SecuritySupport.getResourceAsStream(ObjectFactory.findClassLoader(),
 175                                               file);
 176 
 177       // get a buffered version
 178       BufferedInputStream bis = new BufferedInputStream(is);
 179 
 180       target.load(bis);  // and load up the property bag from this
 181       bis.close();  // close out after reading
 182     }
 183     catch (Exception ex)
 184     {
 185       // ex.printStackTrace();
 186       throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(ex);
 187     }
 188   }