Package javax.ws.rs.core.Response

Examples of javax.ws.rs.core.Response.ResponseBuilder.build()


        /* Write the XML encoding to a writer and return it2 */
        StringWriter sw = new StringWriter();
        try {
            mpl.encode(sw);
            ResponseBuilder rb = Response.ok(sw.toString());
            return rb.build();
        } catch (javax.xml.bind.JAXBException excp) {
            /* Log an error and return an error response */
            logger.log(Level.WARNING, "[MODULES] GET PLUGINS Unable to encode", excp);
            ResponseBuilder rb = Response.status(Response.Status.BAD_REQUEST);
            return rb.build();
View Full Code Here


            return rb.build();
        } catch (javax.xml.bind.JAXBException excp) {
            /* Log an error and return an error response */
            logger.log(Level.WARNING, "[MODULES] GET PLUGINS Unable to encode", excp);
            ResponseBuilder rb = Response.status(Response.Status.BAD_REQUEST);
            return rb.build();
        }
    }
   
    /**
     * Takes a module name, jar name, and jar type (client or common) and
View Full Code Here

                checksumList.putChecksums(partList.getChecksumMap());
            }
        }

        ResponseBuilder rb = Response.ok(checksumList);
        return rb.build();
    }

    @GET
    @Produces({ "application/xml", "application/json" })
    public Response getChecksums(@PathParam("modulename") String moduleName) {
View Full Code Here

        Module module = manager.getInstalledModules().get(moduleName);
        if (module == null) {
            /* Log an error and return an error response */
            logger.warning("ModuleManager: unable to locate module " + moduleName);
            ResponseBuilder rb = Response.status(Response.Status.BAD_REQUEST);
            return rb.build();
        }

        // For the base URL of assets within a module, use the server URL and
        // point it to the webdav repository
        String hostname = System.getProperty(Constants.WEBSERVER_URL_PROP) + "webdav/content/modules/installed/" + moduleName;
View Full Code Here

            StringWriter sw = new StringWriter();
            try {
                /* Formulate the HTTP response and send the string */
                newRepository.encode(sw);
                ResponseBuilder rb = Response.ok(sw.toString());
                return rb.build();
            } catch (javax.xml.bind.JAXBException excp) {
                /* Log an error and return an error response */
                logger.warning("ModuleManager: unable to serialize repository for " + moduleName);
                ResponseBuilder rb = Response.status(Response.Status.BAD_REQUEST);
                return rb.build();
View Full Code Here

                return rb.build();
            } catch (javax.xml.bind.JAXBException excp) {
                /* Log an error and return an error response */
                logger.warning("ModuleManager: unable to serialize repository for " + moduleName);
                ResponseBuilder rb = Response.status(Response.Status.BAD_REQUEST);
                return rb.build();
            }
        }
       
        /* Since we potentially edit fields below, make a copy of the repository */
        ModuleRepository newRepository = new ModuleRepository(mr);
View Full Code Here

        StringWriter sw = new StringWriter();
        try {
            /* Formulate the HTTP response and send the string */
            newRepository.encode(sw);
            ResponseBuilder rb = Response.ok(sw.toString());
            return rb.build();
        } catch (javax.xml.bind.JAXBException excp) {
            /* Log an error and return an error response */
            logger.warning("ModuleManager: unable to serialize repository for " + moduleName);
            ResponseBuilder rb = Response.status(Response.Status.BAD_REQUEST);
            return rb.build();
View Full Code Here

            return rb.build();
        } catch (javax.xml.bind.JAXBException excp) {
            /* Log an error and return an error response */
            logger.warning("ModuleManager: unable to serialize repository for " + moduleName);
            ResponseBuilder rb = Response.status(Response.Status.BAD_REQUEST);
            return rb.build();
        }
    }
}
View Full Code Here

        // sure this returns the canonical public URL for the server XXX
        //out.setServerURL(getServerURL());

        try {
            ResponseBuilder rb = Response.ok(out);
            return rb.build();
        } catch (Exception excp) {
            logger.log(Level.WARNING, "Error writing response", excp);
            ResponseBuilder rb = Response.status(Response.Status.BAD_REQUEST);
            return rb.build();           
        }
View Full Code Here

            ResponseBuilder rb = Response.ok(out);
            return rb.build();
        } catch (Exception excp) {
            logger.log(Level.WARNING, "Error writing response", excp);
            ResponseBuilder rb = Response.status(Response.Status.BAD_REQUEST);
            return rb.build();           
        }
    }

    /**
     * Get the URL for this server
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.