gpt4 book ai didi

org.apache.jackrabbit.webdav.WebdavResponse.sendError()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-22 12:05:05 29 4
gpt4 key购买 nike

本文整理了Java中org.apache.jackrabbit.webdav.WebdavResponse.sendError()方法的一些代码示例,展示了WebdavResponse.sendError()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebdavResponse.sendError()方法的具体详情如下:
包路径:org.apache.jackrabbit.webdav.WebdavResponse
类名称:WebdavResponse
方法名:sendError

WebdavResponse.sendError介绍

暂无

代码示例

代码示例来源:origin: apache/jackrabbit

/**
 * The POST method. Delegate to PUT
 *
 * @param request
 * @param response
 * @param resource
 * @throws IOException
 * @throws DavException
 */
protected void doPost(WebdavRequest request, WebdavResponse response,
           DavResource resource) throws IOException, DavException {
  response.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
}

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-webdav

/**
 * The POST method. Delegate to PUT
 *
 * @param request
 * @param response
 * @param resource
 * @throws IOException
 * @throws DavException
 */
protected void doPost(WebdavRequest request, WebdavResponse response,
           DavResource resource) throws IOException, DavException {
  response.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
}

代码示例来源:origin: apache/jackrabbit

/**
 * The VERSION-CONTROL method
 *
 * @param request
 * @param response
 * @param resource
 * @throws DavException
 * @throws IOException
 */
protected void doVersionControl(WebdavRequest request, WebdavResponse response,
                DavResource resource)
    throws DavException, IOException {
  if (!(resource instanceof VersionableResource)) {
    response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
    return;
  }
  ((VersionableResource) resource).addVersionControl();
}

代码示例来源:origin: apache/jackrabbit

/**
 * The UNCHECKOUT method
 *
 * @param request
 * @param response
 * @param resource
 * @throws DavException
 * @throws IOException
 */
protected void doUncheckout(WebdavRequest request, WebdavResponse response,
              DavResource resource)
    throws DavException, IOException {
  if (!(resource instanceof VersionControlledResource)) {
    response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
    return;
  }
  ((VersionControlledResource) resource).uncheckout();
}

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-webdav

/**
 * The VERSION-CONTROL method
 *
 * @param request
 * @param response
 * @param resource
 * @throws DavException
 * @throws IOException
 */
protected void doVersionControl(WebdavRequest request, WebdavResponse response,
                DavResource resource)
    throws DavException, IOException {
  if (!(resource instanceof VersionableResource)) {
    response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
    return;
  }
  ((VersionableResource) resource).addVersionControl();
}

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-webdav

/**
 * The CHECKOUT method
 *
 * @param request
 * @param response
 * @param resource
 * @throws DavException
 * @throws IOException
 */
protected void doCheckout(WebdavRequest request, WebdavResponse response,
             DavResource resource)
    throws DavException, IOException {
  if (!(resource instanceof VersionControlledResource)) {
    response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
    return;
  }
  ((VersionControlledResource) resource).checkout();
}

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-webdav

/**
 * The UNCHECKOUT method
 *
 * @param request
 * @param response
 * @param resource
 * @throws DavException
 * @throws IOException
 */
protected void doUncheckout(WebdavRequest request, WebdavResponse response,
              DavResource resource)
    throws DavException, IOException {
  if (!(resource instanceof VersionControlledResource)) {
    response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
    return;
  }
  ((VersionControlledResource) resource).uncheckout();
}

代码示例来源:origin: apache/jackrabbit

/**
 * The CHECKOUT method
 *
 * @param request
 * @param response
 * @param resource
 * @throws DavException
 * @throws IOException
 */
protected void doCheckout(WebdavRequest request, WebdavResponse response,
             DavResource resource)
    throws DavException, IOException {
  if (!(resource instanceof VersionControlledResource)) {
    response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
    return;
  }
  ((VersionControlledResource) resource).checkout();
}

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-webdav

/**
 * Sets the "WWW-Authenticate" header and writes the appropriate error
 * to the given webdav response.
 *
 * @param request The webdav request.
 * @param response The webdav response.
 * @param error The DavException that leads to the unauthorized response.
 * @throws IOException
 */
protected void sendUnauthorized(WebdavRequest request,
                WebdavResponse response, DavException error) throws IOException {
  response.setHeader("WWW-Authenticate", getAuthenticateHeaderValue());
  if (error == null || error.getErrorCode() != HttpServletResponse.SC_UNAUTHORIZED) {
    response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
  } else {
    response.sendError(error.getErrorCode(), error.getStatusPhrase());
  }
}

代码示例来源:origin: apache/jackrabbit

/**
 * Sets the "WWW-Authenticate" header and writes the appropriate error
 * to the given webdav response.
 *
 * @param request The webdav request.
 * @param response The webdav response.
 * @param error The DavException that leads to the unauthorized response.
 * @throws IOException
 */
protected void sendUnauthorized(WebdavRequest request,
                WebdavResponse response, DavException error) throws IOException {
  response.setHeader("WWW-Authenticate", getAuthenticateHeaderValue());
  if (error == null || error.getErrorCode() != HttpServletResponse.SC_UNAUTHORIZED) {
    response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
  } else {
    response.sendError(error.getErrorCode(), error.getStatusPhrase());
  }
}

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-webdav

/**
 * The DELETE method
 *
 * @param request
 * @param response
 * @param resource
 * @throws IOException
 * @throws DavException
 */
protected void doDelete(WebdavRequest request, WebdavResponse response,
            DavResource resource) throws IOException, DavException {
  DavResource parent = resource.getCollection();
  if (parent != null) {
    parent.removeMember(resource);
    response.setStatus(DavServletResponse.SC_NO_CONTENT);
  } else {
    response.sendError(DavServletResponse.SC_FORBIDDEN, "Cannot remove the root resource.");
  }
}

代码示例来源:origin: apache/jackrabbit

/**
 * The DELETE method
 *
 * @param request
 * @param response
 * @param resource
 * @throws IOException
 * @throws DavException
 */
protected void doDelete(WebdavRequest request, WebdavResponse response,
            DavResource resource) throws IOException, DavException {
  DavResource parent = resource.getCollection();
  if (parent != null) {
    parent.removeMember(resource);
    response.setStatus(DavServletResponse.SC_NO_CONTENT);
  } else {
    response.sendError(DavServletResponse.SC_FORBIDDEN, "Cannot remove the root resource.");
  }
}

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-webdav

/**
 * The CHECKIN method
 *
 * @param request
 * @param response
 * @param resource
 * @throws DavException
 * @throws IOException
 */
protected void doCheckin(WebdavRequest request, WebdavResponse response,
             DavResource resource)
    throws DavException, IOException {
  if (!(resource instanceof VersionControlledResource)) {
    response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
    return;
  }
  String versionHref = ((VersionControlledResource) resource).checkin();
  response.setHeader(DeltaVConstants.HEADER_LOCATION, versionHref);
  response.setStatus(DavServletResponse.SC_CREATED);
}

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-webdav

/**
 * The MERGE method
 *
 * @param request
 * @param response
 * @param resource
 * @throws DavException
 * @throws IOException
 */
protected void doMerge(WebdavRequest request, WebdavResponse response,
            DavResource resource) throws DavException, IOException {
  if (!(resource instanceof VersionControlledResource)) {
    response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
    return;
  }
  MergeInfo info = request.getMergeInfo();
  MultiStatus ms = ((VersionControlledResource) resource).merge(info);
  response.sendMultiStatus(ms);
}

代码示例来源:origin: apache/jackrabbit

/**
 * The MERGE method
 *
 * @param request
 * @param response
 * @param resource
 * @throws DavException
 * @throws IOException
 */
protected void doMerge(WebdavRequest request, WebdavResponse response,
            DavResource resource) throws DavException, IOException {
  if (!(resource instanceof VersionControlledResource)) {
    response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
    return;
  }
  MergeInfo info = request.getMergeInfo();
  MultiStatus ms = ((VersionControlledResource) resource).merge(info);
  response.sendMultiStatus(ms);
}

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-webdav

/**
 * The UPDATE method
 *
 * @param request
 * @param response
 * @param resource
 * @throws DavException
 * @throws IOException
 */
protected void doUpdate(WebdavRequest request, WebdavResponse response,
            DavResource resource) throws DavException, IOException {
  if (!(resource instanceof VersionControlledResource)) {
    response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
    return;
  }
  UpdateInfo info = request.getUpdateInfo();
  MultiStatus ms = ((VersionControlledResource) resource).update(info);
  response.sendMultiStatus(ms);
}

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-webdav

/**
 * The UNSUBSCRIBE method
 *
 * @param request
 * @param response
 * @param resource
 * @throws IOException
 * @throws DavException
 */
protected void doUnsubscribe(WebdavRequest request,
               WebdavResponse response,
               DavResource resource)
    throws IOException, DavException {
  if (!(resource instanceof ObservationResource)) {
    response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
    return;
  }
  ((ObservationResource) resource).unsubscribe(request.getSubscriptionId());
  response.setStatus(DavServletResponse.SC_NO_CONTENT);
}

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-webdav

/**
 * The POLL method
 *
 * @param request
 * @param response
 * @param resource
 * @throws IOException
 * @throws DavException
 */
protected void doPoll(WebdavRequest request,
           WebdavResponse response,
           DavResource resource)
    throws IOException, DavException {
  if (!(resource instanceof ObservationResource)) {
    response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
    return;
  }
  EventDiscovery ed = ((ObservationResource) resource).poll(
      request.getSubscriptionId(), request.getPollTimeout());
  response.sendPollResponse(ed);
}

代码示例来源:origin: apache/jackrabbit

/**
 * The MOVE method
 *
 * @param request
 * @param response
 * @param resource
 * @throws IOException
 * @throws DavException
 */
protected void doMove(WebdavRequest request, WebdavResponse response,
           DavResource resource) throws IOException, DavException {
  DavResource destResource = getResourceFactory().createResource(request.getDestinationLocator(), request, response);
  int status = validateDestination(destResource, request, true);
  if (status > DavServletResponse.SC_NO_CONTENT) {
    response.sendError(status);
    return;
  }
  resource.move(destResource);
  response.setStatus(status);
}

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-webdav

/**
 * The MOVE method
 *
 * @param request
 * @param response
 * @param resource
 * @throws IOException
 * @throws DavException
 */
protected void doMove(WebdavRequest request, WebdavResponse response,
           DavResource resource) throws IOException, DavException {
  DavResource destResource = getResourceFactory().createResource(request.getDestinationLocator(), request, response);
  int status = validateDestination(destResource, request, true);
  if (status > DavServletResponse.SC_NO_CONTENT) {
    response.sendError(status);
    return;
  }
  resource.move(destResource);
  response.setStatus(status);
}

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com