Package javax.ws.rs.core

Examples of javax.ws.rs.core.StreamingOutput


    @Path("StreamingOutputResource")
    public static class StreamingOutputResource {
        @GET
        public StreamingOutput get() {
            return new StreamingOutput() {
                public void write(final OutputStream entity) throws IOException {
                    entity.write("CONTENT".getBytes());
                }
            };
        }
View Full Code Here


                //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

        }
    return params;
  }

  private Response buildQueryResponse(final String resultType, final String query) throws Exception {
        StreamingOutput entity = new StreamingOutput() {
            @Override
            public void write(OutputStream output) throws IOException, WebApplicationException {
                try {
                    sparqlService.query(QueryLanguage.SPARQL,query,getTupleResultWriter(resultType,output),getBooleanResultWriter(resultType,output), getGraphResultWriter(resultType,output), configurationService.getIntConfiguration("sparql.timeout", 60));
                } catch (MarmottaException ex) {
View Full Code Here

            } else {
                context = null;
            }
            final URI fcontext = context;

            StreamingOutput entity = new StreamingOutput() {
                @Override
                public void write(OutputStream output) throws IOException, WebApplicationException {
                    try {
                        //FIXME: html should not be exported, but rendered?
                        exportService.exportData(output,fcontext,bestType.getMime());
View Full Code Here

                if(r != null) {

                    final Resource subject = r;

                    StreamingOutput entity = new StreamingOutput() {
                        @Override
                        public void write(OutputStream output) throws IOException, WebApplicationException {
                            // FIXME: This method is executed AFTER the @Transactional!
                            RDFWriter writer = Rio.createWriter(serializer,output);
                            try {
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("{\"" + FileStatus.class.getSimpleName() + "es\":{\""
            + FileStatus.class.getSimpleName() + "\":[");
View Full Code Here

            } else {
                context = null;
            }
            final URI fcontext = context;

            StreamingOutput entity = new StreamingOutput() {
                @Override
                public void write(OutputStream output) throws IOException, WebApplicationException {
                    try {
                        //FIXME: html should not be exported, but rendered?
                        exportService.exportData(output,fcontext,bestType.getMime());
View Full Code Here

                    throw new HttpErrorException(Status.NOT_ACCEPTABLE, resource, "mimetype can not be processed", headers);
                }

                final Resource subject = r;

                StreamingOutput entity = new StreamingOutput() {
                    @Override
                    public void write(OutputStream output) throws IOException, WebApplicationException {
                        // FIXME: This method is executed AFTER the @Transactional!
                        RDFWriter writer = Rio.createWriter(serializer, output);
                        try {
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.