Package com.esri.gpt.framework.http

Examples of com.esri.gpt.framework.http.ByteArrayHandler


  throws HRConnectionException {
  try {

    HttpClientRequest cr = new HttpClientRequest();
    cr.setUrl(connectionString);
    ByteArrayHandler sh = new ByteArrayHandler();
    cr.setContentHandler(sh);
    CredentialProvider cp = getUserName().length()>0 && getUserPassword().length()>0?
      new CredentialProvider(getUserName(),getUserPassword()):
      CredentialProvider.getThreadLocalInstance();
    cr.setCredentialProvider(cp);
    cr.execute();

    return new ByteArrayInputStream(sh.getContent());

  } catch (MalformedURLException ex) {
    throw new HRInvalidUrlException("Invalid URL: " + getHostUrl(), ex);
  } catch (UnknownHostException ex) {
    throw new HRInvalidUrlException("Invalid URL: " + getHostUrl(), ex);
View Full Code Here


  try {

    HttpClientRequest cr = new HttpClientRequest();
    cr.setUrl(connectionString);
    ByteArrayHandler sh = new ByteArrayHandler();
    StringProvider cprov = new StringProvider(initString,"text/plain");
    cr.setContentHandler(sh);
    cr.setContentProvider(cprov);
    CredentialProvider cp = getUserName().length()>0 && getUserPassword().length()>0?
      new CredentialProvider(getUserName(),getUserPassword()):
      CredentialProvider.getThreadLocalInstance();
    cr.setCredentialProvider(cp);
    cr.execute();

    return new ByteArrayInputStream(sh.getContent());

  } catch (MalformedURLException ex) {
    throw new HRInvalidUrlException("Invalid URL: " + getHostUrl(), ex);
  } catch (SocketTimeoutException ex) {
    throw new HRTimeoutException(
View Full Code Here

TOP

Related Classes of com.esri.gpt.framework.http.ByteArrayHandler

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.