Package org.apache.sling.bgservlets

Examples of org.apache.sling.bgservlets.JobData


        // Get JobData, defines path and used to save servlet output to the repository
        final Session s = resourceResolver.adaptTo(Session.class);
        if(s == null) {
            throw new IOException("Unable to get Session from ResourceResolver " + resourceResolver);
        }
        final JobData d = storage.createJobData(s);
        final String ext = request.getRequestPathInfo().getExtension();
        if(ext != null) {
            d.setProperty(JobData.PROP_EXTENSION, ext);
        }
        path = d.getPath();
        creationTime = d.getCreationTime();
        streamPath = d.getPath() + STREAM_PATH_SUFFIX + (ext == null ? "" : "." + ext);
        stream = new SuspendableOutputStream(d.getOutputStream());
        response = new BackgroundHttpServletResponse(hsr, stream);
    }
View Full Code Here


                    "Resource does not adapt to a Node: " + request.getResource().getPath());
        }

        // The stream is a child of the job node
        try {
            final JobData d = jobStorage.getJobData(n.getParent());
            final InputStream is = d.getInputStream();
            try {
                response.setContentType(request.getResponseContentType());
                final OutputStream os = response.getOutputStream();
                final byte [] buffer = new byte[32768];
                int count = 0;
View Full Code Here

TOP

Related Classes of org.apache.sling.bgservlets.JobData

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.