Package org.jboss.resteasy.util

Examples of org.jboss.resteasy.util.CommitHeaderOutputStream


            connection.addRequestProperty(CONTENT_TYPE, type);
         }
         try
         {
            OutputStream os = connection.getOutputStream();
            CommitHeaderOutputStream commit = new CommitHeaderOutputStream(os,
                    new CommitHeaderOutputStream.CommitCallback()
                    {
                       @Override
                       public void commit()
                       {
View Full Code Here


               if (committed) return;
               committed = true;
               commitHeaders(theResponse);
            }
         };
         OutputStream os = new CommitHeaderOutputStream(response.getOutputStream(), callback);

         long size = writer.getSize(ent, type, generic, annotations, contentType);
         if (size > -1) response.getOutputHeaders().putSingle(HttpHeaderNames.CONTENT_LENGTH, String.valueOf(size));

View Full Code Here

            if (committed) return;
            committed = true;
            commitHeaders(built, response);
         }
      };
      OutputStream os = new CommitHeaderOutputStream(response.getOutputStream(), callback);

      WriterInterceptor[] writerInterceptors = null;
      if (method != null)
      {
         writerInterceptors = method.getWriterInterceptors();
View Full Code Here

            String type = request.getBodyContentType().toString();
            connection.addRequestProperty(CONTENT_TYPE, type);
         }
         try
         {
            final CommitHeaderOutputStream commit = new CommitHeaderOutputStream();
            CommitHeaderOutputStream.CommitCallback callback = new CommitHeaderOutputStream.CommitCallback()
            {
               @Override
               public void commit()
               {
                  connection.setDoOutput(true);
                  commitHeaders(request, connection);
                  OutputStream os = null;
                  try
                  {
                     os = connection.getOutputStream();
                  }
                  catch (IOException e)
                  {
                     throw new RuntimeException(e);
                  }
                  commit.setDelegate(os);

               }
            };
            commit.setHeaders(callback);
            try
            {
               request.writeRequestBody(request.getHeadersAsObjects(), commit);
            }
            finally
            {
               commit.getDelegate().flush();
               commit.getDelegate().close();
            }
         }
         catch (IOException e)
         {
            throw new RuntimeException(e);
View Full Code Here

TOP

Related Classes of org.jboss.resteasy.util.CommitHeaderOutputStream

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.