Package org.exoplatform.common.http.client

Examples of org.exoplatform.common.http.client.HttpOutputStream


            conn.addBasicAuthorization(null, credentials.getName(), credentials.getValue());
         }
         HTTPResponse resp = null;
         if (entity != null)
         {
            HttpOutputStream stream = new HttpOutputStream();
            resp = conn.Post(url.getFile(), stream, headerPairs);
            byte[] buf = new byte[1024];
            int r = -1;
            while ((r = entity.read(buf)) != -1)
            {
               stream.write(buf, 0, r);
            }
            stream.close();
         }
         else
         {
            resp = conn.Post(url.getFile(), (NVPair[])null, headerPairs);
         }
View Full Code Here


            conn.addBasicAuthorization(null, credentials.getName(), credentials.getValue());
         }
         HTTPResponse resp = null;
         if (entity != null)
         {
            HttpOutputStream stream = new HttpOutputStream();
            resp = conn.Put(url.getFile(), stream, headerPairs);
            byte[] buf = new byte[1024];
            int r = -1;
            while ((r = entity.read(buf)) != -1)
            {
               stream.write(buf, 0, r);
            }
            stream.close();
         }
         else
         {
            resp = conn.Put(url.getFile(), new byte[0], headerPairs);
         }
View Full Code Here

            conn.addBasicAuthorization(null, credentials.getName(), credentials.getValue());
         }
         HTTPResponse resp = null;
         if (entity != null)
         {
            HttpOutputStream stream = new HttpOutputStream();
            resp = conn.Post(url.getFile(), stream, headerPairs);
            byte[] buf = new byte[1024];
            int r = -1;
            while ((r = entity.read(buf)) != -1)
            {
               stream.write(buf, 0, r);
            }
            stream.close();
         }
         else
         {
            resp = conn.Post(url.getFile(), (NVPair[])null, headerPairs);
         }
View Full Code Here

            conn.addBasicAuthorization(null, credentials.getName(), credentials.getValue());
         }
         HTTPResponse resp = null;
         if (entity != null)
         {
            HttpOutputStream stream = new HttpOutputStream();
            resp = conn.Put(url.getFile(), stream, headerPairs);
            byte[] buf = new byte[1024];
            int r = -1;
            while ((r = entity.read(buf)) != -1)
            {
               stream.write(buf, 0, r);
            }
            stream.close();
         }
         else
         {
            resp = conn.Put(url.getFile(), new byte[0], headerPairs);
         }
View Full Code Here

      random.nextBytes(data);

      JCRWebdavConnection conn = getConnection();
     
      // add node with blob data
      HttpOutputStream stream = new HttpOutputStream();
      HTTPResponse response = conn.addNode(nodeName, stream);
      loadStream(stream, new ByteArrayInputStream(data));
      stream.close();
      response.getStatusCode();

      // check results
      for (JCRWebdavConnection connection : getConnections())
      {
View Full Code Here

            conn.addBasicAuthorization(null, credentials.getName(), credentials.getValue());
         }
         HTTPResponse resp = null;
         if (entity != null)
         {
            HttpOutputStream stream = new HttpOutputStream();
            resp = conn.Post(url.getFile(), stream, headerPairs);
            byte[] buf = new byte[1024];
            int r = -1;
            while ((r = entity.read(buf)) != -1)
            {
               stream.write(buf, 0, r);
            }
            stream.close();
         }
         else
         {
            resp = conn.Post(url.getFile(), (NVPair[])null, headerPairs);
         }
View Full Code Here

            conn.addBasicAuthorization(null, credentials.getName(), credentials.getValue());
         }
         HTTPResponse resp = null;
         if (entity != null)
         {
            HttpOutputStream stream = new HttpOutputStream();
            resp = conn.Put(url.getFile(), stream, headerPairs);
            byte[] buf = new byte[1024];
            int r = -1;
            while ((r = entity.read(buf)) != -1)
            {
               stream.write(buf, 0, r);
            }
            stream.close();
         }
         else
         {
            resp = conn.Put(url.getFile(), new byte[0], headerPairs);
         }
View Full Code Here

TOP

Related Classes of org.exoplatform.common.http.client.HttpOutputStream

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.