Examples of HttpInputStream


Examples of org.fcrepo.common.http.HttpInputStream

    }
*/

    @Test
    public void testGetDisseminationUserInput() throws Exception {
        HttpInputStream his =
                s_client.get("/get/demo:29/demo:27/convertImage?convertTo=gif", true);
        String actual = his.getContentType();
        his.close();
        assertEquals("image/gif", actual);
    }
View Full Code Here

Examples of org.fcrepo.common.http.HttpInputStream

    @Test
    public void testGetChainedDissemination() throws Exception {
        // test chained dissemination using local services
        // The object contains an E datastream that is a dissemination of the local SAXON service.
        // This datastream is input to another dissemination that uses the local FOP service.
        HttpInputStream his = client.get("/get/demo:26/demo:19/getPDF", false);
        String contentType = his.getContentType();
        his.close();
        assertEquals("application/pdf", contentType);
    }
View Full Code Here

Examples of org.parosproxy.paros.network.HttpInputStream

        boolean isSecure = true;
        HttpRequestHeader firstHeader = null;

        inSocket = HttpSender.getSSLConnector().createTunnelServerSocket(inSocket);
       
        httpIn = new HttpInputStream(inSocket);
        httpOut = new HttpOutputStream(inSocket.getOutputStream());
       
        firstHeader = httpIn.readRequestHeader(isSecure);
        processHttp(firstHeader, isSecure);
    }
View Full Code Here

Examples of org.parosproxy.paros.network.HttpInputStream

        proxyThreadList.add(thread);
    boolean isSecure = this instanceof ProxyThreadSSL;
    HttpRequestHeader firstHeader = null;
   
    try {
      httpIn = new HttpInputStream(inSocket);
      httpOut = new HttpOutputStream(inSocket.getOutputStream());
     
      firstHeader = httpIn.readRequestHeader(isSecure);
           
      if (firstHeader.getMethod().equalsIgnoreCase(HttpRequestHeader.CONNECT)) {
View Full Code Here

Examples of org.parosproxy.paros.network.HttpInputStream

        boolean isSecure = true;
        HttpRequestHeader firstHeader = null;

        inSocket = HttpSender.getSSLConnector().createTunnelServerSocket(inSocket);
       
        httpIn = new HttpInputStream(inSocket);
        httpOut = new HttpOutputStream(inSocket.getOutputStream());
       
        firstHeader = httpIn.readRequestHeader(isSecure);
        processHttp(firstHeader, isSecure);
    }
View Full Code Here

Examples of org.parosproxy.paros.network.HttpInputStream

        proxyThreadList.add(thread);
    boolean isSecure = this instanceof ProxyThreadSSL;
    HttpRequestHeader firstHeader = null;
   
    try {
      httpIn = new HttpInputStream(inSocket);
      httpOut = new HttpOutputStream(inSocket.getOutputStream());
     
      firstHeader = httpIn.readRequestHeader(isSecure);
           
      if (firstHeader.getMethod().equalsIgnoreCase(HttpRequestHeader.CONNECT)) {
View Full Code Here

Examples of sunlabs.brazil.util.http.HttpInputStream

    sh[2] = command;
    process = Runtime.getRuntime().exec(sh);
      } else {
    process = Runtime.getRuntime().exec(command);
      }
      HttpInputStream in = new HttpInputStream(process.getInputStream());
      HttpInputStream err = new HttpInputStream(process.getErrorStream());

      // If we have stdin data in a property, send it to the process

      String stdin = hr.get("stdin");
      if (stdin != null) {
    OutputStream out = process.getOutputStream();
    out.write(stdin.getBytes());
    out.close();
      }

      // Read the streams into the proper properties

      ByteArrayOutputStream buff = new ByteArrayOutputStream();
      in.copyTo(buff);
      in.close();
      String enc = null;
      if (encoding != null) {
         enc = buff.toString(encoding);
      } else {
         enc = buff.toString();
      }
      hr.request.props.put(prepend + "stdout", enc);
      buff.reset();

      err.copyTo(buff);
      err.close();
      if (encoding != null) {
         enc = buff.toString(encoding);
      } else {
         enc = buff.toString();
      }
View Full Code Here

Examples of sunlabs.brazil.util.http.HttpInputStream

      OutputStream out = process.getOutputStream();
      out.write(content);
      out.close();

      HttpInputStream in = new HttpInputStream(process.getInputStream());
      HttpInputStream err = new HttpInputStream(process.getErrorStream());

      ByteArrayOutputStream inB = new ByteArrayOutputStream();

      in.copyTo(inB);
      if (inB.size() > 0) {
          content=inB.toByteArray();
          String newType = request.props.getProperty(prefix + "newType");
    if (newType != null) {
        newType = Format.subst(request.props, newType);
        request.log(Server.LOG_DIAGNOSTIC, prefix +
          "Changing content type to: " + newType);
        headers.put("content-type", newType);
    }
      } else {
    request.log(Server.LOG_DIAGNOSTIC, prefix +
      "No content from filter");
      }
      in.close();
      inB.close();

      ByteArrayOutputStream errB = new ByteArrayOutputStream();
      err.copyTo(errB);
      if (errB.size() > 0) {
    request.log(Server.LOG_DIAGNOSTIC, prefix +
       "Error result: " + errB);
    request.props.put(prefix + "error", errB.toString());
      }
      err.close();
      errB.close();

      process.waitFor();
  } catch (Exception e) {
      request.log(Server.LOG_DIAGNOSTIC, prefix +
View Full Code Here

Examples of sunlabs.brazil.util.http.HttpInputStream

    public Regexp
    loadUrls(Properties props, String prefix, String file)
    {
  StringBuffer sb = new StringBuffer();
  try {
      HttpInputStream in = new HttpInputStream(
        ResourceHandler.getResourceStream(props, prefix, file));

      String line;
      while ((line = in.readLine()) != null) {
    line = line.trim();
    if ((line.length() == 0) || (line.charAt(0) == '#')) {
        continue;
    }
    sb.append(line).append('|');
View Full Code Here

Examples of sunlabs.brazil.util.http.HttpInputStream

      PrintStream out = new PrintStream(sock.getOutputStream());
      out.println(host + " " + port);
      out.flush();
      out = null;

      HttpInputStream in = new HttpInputStream(sock.getInputStream());
      while (true) {
    String line = in.readLine();
/*System.out.println(line);*/
    if ((line == null) || line.endsWith("refused")) {
        throw new ConnectException(host + ":" + port);
    }
    if (line.startsWith("connected to")) {
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.