gpt4 book ai didi

org.apache.jackrabbit.webdav.WebdavRequest类的使用及代码示例

转载 作者:知者 更新时间:2024-03-21 06:01:05 26 4
gpt4 key购买 nike

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

WebdavRequest介绍

[英]The empty WebdavRequest interface collects the functionality defined by org.apache.jackrabbit.webdav.DavServletRequest encapsulating the core Webdav specification (RFC 2518) as well as the various extensions used for observation and transaction support, ordering of collections, search and versioning.
[中]空的WebdavRequest界面收集组织定义的功能。阿帕奇。大野兔。webdav。DavServletRequest封装了核心Webdav规范(RFC 2518)以及用于观察和事务支持、集合排序、搜索和版本控制的各种扩展。

代码示例

代码示例来源:origin: org.xwiki.platform/xwiki-platform-webdav-server

@Override
public boolean attachSession(WebdavRequest request) throws DavException
{
  // Retrieve the workspace name.
  String workspaceName = request.getRequestLocator().getWorkspaceName();
  // Empty workspaceName rather means default (null).
  if (workspaceName != null && "".equals(workspaceName)) {
    workspaceName = null;
  }
  DavSession ds = new XWikiDavSession();
  request.setDavSession(ds);
  return true;
}

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

public static LabelHeader parse(WebdavRequest request) {
    String hv = request.getHeader(DeltaVConstants.HEADER_LABEL);
    if (hv == null) {
      return null;
    } else {
      return new LabelHeader(EncodeUtil.unescape(hv));
    }
  }
}

代码示例来源:origin: org.xwiki.platform/xwiki-platform-webdav-server

@Override
protected boolean isPreconditionValid(WebdavRequest request, DavResource resource)
{
  return !resource.exists() || request.matchesIfHeader(resource);
}

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

/**
 * Releases the reference from the request to the session. If no further
 * references to the session exist, the session will be removed from the
 * cache.
 *
 * @param request
 * @see DavSessionProvider#releaseSession(org.apache.jackrabbit.webdav.WebdavRequest)
 */
public void releaseSession(WebdavRequest request) {
  DavSession session = request.getDavSession();
  if (session != null) {
    session.removeReference(request);
  }
  // remove the session from the request
  request.setDavSession(null);
}

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

/**
 * The UNLOCK method
 *
 * @param request
 * @param response
 * @param resource
 * @throws DavException
 */
protected void doUnlock(WebdavRequest request, WebdavResponse response,
            DavResource resource) throws DavException {
  // get lock token from header
  String lockToken = request.getLockToken();
  TransactionInfo tInfo = request.getTransactionInfo();
  if (tInfo != null) {
    ((TransactionResource) resource).unlock(lockToken, tInfo);
  } else {
    resource.unlock(lockToken);
  }
  response.setStatus(DavServletResponse.SC_NO_CONTENT);
}

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

String destHeader = request.getHeader(HEADER_DESTINATION);
  if (destHeader == null || "".equals(destHeader)) {
    return DavServletResponse.SC_BAD_REQUEST;
if (destResource.getLocator().equals(request.getRequestLocator())) {
  return DavServletResponse.SC_FORBIDDEN;
  if (request.isOverwrite()) {
    if (!request.matchesIfHeader(destResource)) {
      return DavServletResponse.SC_PRECONDITION_FAILED;
    } else {

代码示例来源:origin: com.atlassian.confluence.extra.webdav/webdav-plugin

return new MoveMethod(targetUri,
      httpServletRequest.getHeader(WebdavConstants.HEADER_DESTINATION),
      webdavRequest.isOverwrite());
case DavMethods.DAV_PUT:
  return new PutMethod(targetUri);
case DavMethods.DAV_LOCK:
  return new LockMethod(targetUri, webdavRequest.getLockInfo());
case DavMethods.DAV_UNLOCK:
  return new UnLockMethod(targetUri, webdavRequest.getLockToken());
case DavMethods.DAV_PROPPATCH:
  return new PropPatchMethod(targetUri, webdavRequest.getPropPatchChangeList());
case DavMethods.DAV_MKCOL:
  return new MkColMethod(targetUri);
  return new CopyMethod(targetUri,
      httpServletRequest.getHeader(WebdavConstants.HEADER_DESTINATION),
      webdavRequest.isOverwrite(),
      webdavRequest.getDepth(DavConstants.DEPTH_INFINITY) == DavConstants.DEPTH_0);
case DavMethods.DAV_PROPFIND:
  return new PropFindMethod(
      targetUri,
      webdavRequest.getPropFindProperties(),
      webdavRequest.getDepth(DavConstants.DEPTH_INFINITY)
  );
case DavMethods.DAV_DELETE:

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

request.setDavSession( new ArchivaDavSession() );
                  ( (ArchivaDavResourceLocator) request.getRequestLocator() ).getRepositoryId(),
                  WebdavMethodUtil.getMethodPermission( request.getMethod() ) ) )
    request.setDavSession( new ArchivaDavSession() );
    return true;

代码示例来源:origin: com.atlassian.confluence.extra.webdav/webdav-plugin

throw new DavException(DavServletResponse.SC_UNAUTHORIZED, "Unable to authenticate.");
DavResource resource = getResourceFactory().createResource(webdavRequest.getRequestLocator(), webdavRequest, webdavResponse);

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

protected boolean isPreconditionValid(WebdavRequest request, DavResource resource) {
  if (!request.matchesIfHeader(resource)) {
    return false;
    Session repositorySesssion = JcrDavSession.getRepositorySession(request.getDavSession());
    String reqWspName = resource.getLocator().getWorkspaceName();
    String wsName = repositorySesssion.getWorkspace().getName();
    if (DavMethods.DAV_MKWORKSPACE != DavMethods.getMethodCode(request.getMethod()) &&
        reqWspName != null && !reqWspName.equals(wsName)) {
      return false;
  String txId = request.getTransactionId();
  return txId == null || txMgr.hasLock(txId, resource);

代码示例来源:origin: com.atlassian.confluence.extra.webdav/webdav-plugin

public boolean attachSession(WebdavRequest request) throws DavException {
  ConfluenceDavSession confluenceDavSession = getConfluenceDavSession(request);
  if (null == confluenceDavSession) {
    log.debug("Looks like this request is not authenticated. We'll try to authenticate our user now.");
    confluenceDavSession = authenticate(request);
  }
  confluenceDavSession.setUserAgent(request.getHeader(WebdavConstants.HEADER_USER_AGENT));
  confluenceDavSession.updateActivityTimestamp();
  confluenceDavSession.setCurrentlyBeingUsed(true);
  setConfluenceDavSessionIntoSessionMap(confluenceDavSession);
  setConfluenceDavSessionIntoHttpSession(request, confluenceDavSession);
  request.setDavSession(confluenceDavSession);
  AuthenticatedUserThreadLocal.setUser(userAccessor.getUser(confluenceDavSession.getUserName()));
  return true;
}

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

try {
  String workspaceName = null;
  if (DavMethods.DAV_MKWORKSPACE != DavMethods.getMethodCode(request.getMethod())) {
    workspaceName = request.getRequestLocator().getWorkspaceName();
      new LinkHeaderFieldParser(request.getHeaders("Link"));
  setJcrUserData(session, lhfp);
  setSessionIdentifier(session, lhfp);

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

@Override
public void releaseSession( WebdavRequest request )
{
  request.setDavSession( null );
}

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

/**
 * The MKCOL method
 *
 * @param request
 * @param response
 * @param resource
 * @throws IOException
 * @throws DavException
 */
protected void doMkCol(WebdavRequest request, WebdavResponse response,
            DavResource resource) throws IOException, DavException {
  DavResource parentResource = resource.getCollection();
  if (parentResource == null || !parentResource.exists() || !parentResource.isCollection()) {
    // parent does not exist or is not a collection
    response.sendError(DavServletResponse.SC_CONFLICT);
    return;
  }
  // shortcut: mkcol is only allowed on deleted/non-existing resources
  if (resource.exists()) {
    response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
    return;
  }
  if (request.getContentLength() > 0 || request.getHeader("Transfer-Encoding") != null) {
    parentResource.addMember(resource, getInputContext(request, request.getInputStream()));
  } else {
    parentResource.addMember(resource, getInputContext(request, null));
  }
  response.setStatus(DavServletResponse.SC_CREATED);
}

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

DavResource resource) throws IOException, DavException {
LockInfo lockInfo = request.getLockInfo();
if (lockInfo.isRefreshLock()) {
    if (request.matchesIfHeader(resource.getHref(), activeLock.getToken(), etag)) {
      lList.add(resource.refreshLock(lockInfo, activeLock.getToken()));

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

/**
 * The PROPFIND method
 *
 * @param request
 * @param response
 * @param resource
 * @throws IOException
 */
protected void doPropFind(WebdavRequest request, WebdavResponse response,
             DavResource resource) throws IOException, DavException {
  if (!resource.exists()) {
    response.sendError(DavServletResponse.SC_NOT_FOUND);
    return;
  }
  int depth = request.getDepth(DEPTH_INFINITY);
  DavPropertyNameSet requestProperties = request.getPropFindProperties();
  int propfindType = request.getPropFindType();
  MultiStatus mstatus = new MultiStatus();
  mstatus.addResourceProperties(resource, requestProperties, propfindType, depth);
  response.sendMultiStatus(mstatus);
}

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

String txId = request.getTransactionId();
String subscriptionId = request.getSubscriptionId();
String lockToken = request.getLockToken();

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

/**
 * The COPY method
 *
 * @param request
 * @param response
 * @param resource
 * @throws IOException
 * @throws DavException
 */
protected void doCopy(WebdavRequest request, WebdavResponse response,
           DavResource resource) throws IOException, DavException {
  // only depth 0 and infinity is allowed
  int depth = request.getDepth(DEPTH_INFINITY);
  if (!(depth == DEPTH_0 || depth == DEPTH_INFINITY)) {
    response.sendError(DavServletResponse.SC_BAD_REQUEST);
    return;
  }
  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.copy(destResource, depth == DEPTH_0);
  response.setStatus(status);
}

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

private static Session getRepositorySession(WebdavRequest request) throws DavException {
  DavSession ds = request.getDavSession();
  return JcrDavSession.getRepositorySession(ds);
}

代码示例来源:origin: org.xwiki.platform/xwiki-platform-webdav-server

@Override
protected boolean execute(WebdavRequest request, WebdavResponse response, int method,
  DavResource resource) throws ServletException, IOException, DavException
{        
  logger.debug(String.format("Resource: [%s] Method: [%s]", resource.getDisplayName(), request.getMethod()));
  return super.execute(request, response, method, resource);
}

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