public void setContentLanguage(String contentLanguage) { if (contentLanguage != null) { properties.add(new DefaultDavProperty<String>(DavPropertyName.GETCONTENTLANGUAGE, contentLanguage)); } }
public void setContentLength(long contentLength) { if (contentLength > IOUtil.UNDEFINED_LENGTH) { properties.add(new DefaultDavProperty<String>(DavPropertyName.GETCONTENTLENGTH, contentLength + "")); } }
/** * Add a {@link org.apache.jackrabbit.webdav.property.HrefProperty} with the * specified property name and values. Each item present in the specified * values array is referenced in the resulting property. * * @param name * @param values * @param isProtected */ protected void addHrefProperty(DavPropertyName name, Item[] values, boolean isProtected) { properties.add(getHrefProperty(name, values, isProtected)); }
/** * Add a new {@link HrefProperty href property} to the property set, where * all versions present in the specified iterator are referenced in the * resulting property. * * @param name * @param itemIterator * @param isProtected */ protected void addHrefProperty(DavPropertyName name, VersionIterator itemIterator, boolean isProtected) { properties.add(getHrefProperty(name, itemIterator, isProtected)); }
public void setETag(String etag) { if (etag != null) { properties.add(new DefaultDavProperty<String>(DavPropertyName.GETETAG, etag)); } }
public void setModificationTime(long modTime) { if (modTime <= IOUtil.UNDEFINED_TIME) { modificationTime = new Date().getTime(); } else { modificationTime = modTime; } String lastModified = IOUtil.getLastModified(modificationTime); properties.add(new DefaultDavProperty<String>(DavPropertyName.GETLASTMODIFIED, lastModified)); }
public void setContentType(String mimeType, String encoding) { String contentType = IOUtil.buildContentType(mimeType, encoding); if (contentType != null) { properties.add(new DefaultDavProperty<String>(DavPropertyName.GETCONTENTTYPE, contentType)); } }
public void setCreationTime(long creationTime) { String created = IOUtil.getCreated(creationTime); properties.add(new DefaultDavProperty<String>(DavPropertyName.CREATIONDATE, created)); }
/** */ protected void loadLiveProperties(DavPropertySet properties) { super.loadLiveProperties(properties); try { byte[] calendarBytes = getCalendar().toString().getBytes("UTF-8"); properties.add(new ContentLength(Long.valueOf(calendarBytes.length))); } catch (Exception e) { throw new CosmoException("Can't convert calendar", e); } properties.add(new ContentType(ICALENDAR_MEDIA_TYPE, "UTF-8")); }
protected void loadLiveProperties(DavPropertySet properties) { properties.add(new DisplayName(getDisplayName())); properties.add(new ResourceType(getResourceTypes())); properties.add(new IsCollection(isCollection())); properties.add(new CurrentUserPrincipal(getResourceLocator(), getSecurityManager().getSecurityContext().getUser())); }
@Override protected void initProperties() { super.initProperties(); try { // init workspace specific properties NamespaceRegistry nsReg = getRepositorySession().getWorkspace().getNamespaceRegistry(); DavProperty<?> namespacesProp = new NamespacesProperty(nsReg); properties.add(namespacesProp); } catch (RepositoryException e) { log.error("Failed to access NamespaceRegistry: " + e.getMessage()); } } }
/** * 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); }
/** */ protected void loadLiveProperties(DavPropertySet properties) { super.loadLiveProperties(properties); CollectionItem cc = (CollectionItem) getItem(); if (cc == null) { return; } properties.add(new ExcludeFreeBusyRollup(cc.isExcludeFreeBusyRollup())); }
/** * @param data Data to be set as the content of this temporary file. * @param modificationTime Time of modification. */ public void update(byte[] data, Date modificationTime) { this.data = data.clone(); setModified(modificationTime); getProperties().add(new DefaultDavProperty(DavPropertyName.GETCONTENTLENGTH, this.data.length)); }
@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); } }