jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java
changeset 31497 4a6b2e733c0d
parent 27112 4bc3e4a993c7
child 33349 975138b77cff
equal deleted inserted replaced
31302:f66c18528472 31497:4a6b2e733c0d
   636                         }
   636                         }
   637 
   637 
   638                         // set preference for redirection
   638                         // set preference for redirection
   639                         followRedirects = httpInputSource.getFollowHTTPRedirects();
   639                         followRedirects = httpInputSource.getFollowHTTPRedirects();
   640                         if (!followRedirects) {
   640                         if (!followRedirects) {
   641                             setInstanceFollowRedirects(urlConnection, followRedirects);
   641                             urlConnection.setInstanceFollowRedirects(followRedirects);
   642                         }
   642                         }
   643                     }
   643                     }
   644 
   644 
   645                     stream = connect.getInputStream();
   645                     stream = connect.getInputStream();
   646 
   646 
  2189         return systemURI.toString();
  2189         return systemURI.toString();
  2190 
  2190 
  2191         // if any exception is thrown, it'll get thrown to the caller.
  2191         // if any exception is thrown, it'll get thrown to the caller.
  2192 
  2192 
  2193     } // expandSystemIdStrictOn(String,String):String
  2193     } // expandSystemIdStrictOn(String,String):String
  2194 
       
  2195     /**
       
  2196      * Attempt to set whether redirects will be followed for an <code>HttpURLConnection</code>.
       
  2197      * This may fail on earlier JDKs which do not support setting this preference.
       
  2198      */
       
  2199     public static void setInstanceFollowRedirects(HttpURLConnection urlCon, boolean followRedirects) {
       
  2200         try {
       
  2201             Method method = HttpURLConnection.class.getMethod("setInstanceFollowRedirects", new Class[] {Boolean.TYPE});
       
  2202             method.invoke(urlCon, new Object[] {followRedirects ? Boolean.TRUE : Boolean.FALSE});
       
  2203         }
       
  2204         // setInstanceFollowRedirects doesn't exist.
       
  2205         catch (Exception exc) {}
       
  2206     }
       
  2207 
       
  2208 
  2194 
  2209     /**
  2195     /**
  2210      * Helper method for expandSystemId(String,String,boolean):String
  2196      * Helper method for expandSystemId(String,String,boolean):String
  2211      */
  2197      */
  2212     private static String expandSystemIdStrictOff(String systemId, String baseSystemId)
  2198     private static String expandSystemIdStrictOff(String systemId, String baseSystemId)