public ArchivaVirtualDavResource( List<Path> localResources, String logicalResource, MimeTypes mimeTypes, ArchivaDavResourceLocator locator, DavResourceFactory factory ) { this.localResources = localResources; this.logicalResource = logicalResource; this.locator = locator; this.factory = factory; this.properties = new DavPropertySet(); }
public DavResourceBase(DavResourceLocator locator, DavResourceFactory factory) throws CosmoDavException { this.locator = locator; this.factory = factory; this.properties = new DavPropertySet(); this.initialized = false; }
public DavResourceBase(DavResourceLocator locator, DavResourceFactory factory) throws CosmoDavException { this.locator = locator; this.factory = factory; this.properties = new DavPropertySet(); this.initialized = false; }
/** * Get properties present in this response for the given status code. In * case this MultiStatusResponse does not represent a 'propstat' response, * always an empty {@link DavPropertySet} will be returned. * * @param status * @return property set */ public DavPropertySet getProperties(int status) { if (statusMap.containsKey(status)) { PropContainer mapEntry = statusMap.get(status); if (mapEntry != null && mapEntry instanceof DavPropertySet) { return (DavPropertySet) mapEntry; } } return new DavPropertySet(); }
/** * Get properties present in this response for the given status code. In * case this MultiStatusResponse does not represent a 'propstat' response, * always an empty {@link DavPropertySet} will be returned. * * @param status * @return property set */ public DavPropertySet getProperties(int status) { if (statusMap.containsKey(status)) { PropContainer mapEntry = statusMap.get(status); if (mapEntry != null && mapEntry instanceof DavPropertySet) { return (DavPropertySet) mapEntry; } } return new DavPropertySet(); }
/** * Get properties present in this response for the given status code. In * case this MultiStatusResponse does not represent a 'propstat' response, * always an empty {@link DavPropertySet} will be returned. * * @param status * @return property set */ public DavPropertySet getProperties(int status) { Integer key = new Integer(status); if (statusMap.containsKey(key)) { Object mapEntry = statusMap.get(key); if (mapEntry != null && mapEntry instanceof DavPropertySet) { return (DavPropertySet) mapEntry; } } return new DavPropertySet(); }
public DavPropertySet getProperties() { if (null == propertySet) { propertySet = new DavPropertySet(); initProperties(propertySet); } return propertySet; }
/** * @param status * @return */ private PropContainer getPropContainer(int status, boolean forNames) { PropContainer propContainer = statusMap.get(status); if (propContainer == null) { if (forNames) { propContainer = new DavPropertyNameSet(); } else { propContainer = new DavPropertySet(); } statusMap.put(status, propContainer); } return propContainer; }
/** * @param status * @return */ private PropContainer getPropContainer(int status, boolean forNames) { PropContainer propContainer = statusMap.get(status); if (propContainer == null) { if (forNames) { propContainer = new DavPropertyNameSet(); } else { propContainer = new DavPropertySet(); } statusMap.put(status, propContainer); } return propContainer; }
@Override public DavPropertySet getVirtualProperties() { Map<String, DavPropertySet> vPropertiesMap = getContext().getUserStorage().getPropertiesMap(); if (vPropertiesMap.get(getResourcePath()) == null) { vPropertiesMap.put(getResourcePath(), new DavPropertySet()); } return vPropertiesMap.get(getResourcePath()); }
/** * Send response body for a lock request that was intended to refresh one * or several locks. * * @param locks * @throws java.io.IOException * @see DavServletResponse#sendRefreshLockResponse(org.apache.jackrabbit.webdav.lock.ActiveLock[]) */ public void sendRefreshLockResponse(ActiveLock[] locks) throws IOException { DavPropertySet propSet = new DavPropertySet(); propSet.add(new LockDiscovery(locks)); sendXmlResponse(propSet, SC_OK); }
/** * Send response body for a lock request that was intended to refresh one * or several locks. * * @param locks * @throws java.io.IOException * @see DavServletResponse#sendRefreshLockResponse(org.apache.jackrabbit.webdav.lock.ActiveLock[]) */ public void sendRefreshLockResponse(ActiveLock[] locks) throws IOException { DavPropertySet propSet = new DavPropertySet(); propSet.add(new LockDiscovery(locks)); sendXmlResponse(propSet, SC_OK); }
/** * Send response body for a lock request that was intended to refresh one * or several locks. * * @param locks * @throws java.io.IOException * @see DavServletResponse#sendRefreshLockResponse(org.apache.jackrabbit.webdav.lock.ActiveLock[]) */ public void sendRefreshLockResponse(ActiveLock[] locks) throws IOException { DavPropertySet propSet = new DavPropertySet(); propSet.add(new LockDiscovery(locks)); sendXmlResponse(propSet, SC_OK); }
/** * Send response body for a lock request intended to create a new lock. * * @param lock * @throws java.io.IOException * @see DavServletResponse#sendLockResponse(org.apache.jackrabbit.webdav.lock.ActiveLock) */ public void sendLockResponse(ActiveLock lock) throws IOException { CodedUrlHeader ltHeader = new CodedUrlHeader(DavConstants.HEADER_LOCK_TOKEN, lock.getToken()); httpResponse.setHeader(ltHeader.getHeaderName(), ltHeader.getHeaderValue()); DavPropertySet propSet = new DavPropertySet(); propSet.add(new LockDiscovery(lock)); sendXmlResponse(propSet, SC_OK); }
/** * * @param subscription * @throws IOException * @see org.apache.jackrabbit.webdav.observation.ObservationDavServletResponse#sendSubscriptionResponse(org.apache.jackrabbit.webdav.observation.Subscription) */ public void sendSubscriptionResponse(Subscription subscription) throws IOException { String id = subscription.getSubscriptionId(); if (id != null) { Header h = new CodedUrlHeader(ObservationConstants.HEADER_SUBSCRIPTIONID, id); httpResponse.setHeader(h.getHeaderName(), h.getHeaderValue()); } DavPropertySet propSet = new DavPropertySet(); propSet.add(new SubscriptionDiscovery(subscription)); sendXmlResponse(propSet, SC_OK); }
@Override public void setPrimaryType(NodeId nodeId, Name primaryNodeTypeName) throws RepositoryException { checkConsumed(); try { DavPropertySet setProperties = new DavPropertySet(); setProperties.add(createNodeTypeProperty(JcrRemotingConstants.JCR_PRIMARYNODETYPE_LN, new String[] {resolver.getJCRName(primaryNodeTypeName)})); String uri = getItemUri(nodeId, sessionInfo); HttpProppatch request = new HttpProppatch(uri, setProperties, new DavPropertyNameSet()); requests.add(request); } catch (IOException e) { throw new RepositoryException(e); } }
@Override public void setPrimaryType(NodeId nodeId, Name primaryNodeTypeName) throws RepositoryException { checkConsumed(); try { DavPropertySet setProperties = new DavPropertySet(); setProperties.add(createNodeTypeProperty(JcrRemotingConstants.JCR_PRIMARYNODETYPE_LN, new String[] {resolver.getJCRName(primaryNodeTypeName)})); String uri = getItemUri(nodeId, sessionInfo); HttpProppatch request = new HttpProppatch(uri, setProperties, new DavPropertyNameSet()); requests.add(request); } catch (IOException e) { throw new RepositoryException(e); } }
/** * * @param subscription * @throws IOException * @see org.apache.jackrabbit.webdav.observation.ObservationDavServletResponse#sendSubscriptionResponse(org.apache.jackrabbit.webdav.observation.Subscription) */ public void sendSubscriptionResponse(Subscription subscription) throws IOException { String id = subscription.getSubscriptionId(); if (id != null) { Header h = new CodedUrlHeader(ObservationConstants.HEADER_SUBSCRIPTIONID, id); httpResponse.setHeader(h.getHeaderName(), h.getHeaderValue()); } DavPropertySet propSet = new DavPropertySet(); propSet.add(new SubscriptionDiscovery(subscription)); sendXmlResponse(propSet, SC_OK); }
/** * * @param subscription * @throws IOException * @see org.apache.jackrabbit.webdav.observation.ObservationDavServletResponse#sendSubscriptionResponse(org.apache.jackrabbit.webdav.observation.Subscription) */ public void sendSubscriptionResponse(Subscription subscription) throws IOException { String id = subscription.getSubscriptionId(); if (id != null) { Header h = new CodedUrlHeader(ObservationConstants.HEADER_SUBSCRIPTIONID, id); httpResponse.setHeader(h.getHeaderName(), h.getHeaderValue()); } DavPropertySet propSet = new DavPropertySet(); propSet.add(new SubscriptionDiscovery(subscription)); sendXmlResponse(propSet, SC_OK); }
@Override public void unregisterNodeTypes(SessionInfo sessionInfo, Name[] nodeTypeNames) throws RepositoryException { HttpProppatch request = null; try { DavPropertySet setProperties = new DavPropertySet(); setProperties.add(createUnRegisterNodeTypesProperty(sessionInfo, nodeTypeNames)); String uri = uriResolver.getWorkspaceUri(sessionInfo.getWorkspaceName()); request = new HttpProppatch(uri, setProperties, new DavPropertyNameSet()); initMethod(request, sessionInfo, true); HttpResponse response = executeRequest(sessionInfo, request); request.checkSuccess(response); } catch (IOException e) { throw new RepositoryException(e); } catch (DavException e) { throw ExceptionConverter.generate(e); } finally { if (request != null) { request.releaseConnection(); } } }