Examples of StreamingOutput


Examples of com.dotcms.repackage.javax.ws.rs.core.StreamingOutput

            if(UtilMethods.isSet( integrityDataGeneratorStatus )) {
                switch (integrityDataGeneratorStatus) {
                    case PROCESSING:
                        return Response.status(HttpStatus.SC_PROCESSING).build();
                    case FINISHED:
                        StreamingOutput output = new StreamingOutput() {
                            public void write(OutputStream output) throws IOException, WebApplicationException {
                                InputStream is = new FileInputStream(ConfigUtils.getIntegrityPath() + File.separator + requesterEndPoint.getId() + File.separator + INTEGRITY_DATA_TO_CHECK_ZIP_FILE_NAME);

                                byte[] buffer = new byte[1024];
                                int bytesRead;
                                //read from is to buffer
                                while((bytesRead = is.read(buffer)) !=-1){
                                    output.write(buffer, 0, bytesRead);
                                }
                                is.close();
                                //flush OutputStream to write any buffered data to file
                                output.flush();
                                output.close();

                            }
                        };
                        return Response.ok(output).build();
View Full Code Here

Examples of javax.ws.rs.core.StreamingOutput

      @POST
      public StreamingOutput post(@QueryParam("hello") String abs, InputStream entityStream) throws IOException
      {
         Assert.assertNull(abs);
         final InputStream is = entityStream;
         return new StreamingOutput()
         {
            public void write(OutputStream output) throws IOException
            {
               System.out.println("WITHIN STREAMING OUTPUT!!!!");
               int c;
View Full Code Here

Examples of javax.ws.rs.core.StreamingOutput

      @POST
      public StreamingOutput post(@QueryParam("hello") String abs, InputStream entityStream) throws IOException
      {
         Assert.assertNull(abs);
         final InputStream is = entityStream;
         return new StreamingOutput()
         {
            public void write(OutputStream output) throws IOException
            {
               System.out.println("WITHIN STREAMING OUTPUT!!!!");
               int c;
View Full Code Here

Examples of javax.ws.rs.core.StreamingOutput

      @GET
      @Path("test_stream.html")
      @Produces("text/html;charset=UTF-8")
      public StreamingOutput getTestStream()
      {
         return new StreamingOutput()
         {
            public void write(OutputStream outputStream) throws IOException, WebApplicationException
            {
               PrintStream writer = new PrintStream(outputStream, true, "UTF-8");
               writer.println("<html><body>Test " + (char) 353 + (char) 273 + (char) 382 + (char) 269 + "</body></html>");
View Full Code Here

Examples of javax.ws.rs.core.StreamingOutput

    @Override
    public Response exportExecutionResult(final Long executionId, final ReportExecExportFormat fmt) {
        final ReportExecExportFormat format = (fmt == null) ? ReportExecExportFormat.XML : fmt;
        final ReportExec reportExec = reportController.getAndCheckReportExecInternal(executionId);
        StreamingOutput sout = new StreamingOutput() {

            @Override
            public void write(final OutputStream os) throws IOException {
                reportController.exportExecutionResultInternal(os, reportExec, format);
            }
View Full Code Here

Examples of javax.ws.rs.core.StreamingOutput

                build();
    }

    @Override
    public Response dbExport() {
        StreamingOutput sout = new StreamingOutput() {

            @Override
            public void write(final OutputStream os) throws IOException {
                configurationController.dbExportInternal(os);
            }
View Full Code Here

Examples of javax.ws.rs.core.StreamingOutput

      final String js = JsonUtil.toJsonString(status, true);
      return Response.ok(js).type(MediaType.APPLICATION_JSON).build();
    }
    case LISTSTATUS:
    {
      final StreamingOutput streaming = getListingStream(namenode, fullpath);
      return Response.ok(streaming).type(MediaType.APPLICATION_JSON).build();
    }
    case GETCONTENTSUMMARY:
    {
      final ContentSummary contentsummary = namenode.getContentSummary(fullpath);
View Full Code Here

Examples of javax.ws.rs.core.StreamingOutput

  private static StreamingOutput getListingStream(final NameNode np,
      final String p) throws IOException {
    final DirectoryListing first = getDirectoryListing(np, p,
        HdfsFileStatus.EMPTY_NAME);

    return new StreamingOutput() {
      @Override
      public void write(final OutputStream outstream) throws IOException {
        final PrintStream out = new PrintStream(outstream);
        out.println("{\"" + FileStatus.class.getSimpleName() + "es\":{\""
            + FileStatus.class.getSimpleName() + "\":[");
View Full Code Here

Examples of javax.ws.rs.core.StreamingOutput

            if (log == null) {
                return Response.status(Response.Status.NOT_FOUND)
                               .entity("No object with id " + id).build();
            }
           
            ResponseBuilder out = Response.ok(new StreamingOutput() {
                public void write(OutputStream out) throws IOException, WebApplicationException {
                    PrintStream ps = new PrintStream(out);
                   
                    ps.println("User: " + log.getCreator());
                    ps.println("Submitted: " +
View Full Code Here

Examples of javax.ws.rs.core.StreamingOutput

    fillMetadata(parser, metadata, httpHeaders);

    logRequest(logger, info, metadata);

    return new StreamingOutput() {
      public void write(OutputStream outputStream) throws IOException, WebApplicationException {
        Writer writer = new OutputStreamWriter(outputStream, "UTF-8");

        BodyContentHandler body = new BodyContentHandler(new RichTextContentHandler(writer));
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.