当前位置: 首页>>代码示例>>Java>>正文


Java DavPropertyName类代码示例

本文整理汇总了Java中org.apache.jackrabbit.webdav.property.DavPropertyName的典型用法代码示例。如果您正苦于以下问题:Java DavPropertyName类的具体用法?Java DavPropertyName怎么用?Java DavPropertyName使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DavPropertyName类属于org.apache.jackrabbit.webdav.property包,在下文中一共展示了DavPropertyName类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkCalendarResourceType

import org.apache.jackrabbit.webdav.property.DavPropertyName; //导入依赖的package包/类
/**
 * Returns true if the resourcetype Property has a Calendar Element under it.
 *
 * @param resourcetype ResourceType Property
 * @return True if, resource is Calendar, else false.
 */
private static boolean checkCalendarResourceType(DavProperty<?> resourcetype) {
	boolean isCalendar = false;

	if (resourcetype != null) {
		DavPropertyName calProp = DavPropertyName.create("calendar", CalDAVConstants.NAMESPACE_CALDAV);

		for (Object o : (Collection<?>) resourcetype.getValue()) {
			if (o instanceof Element) {
				Element e = (Element) o;
				if (e.getLocalName().equals(calProp.getName())) {
					isCalendar = true;
				}
			}
		}
	}
	return isCalendar;
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:24,代码来源:AppointmentManager.java

示例2: MultigetHandler

import org.apache.jackrabbit.webdav.property.DavPropertyName; //导入依赖的package包/类
public MultigetHandler(List<String> hrefs, boolean onlyEtag, String path, OmCalendar calendar, HttpClient client,
		AppointmentDao appointmentDao, IcalUtils utils) {
	super(path, calendar, client, appointmentDao, utils);
	this.onlyEtag = onlyEtag;

	if (hrefs == null || hrefs.isEmpty() || calendar.getSyncType() == SyncType.NONE) {
		isMultigetDisabled = true;
	} else {
		DavPropertyNameSet properties = new DavPropertyNameSet();
		properties.add(DavPropertyName.GETETAG);

		CalendarData calendarData = null;
		if (!onlyEtag) {
			calendarData = new CalendarData();
		}
		CompFilter vcalendar = new CompFilter(Calendar.VCALENDAR);
		vcalendar.addCompFilter(new CompFilter(Component.VEVENT));
		query = new CalendarMultiget(properties, calendarData, false, false);
		query.setHrefs(hrefs);
	}
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:22,代码来源:MultigetHandler.java

示例3: getAllPropSet

import org.apache.jackrabbit.webdav.property.DavPropertyName; //导入依赖的package包/类
/**
 * Builds a DavPropertyNameSet with all prop
 * For using instead of DavConstants.PROPFIND_ALL_PROP
 * @return
 */
public static DavPropertyNameSet getAllPropSet(){
    DavPropertyNameSet propSet = new DavPropertyNameSet();
    propSet.add(DavPropertyName.DISPLAYNAME);
    propSet.add(DavPropertyName.GETCONTENTTYPE);
    propSet.add(DavPropertyName.RESOURCETYPE);
    propSet.add(DavPropertyName.GETCONTENTLENGTH);
    propSet.add(DavPropertyName.GETLASTMODIFIED);
    propSet.add(DavPropertyName.CREATIONDATE);
    propSet.add(DavPropertyName.GETETAG);
    propSet.add(DavPropertyName.create(WebdavEntry.PROPERTY_QUOTA_USED_BYTES));
    propSet.add(DavPropertyName.create(WebdavEntry.PROPERTY_QUOTA_AVAILABLE_BYTES));
    propSet.add(WebdavEntry.EXTENDED_PROPERTY_NAME_PERMISSIONS,
            Namespace.getNamespace(WebdavEntry.NAMESPACE_OC));
    propSet.add(WebdavEntry.EXTENDED_PROPERTY_NAME_REMOTE_ID,
            Namespace.getNamespace(WebdavEntry.NAMESPACE_OC));
    propSet.add(WebdavEntry.EXTENDED_PROPERTY_NAME_SIZE,
            Namespace.getNamespace(WebdavEntry.NAMESPACE_OC));

    return propSet;
}
 
开发者ID:PicFrame,项目名称:picframe,代码行数:26,代码来源:WebdavUtils.java

示例4: getFilePropSet

import org.apache.jackrabbit.webdav.property.DavPropertyName; //导入依赖的package包/类
/**
 * Builds a DavPropertyNameSet with properties for files
 * @return
 */
public static DavPropertyNameSet getFilePropSet(){
    DavPropertyNameSet propSet = new DavPropertyNameSet();
    propSet.add(DavPropertyName.DISPLAYNAME);
    propSet.add(DavPropertyName.GETCONTENTTYPE);
    propSet.add(DavPropertyName.RESOURCETYPE);
    propSet.add(DavPropertyName.GETCONTENTLENGTH);
    propSet.add(DavPropertyName.GETLASTMODIFIED);
    propSet.add(DavPropertyName.CREATIONDATE);
    propSet.add(DavPropertyName.GETETAG);
    propSet.add(WebdavEntry.EXTENDED_PROPERTY_NAME_PERMISSIONS,
            Namespace.getNamespace(WebdavEntry.NAMESPACE_OC));
    propSet.add(WebdavEntry.EXTENDED_PROPERTY_NAME_REMOTE_ID,
            Namespace.getNamespace(WebdavEntry.NAMESPACE_OC));
    propSet.add(WebdavEntry.EXTENDED_PROPERTY_NAME_SIZE,
            Namespace.getNamespace(WebdavEntry.NAMESPACE_OC));

    return propSet;
}
 
开发者ID:PicFrame,项目名称:picframe,代码行数:23,代码来源:WebdavUtils.java

示例5: initProperties

import org.apache.jackrabbit.webdav.property.DavPropertyName; //导入依赖的package包/类
private void initProperties() {
    properties.add( new DefaultDavProperty<>( DavPropertyName.DISPLAYNAME, getDisplayName() ) );
    properties.add( new DefaultDavProperty<>( DavPropertyName.GETLASTMODIFIED, IOUtil.getLastModified( getModificationTime() ) ) );
    properties.add( new DefaultDavProperty<>( DavPropertyName.CREATIONDATE, IOUtil.getCreated( getCreationDate() ) ) );
    properties.add( new DefaultDavProperty<>( DavPropertyName.GETCONTENTLENGTH, getDavSize() ) );

    if( isDirectory ) {
        properties.add( new ResourceType( ResourceType.COLLECTION ) );
        properties.add( new DefaultDavProperty<>( DavPropertyName.ISCOLLECTION, "1" ) );

        long avail = getUsableSpace();
        long used = getUsedBytes( avail );

        properties.add( new DefaultDavProperty<>( DavPropertyName.create( "quota-used-bytes" ), "" + used ) );
        properties.add( new DefaultDavProperty<>( DavPropertyName.create( "quota-available-bytes" ), "" + avail ) );

    } else {
        properties.add( new ResourceType( ResourceType.DEFAULT_RESOURCE ) );
        properties.add( new DefaultDavProperty<>( DavPropertyName.ISCOLLECTION, "0" ) );
    }
}
 
开发者ID:openCage,项目名称:niodav,代码行数:22,代码来源:DavPath.java

示例6: toXml

import org.apache.jackrabbit.webdav.property.DavPropertyName; //导入依赖的package包/类
public Element toXml(Document document) {
    Element root = DomUtil.
        createElement(document, "principal-search-property-set",
                      NAMESPACE);

    Element psp = DomUtil.
        createElement(document, "principal-search-property",
                      NAMESPACE);
    root.appendChild(psp);

    Element prop = DomUtil.createElement(document, "prop", NAMESPACE);
    psp.appendChild(prop);

    prop.appendChild(DavPropertyName.DISPLAYNAME.toXml(document));

    // XXX I18N
    Element desc =
        DomUtil.createElement(document, "description", NAMESPACE);
    DomUtil.setAttribute(desc, "lang", NAMESPACE_XML, "en_US");
    DomUtil.setText(desc, "Display name");
    psp.appendChild(desc);

    return root;
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:25,代码来源:PrincipalSearchPropertySetReport.java

示例7: setLiveProperty

import org.apache.jackrabbit.webdav.property.DavPropertyName; //导入依赖的package包/类
/** */
protected void setLiveProperty(WebDavProperty property, boolean create)
    throws CosmoDavException {
    super.setLiveProperty(property, create);

    ContentItem content = (ContentItem) getItem();
    if (content == null) {
        return;
    }

    DavPropertyName name = property.getName();
    if (name.equals(DavPropertyName.GETCONTENTLENGTH)) {
        throw new ProtectedPropertyModificationException(name);
    }

    // content type is settable by subclasses
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:18,代码来源:DavContentBase.java

示例8: setLiveProperty

import org.apache.jackrabbit.webdav.property.DavPropertyName; //导入依赖的package包/类
/** */
protected void setLiveProperty(WebDavProperty property, boolean create)
        throws CosmoDavException {
    super.setLiveProperty(property, create);

    CollectionItem cc = (CollectionItem) getItem();
    if (cc == null) {
        return;
    }

    DavPropertyName name = property.getName();
    if (property.getValue() == null) {
        throw new UnprocessableEntityException("Property " + name
                + " requires a value");
    }

    if (name.equals(EXCLUDEFREEBUSYROLLUP)) {
        Boolean flag = Boolean.valueOf(property.getValueText());
        cc.setExcludeFreeBusyRollup(flag);
    }
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:22,代码来源:DavCollectionBase.java

示例9: setResourceProperty

import org.apache.jackrabbit.webdav.property.DavPropertyName; //导入依赖的package包/类
/**
 * Calls {@link #setLiveProperty(WebDavProperty)} or
 * {@link setDeadProperty(WebDavProperty)}.
 */
protected void setResourceProperty(WebDavProperty property, boolean create)
    throws CosmoDavException {
    DavPropertyName name = property.getName();
    if (name.equals(SUPPORTEDREPORTSET)) {
        throw new ProtectedPropertyModificationException(name);
    }

    if (isLiveProperty(property.getName())) {
        setLiveProperty(property, create);
    }
    else { 
        setDeadProperty(property);
    }
    
    properties.add(property);
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:21,代码来源:DavResourceBase.java

示例10: removeResourceProperty

import org.apache.jackrabbit.webdav.property.DavPropertyName; //导入依赖的package包/类
/**
 * Calls {@link #removeLiveProperty(DavPropertyName)} or
 * {@link removeDeadProperty(DavPropertyName)}.
 */
protected void removeResourceProperty(DavPropertyName name)
    throws CosmoDavException {
    if (name.equals(SUPPORTEDREPORTSET)) {
        throw new ProtectedPropertyModificationException(name);
    }

    if (isLiveProperty(name)) {
        removeLiveProperty(name);
    }
    else {         
        removeDeadProperty(name);
    }
    
    properties.remove(name);
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:20,代码来源:DavResourceBase.java

示例11: setLiveProperty

import org.apache.jackrabbit.webdav.property.DavPropertyName; //导入依赖的package包/类
protected void setLiveProperty(WebDavProperty property, boolean create)
        throws CosmoDavException {
    if (item == null) {
        return;
    }

    DavPropertyName name = property.getName();
    if (property.getValue() == null) {
        throw new UnprocessableEntityException("Property " + name
                + " requires a value");
    }

    if (name.equals(DavPropertyName.CREATIONDATE)
            || name.equals(DavPropertyName.GETLASTMODIFIED)
            || name.equals(DavPropertyName.GETETAG)
            || name.equals(DavPropertyName.RESOURCETYPE)
            || name.equals(DavPropertyName.ISCOLLECTION)
            || name.equals(OWNER) || name.equals(PRINCIPALCOLLECTIONSET)
            || name.equals(TICKETDISCOVERY) || name.equals(UUID)) {
        throw new ProtectedPropertyModificationException(name);
    }

    if (name.equals(DavPropertyName.DISPLAYNAME)) {
        item.setDisplayName(property.getValueText());
    }
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:27,代码来源:DavItemResourceBase.java

示例12: removeLiveProperty

import org.apache.jackrabbit.webdav.property.DavPropertyName; //导入依赖的package包/类
protected void removeLiveProperty(DavPropertyName name)
        throws CosmoDavException {
    if (item == null) {
        return;
    }

    if (name.equals(DavPropertyName.CREATIONDATE)
            || name.equals(DavPropertyName.GETLASTMODIFIED)
            || name.equals(DavPropertyName.GETETAG)
            || name.equals(DavPropertyName.DISPLAYNAME)
            || name.equals(DavPropertyName.RESOURCETYPE)
            || name.equals(DavPropertyName.ISCOLLECTION)
            || name.equals(OWNER) || name.equals(PRINCIPALCOLLECTIONSET)
            || name.equals(TICKETDISCOVERY) || name.equals(UUID)) {
        throw new ProtectedPropertyModificationException(name);
    }

    getProperties().remove(name);
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:20,代码来源:DavItemResourceBase.java

示例13: loadDeadProperties

import org.apache.jackrabbit.webdav.property.DavPropertyName; //导入依赖的package包/类
protected void loadDeadProperties(DavPropertySet properties) {
    for (Iterator<Map.Entry<QName, Attribute>> i = item.getAttributes()
            .entrySet().iterator(); i.hasNext();) {
        Map.Entry<QName, Attribute> entry = i.next();

        // skip attributes that are not meant to be shown as dead
        // properties
        if (getDeadPropertyFilter().contains(entry.getKey().getNamespace())) {
            continue;
        }

        DavPropertyName propName = qNameToPropName(entry.getKey());

        // ignore live properties, as they'll be loaded separately
        if (isLiveProperty(propName)) {
            continue;
        }

        // XXX: language
        Object propValue = entry.getValue().getValue();
        properties.add(new StandardDavProperty(propName, propValue, false));
    }
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:24,代码来源:DavItemResourceBase.java

示例14: toXml

import org.apache.jackrabbit.webdav.property.DavPropertyName; //导入依赖的package包/类
/**
 * toXML.
 * {@inheritDoc}
 * @param doc - The document.
 * @return The element.
 */
public Element toXml(Document doc) {
    Element propfind = DomUtil.createElement(doc, XML_PROPFIND, NAMESPACE);

    if (propertyNames.isEmpty()) {
        // allprop
        Element allprop =
            DomUtil.createElement(doc, XML_ALLPROP, NAMESPACE);
        propfind.appendChild(allprop);
    }
    else {
        for (DavPropertyName propname: propertyNames) {
            Element name =
                DomUtil.createElement(doc, propname.getName(),
                                      propname.getNamespace());

            Element prop = DomUtil.createElement(doc, XML_PROP, NAMESPACE);
            prop.appendChild(name);

            propfind.appendChild(prop);
        }
    }

    return propfind;
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:31,代码来源:PropFindContent.java

示例15: create

import org.apache.jackrabbit.webdav.property.DavPropertyName; //导入依赖的package包/类
public FileContentInfo create(FileContent fileContent) throws FileSystemException
{
    WebdavFileObject file = (WebdavFileObject) (FileObjectUtils
        .getAbstractFileObject(fileContent.getFile()));

    String contentType = null;
    String contentEncoding = null;

    DavPropertyNameSet nameSet = new DavPropertyNameSet();
    nameSet.add(DavPropertyName.GETCONTENTTYPE);
    DavPropertySet propertySet = file.getProperties((URLFileName) file.getName(), nameSet, true);

    DavProperty property = propertySet.get(DavPropertyName.GETCONTENTTYPE);
    if (property != null)
    {
        contentType = (String) property.getValue();
    }
    property = propertySet.get(WebdavFileObject.RESPONSE_CHARSET);
    if (property != null)
    {
        contentEncoding = (String) property.getValue();
    }

    return new DefaultFileContentInfo(contentType, contentEncoding);
}
 
开发者ID:wso2,项目名称:wso2-commons-vfs,代码行数:26,代码来源:WebdavFileContentInfoFactory.java


注:本文中的org.apache.jackrabbit.webdav.property.DavPropertyName类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。