Package org.apache.xerces.util

Examples of org.apache.xerces.util.HTTPInputSource


                    boolean followRedirects = true;
                   
                    // setup URLConnection if we have an HTTPInputSource
                    if (xmlInputSource instanceof HTTPInputSource) {
                        final HttpURLConnection urlConnection = (HttpURLConnection) connect;
                        final HTTPInputSource httpInputSource = (HTTPInputSource) xmlInputSource;
                       
                        // set request properties
                        Iterator propIter = httpInputSource.getHTTPRequestProperties();
                        while (propIter.hasNext()) {
                            Map.Entry entry = (Map.Entry) propIter.next();
                            urlConnection.setRequestProperty((String) entry.getKey(), (String) entry.getValue());
                        }
                       
                        // set preference for redirection
                        followRedirects = httpInputSource.getFollowHTTPRedirects();
                        if (!followRedirects) {
                            setInstanceFollowRedirects(urlConnection, followRedirects);
                        }
                    }
                   
View Full Code Here


                URLConnection urlCon = url.openConnection();
               
                // If this is an HTTP connection attach any request properties to the request.
                if (urlCon instanceof HttpURLConnection && source instanceof HTTPInputSource) {
                    final HttpURLConnection urlConnection = (HttpURLConnection) urlCon;
                    final HTTPInputSource httpInputSource = (HTTPInputSource) source;
                   
                    // set request properties
                    Iterator propIter = httpInputSource.getHTTPRequestProperties();
                    while (propIter.hasNext()) {
                        Map.Entry entry = (Map.Entry) propIter.next();
                        urlConnection.setRequestProperty((String) entry.getKey(), (String) entry.getValue());
                    }
                   
                    // set preference for redirection
                    boolean followRedirects = httpInputSource.getFollowHTTPRedirects();
                    if (!followRedirects) {
                        XMLEntityManager.setInstanceFollowRedirects(urlConnection, followRedirects);
                    }
                }
               
View Full Code Here

    return true;
  }

  private XMLInputSource createInputSource(String paramString1, String paramString2, String paramString3, String paramString4, String paramString5)
  {
    HTTPInputSource localHTTPInputSource = new HTTPInputSource(paramString1, paramString2, paramString3);
    if ((paramString4 != null) && (paramString4.length() > 0))
      localHTTPInputSource.setHTTPRequestProperty("Accept", paramString4);
    if ((paramString5 != null) && (paramString5.length() > 0))
      localHTTPInputSource.setHTTPRequestProperty("Accept-Language", paramString5);
    return localHTTPInputSource;
  }
View Full Code Here

      localObject3 = new URL(str1);
      localObject4 = ((URL)localObject3).openConnection();
      if (((localObject4 instanceof HttpURLConnection)) && ((paramXMLInputSource instanceof HTTPInputSource)))
      {
        localObject5 = (HttpURLConnection)localObject4;
        HTTPInputSource localHTTPInputSource = (HTTPInputSource)paramXMLInputSource;
        localObject6 = localHTTPInputSource.getHTTPRequestProperties();
        while (((Iterator)localObject6).hasNext())
        {
          Map.Entry localEntry = (Map.Entry)((Iterator)localObject6).next();
          ((URLConnection)localObject5).setRequestProperty((String)localEntry.getKey(), (String)localEntry.getValue());
        }
        boolean bool = localHTTPInputSource.getFollowHTTPRedirects();
        if (!bool)
          XMLEntityManager.setInstanceFollowRedirects((HttpURLConnection)localObject5, bool);
      }
      localObject1 = new BufferedInputStream(((URLConnection)localObject4).getInputStream());
      Object localObject5 = ((URLConnection)localObject4).getContentType();
View Full Code Here

          boolean bool2 = true;
          Object localObject7;
          if ((paramXMLInputSource instanceof HTTPInputSource))
          {
            localObject7 = (HttpURLConnection)localURLConnection;
            HTTPInputSource localHTTPInputSource = (HTTPInputSource)paramXMLInputSource;
            Iterator localIterator = localHTTPInputSource.getHTTPRequestProperties();
            while (localIterator.hasNext())
            {
              Map.Entry localEntry = (Map.Entry)localIterator.next();
              ((URLConnection)localObject7).setRequestProperty((String)localEntry.getKey(), (String)localEntry.getValue());
            }
            bool2 = localHTTPInputSource.getFollowHTTPRedirects();
            if (!bool2)
              setInstanceFollowRedirects((HttpURLConnection)localObject7, bool2);
          }
          localObject3 = localURLConnection.getInputStream();
          if (bool2)
View Full Code Here

TOP

Related Classes of org.apache.xerces.util.HTTPInputSource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.