Example usage for com.liferay.portal.kernel.servlet HttpMethods DELETE

List of usage examples for com.liferay.portal.kernel.servlet HttpMethods DELETE

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.servlet HttpMethods DELETE.

Prototype

String DELETE

To view the source code for com.liferay.portal.kernel.servlet HttpMethods DELETE.

Click Source Link

Usage

From source file:com.liferay.server.manager.internal.servlet.ServerManagerServlet.java

License:Open Source License

protected void execute(HttpServletRequest request, JSONObject responseJSONObject, String pathInfo)
        throws Exception {

    String executorPath = getExecutorPath(pathInfo);

    Executor executor = _executorServiceRegistry.getExecutor(executorPath);

    Queue<String> arguments = getExecutorArguments(executorPath, pathInfo);

    String method = request.getMethod();

    if (StringUtil.equalsIgnoreCase(method, HttpMethods.DELETE)) {
        executor.executeDelete(request, responseJSONObject, arguments);
    } else if (StringUtil.equalsIgnoreCase(method, HttpMethods.GET)) {
        executor.executeRead(request, responseJSONObject, arguments);
    } else if (StringUtil.equalsIgnoreCase(method, HttpMethods.POST)) {
        executor.executeCreate(request, responseJSONObject, arguments);
    } else if (StringUtil.equalsIgnoreCase(method, HttpMethods.PUT)) {
        executor.executeUpdate(request, responseJSONObject, arguments);
    }/*from ww  w.  j a v  a 2s  . co m*/
}

From source file:com.liferay.servermanager.servlet.ServerManagerServlet.java

License:Open Source License

protected void execute(HttpServletRequest request, JSONObject responseJSONObject, Queue<String> arguments)
        throws Exception {

    Executor executor = _executor;

    while (true) {
        Executor nextExecutor = executor.getNextExecutor(arguments);

        if (nextExecutor == null) {
            break;
        }/*w  ww .  j a  v a  2  s.  c  o  m*/

        executor = nextExecutor;
    }

    String method = request.getMethod();

    if (StringUtil.equalsIgnoreCase(method, HttpMethods.DELETE)) {
        executor.executeDelete(request, responseJSONObject, arguments);
    } else if (StringUtil.equalsIgnoreCase(method, HttpMethods.GET)) {
        executor.executeRead(request, responseJSONObject, arguments);
    } else if (StringUtil.equalsIgnoreCase(method, HttpMethods.POST)) {
        executor.executeCreate(request, responseJSONObject, arguments);
    } else if (StringUtil.equalsIgnoreCase(method, HttpMethods.PUT)) {
        executor.executeUpdate(request, responseJSONObject, arguments);
    }
}