Examples of ByteArrayHandler


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

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

  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

Examples of org.jboss.virtual.plugins.context.vfs.ByteArrayHandler

      if (bytes == null)
         throw new IllegalArgumentException("Null bytes");
      if (name == null)
         throw new IllegalArgumentException("Null name");

      ByteArrayHandler handler;
      try
      {
         handler = new ByteArrayHandler(directory.getVFSContext(), directory, name, bytes);
      }
      catch (IOException e)
      {
         throw new RuntimeException(e);
      }
      directory.addChild(handler);
      return handler.getVirtualFile();
   }
View Full Code Here

Examples of org.jboss.virtual.plugins.context.vfs.ByteArrayHandler

      if (bytes == null)
         throw new IllegalArgumentException("Null bytes");
      if (name == null)
         throw new IllegalArgumentException("Null name");

      ByteArrayHandler handler;
      try
      {
         handler = new ByteArrayHandler(directory.getVFSContext(), directory, name, bytes);
      }
      catch (IOException e)
      {
         throw new RuntimeException(e);
      }
      directory.addChild(handler);
      return handler.getVirtualFile();
   }
View Full Code Here

Examples of org.jboss.virtual.plugins.context.vfs.ByteArrayHandler

      if (bytes == null)
         throw new IllegalArgumentException("Null bytes");
      if (name == null)
         throw new IllegalArgumentException("Null name");

      ByteArrayHandler handler;
      try
      {
         handler = new ByteArrayHandler(directory.getVFSContext(), directory, name, bytes);
      }
      catch (IOException e)
      {
         throw new RuntimeException(e);
      }
      directory.addChild(handler);
      return handler.getVirtualFile();
   }
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.