Package javax.ws.rs.core

Examples of javax.ws.rs.core.StreamingOutput


                //get serializer
                final RDFFormat serializer = lmfIOService.getSerializer(type.getMime());

                //create response serialisation
                StreamingOutput entity = new StreamingOutput() {
                    @Override
                    public void write(OutputStream output) throws IOException, WebApplicationException {
                        RDFWriter writer = Rio.createWriter(serializer, output);
                        try {
                            RepositoryConnection con = versioningService.getSnapshot(date);
View Full Code Here


                //get serializer
                final VersionSerializer serializer = versionSerializerService.getSerializer(types);

                //create response serialisation
                StreamingOutput entity = new StreamingOutput() {
                    @Override
                    public void write(OutputStream output) throws IOException, WebApplicationException {
                        serializer.write(resource,versions,output);
                    }
                };
View Full Code Here

    private byte[] barr = null;

    @GET
    public Response getStreamingOutputStream() {
        return Response.ok(new StreamingOutput() {

            public void write(OutputStream arg0) throws IOException, WebApplicationException {
                arg0.write(barr);
            }
View Full Code Here

        }).build();
    }

    @POST
    public StreamingOutput postInputStream(final InputStream is) {
        return new StreamingOutput() {

            public void write(OutputStream arg0) throws IOException, WebApplicationException {
                int read = 0;
                while ((read = is.read()) != -1) {
                    arg0.write(read);
View Full Code Here

    @Path("resource")
    public static class Resource {
        @GET
        public StreamingOutput getStream() {
            return new StreamingOutput() {
                public void write(OutputStream output) throws IOException, WebApplicationException {
                    output.write(MESSAGE_BYTES);
                }
            };
        }
View Full Code Here

      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

  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("{\"" + HdfsFileStatus.class.getSimpleName() + "\":[");
View Full Code Here

   
    @GET
    @Path("/bookbought")
    @Produces("text/*")
    public StreamingOutput getBookBought() {
        return new StreamingOutput() {
            public void write(final OutputStream out) throws IOException, WebApplicationException {
                out.write(("Today: " + new java.util.Date()).getBytes());
                // just for testing, using a thread
                executor.execute(new Runnable() {
                    public void run() {
View Full Code Here

   
    @GET
    @Path("/bookbought")
    @Produces("text/*")
    public StreamingOutput getBookBought() {
        return new StreamingOutput() {
            public void write(final OutputStream out) throws IOException, WebApplicationException {
                out.write(("Today: " + new java.util.Date()).getBytes());
                // just for testing, using a thread
                executor.execute(new Runnable() {
                    public void run() {
View Full Code Here

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

TOP

Related Classes of javax.ws.rs.core.StreamingOutput

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.