All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nl.info.webdav.methods.DoNotImplemented Maven / Gradle / Ivy

There is a newer version: 1.2.73
Show newest version
package nl.info.webdav.methods;

import java.io.IOException;

import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import nl.info.webdav.IMethodExecutor;
import nl.info.webdav.ITransaction;
import nl.info.webdav.WebdavStatus;

public class DoNotImplemented implements IMethodExecutor {

    private static final org.slf4j.Logger LOG = org.slf4j.LoggerFactory.getLogger(DoNotImplemented.class);
    private final boolean _readOnly;

    public DoNotImplemented(boolean readOnly) {
        _readOnly = readOnly;
    }

    public void execute(
            ITransaction transaction,
            HttpServletRequest req,
            HttpServletResponse resp
    ) throws IOException {
        LOG.trace("-- " + req.getMethod());

        if (_readOnly) {
            resp.sendError(WebdavStatus.SC_FORBIDDEN);
        } else
            resp.sendError(HttpServletResponse.SC_NOT_IMPLEMENTED);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy