Examples of XRIResolutionException


Examples of org.openxri.resolve.exception.XRIResolutionException

      conn = IO.getConnectionToURI(uri, "GET", requestProp,
          moSocketFactory, maxFollowRedirects, false);

      if (conn.getResponseCode() != HttpURLConnection.HTTP_OK) {
        conn.disconnect();
        throw new XRIResolutionException(
            "Got bad response code from URI: " + uri.toString()
                + ", code = " + conn.getResponseCode());
      }

      // read the bytes
      int bufSize = 4096;
      byte[] buf = new byte[bufSize];
      int bufIndex = 0;
      in = conn.getInputStream();

      while (true) {
        int n = in.read();
        if (n == -1) // EOF
          break;

        if (maxBytesPerRequest >= 0 && bufIndex >= maxBytesPerRequest) {
          throw new XRIResolutionException(Status.LIMIT_EXCEEDED,
              "Maximum response size exceeded");
        }

        if (maxTotalBytes >= 0
            && state.getNumBytesReceived() + bufIndex >= maxTotalBytes) {
          throw new XRIResolutionException(Status.LIMIT_EXCEEDED,
              "Maximum total received bytes exceeded");
        }

        if (bufIndex >= bufSize) {
          byte[] newBuf = new byte[bufSize * 2];
 
View Full Code Here

Examples of org.openxri.resolve.exception.XRIResolutionException

      Element element = doc.getDocumentElement();
      log.debug("readXRDS - successfully read XML document into DOM");
      xrds = new XRDS(element, true);
      log.debug("readXRDS - successfully parsed XRDS document");
    } catch (IOException e) {
      throw new XRIResolutionException("I/O error while reading XRDS document: " + e, e);
    } catch (SAXException e) {
      throw new XRIResolutionException("Invalid XRDS document: " + e, e);
    } catch (URISyntaxException e) {
      throw new XRIResolutionException("Error parsing XRDS document (URISyntaxException): " + e, e);
    } catch (ParseException e) {
      throw new XRIResolutionException("Error parsing XRDS document (ParseException)", e);
    } finally {
      try {
        in.close();
      } catch (IOException e) {
      }
View Full Code Here

Examples of org.openxri.resolve.exception.XRIResolutionException

      conn = IO.getConnectionToURI(uri, "GET", requestProp,
          moSocketFactory, maxHttpRedirects, false);

      if (conn.getResponseCode() != HttpURLConnection.HTTP_OK) {
        conn.disconnect();
        throw new XRIResolutionException(
            "Got bad response code from URI: " + uri.toString()
                + ", code = " + conn.getResponseCode());
      }

      // read the bytes
      int bufSize = 4096;
      byte[] buf = new byte[bufSize];
      int bufIndex = 0;
      in = conn.getInputStream();

      while (true) {
        int n = in.read();
        if (n == -1) // EOF
          break;

        if (maxBytesPerRequest >= 0 && bufIndex >= maxBytesPerRequest) {
          throw new XRIResolutionException(Status.LIMIT_EXCEEDED,
              "Maximum response size exceeded");
        }

        if (maxTotalBytes >= 0
            && state.getNumBytesReceived() + bufIndex >= maxTotalBytes) {
          throw new XRIResolutionException(Status.LIMIT_EXCEEDED,
              "Maximum total received bytes exceeded");
        }

        if (bufIndex >= bufSize) {
          byte[] newBuf = new byte[bufSize * 2];
 
View Full Code Here

Examples of org.openxri.resolve.exception.XRIResolutionException

      Element element = doc.getDocumentElement();
      log.debug("readXRDS - successfully read XML document into DOM");
      xrds = new XRDS(element, true);
      log.debug("readXRDS - successfully parsed XRDS document");
    } catch (IOException e) {
      throw new XRIResolutionException("I/O error while reading XRDS document: " + e, e);
    } catch (SAXException e) {
      throw new XRIResolutionException("Invalid XRDS document: " + e, e);
    } catch (URISyntaxException e) {
      throw new XRIResolutionException("Error parsing XRDS document (URISyntaxException): " + e, e);
    } catch (ParseException e) {
      throw new XRIResolutionException("Error parsing XRDS document (ParseException)", e);
    } finally {
      try {
        in.close();
      } catch (IOException e) {
      }
View Full Code Here

Examples of org.openxri.resolve.exception.XRIResolutionException

   */
  public String getStatusCode()
  throws XRIResolutionException
  {
    if (status == null)
      throw new XRIResolutionException("No status code"); // TODO should be 200 here
    return status.getCode();
  }
View Full Code Here

Examples of org.openxri.resolve.exception.XRIResolutionException

   */
  public String getStatusCode()
  throws XRIResolutionException
  {
    if (status == null)
      throw new XRIResolutionException("No status code"); // TODO should be 200 here
    return status.getCode();
  }
View Full Code Here

Examples of org.openxri.resolve.exception.XRIResolutionException

      conn = IO.getConnectionToURI(uri, "GET", requestProp,
          moSocketFactory, maxHttpRedirects, false);
     
      if (conn.getResponseCode() != HttpURLConnection.HTTP_OK) {
        conn.disconnect();
        throw new XRIResolutionException(
            "Got bad response code from URI: " + uri.toString()
                + ", code = " + conn.getResponseCode());
      }
     
      // read the bytes
      int bufSize = 4096;
      byte[] buf = new byte[bufSize];
      int bufIndex = 0;
      in = conn.getInputStream();
     
      while (true) {
        int n = in.read();
        if (n == -1) // EOF
          break;

        if (maxBytesPerRequest >= 0 && bufIndex >= maxBytesPerRequest) {
          throw new XRIResolutionException(Status.LIMIT_EXCEEDED, "Maximum response size exceeded");
        }
       
        if (maxTotalBytes >= 0 && state.getNumBytesReceived() + bufIndex >= maxTotalBytes) {
          throw new XRIResolutionException(Status.LIMIT_EXCEEDED, "Maximum total received bytes exceeded");
        }

        if (bufIndex >= bufSize) {
          byte[] newBuf = new byte[bufSize*2];
          System.arraycopy(buf, 0, newBuf, 0, bufSize);
View Full Code Here

Examples of org.openxri.resolve.exception.XRIResolutionException

          // Populate the cache and store the Descriptors from the response
          xrds = new XRDS(element, true);
      }
      catch (IOException e)
      {
          throw new XRIResolutionException("IOException", e);
      }
      catch (SAXException e)
      {
          throw new XRIResolutionException("SAXException", e);
      }
      catch (URISyntaxException e)
      {
        throw new XRIResolutionException("URISyntaxException", e);
      } catch (ParseException e) {
        throw new XRIResolutionException("ParseException", e);
    }
      finally
      {
          try
          {
View Full Code Here

Examples of org.openxri.resolve.exception.XRIResolutionException

      conn = IO.getConnectionToURI(uri, "GET", requestProp,
          moSocketFactory, maxFollowRedirects, false);

      if (conn.getResponseCode() != HttpURLConnection.HTTP_OK) {
        conn.disconnect();
        throw new XRIResolutionException(
            "Got bad response code from URI: " + uri.toString()
                + ", code = " + conn.getResponseCode());
      }

      // read the bytes
      int bufSize = 4096;
      byte[] buf = new byte[bufSize];
      int bufIndex = 0;
      in = conn.getInputStream();

      while (true) {
        int n = in.read();
        if (n == -1) // EOF
          break;

        if (maxBytesPerRequest >= 0 && bufIndex >= maxBytesPerRequest) {
          throw new XRIResolutionException(Status.LIMIT_EXCEEDED,
              "Maximum response size exceeded");
        }

        if (maxTotalBytes >= 0
            && state.getNumBytesReceived() + bufIndex >= maxTotalBytes) {
          throw new XRIResolutionException(Status.LIMIT_EXCEEDED,
              "Maximum total received bytes exceeded");
        }

        if (bufIndex >= bufSize) {
          byte[] newBuf = new byte[bufSize * 2];
 
View Full Code Here

Examples of org.openxri.resolve.exception.XRIResolutionException

      Element element = doc.getDocumentElement();
      log.debug("readXRDS - successfully read XML document into DOM");
      xrds = new XRDS(element, true);
      log.debug("readXRDS - successfully parsed XRDS document");
    } catch (IOException e) {
      throw new XRIResolutionException("I/O error while reading XRDS document: " + e, e);
    } catch (SAXException e) {
      throw new XRIResolutionException("Invalid XRDS document: " + e, e);
    } catch (URISyntaxException e) {
      throw new XRIResolutionException("Error parsing XRDS document (URISyntaxException): " + e, e);
    } catch (ParseException e) {
      throw new XRIResolutionException("Error parsing XRDS document (ParseException)", e);
    } finally {
      try {
        in.close();
      } catch (IOException e) {
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.