• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java DavPropertyName类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: addRequiredProperties

import org.apache.jackrabbit.webdav.property.DavPropertyName; //导入依赖的package包/类
private void addRequiredProperties() {
    if (underLineResource instanceof Collection) {
        addDavProperty(DavPropertyName.RESOURCETYPE, new ResourceType(ResourceType.COLLECTION));
        // Windows XP support
        addDavProperty(DavPropertyName.ISCOLLECTION, "1");
    } else {
        addDavProperty(DavPropertyName.RESOURCETYPE, new ResourceType(ResourceType.DEFAULT_RESOURCE));
        // Windows XP support
        addDavProperty(DavPropertyName.ISCOLLECTION, "0");
        addDavProperty(DavPropertyName.GETCONTENTLENGTH, getContentLength());
        addDavProperty(DavPropertyName.GETCONTENTTYPE, underLineResource.getMediaType());
    }

    addDavProperty(DavPropertyName.create("author"), underLineResource.getAuthorUserName());
    addDavProperty(DavPropertyName.GETETAG, getETag());
    addDavProperty(DavPropertyName.DISPLAYNAME, getDisplayName());
    addDavProperty(DavPropertyName.CREATIONDATE, DavConstants.creationDateFormat.format(
                                                                               underLineResource.getCreatedTime()));
    addDavProperty(DavPropertyName.GETLASTMODIFIED, DavConstants.modificationDateFormat.format(
                                                                              underLineResource.getLastModified()));

}
 
开发者ID:wso2,项目名称:carbon-registry,代码行数:23,代码来源:RegistryResource.java


示例17: getProperty

import org.apache.jackrabbit.webdav.property.DavPropertyName; //导入依赖的package包/类
public DavProperty getProperty(final DavPropertyName name) {
	DavProperty property = properties.get(name);
	if(property != null){
		return property;
	}else{
		return new DavProperty() {
			public Element toXml(Document document) {
				return null;
			}
			public boolean isInvisibleInAllprop() {
				return false;
			}
			public Object getValue() {
				return getUnderlineResource().getProperty(name.getName());
			}
			public DavPropertyName getName() {
				return name;
			}
		};
	}
}
 
开发者ID:wso2,项目名称:carbon-registry,代码行数:22,代码来源:RegistryResource.java


示例18: initProperties

import org.apache.jackrabbit.webdav.property.DavPropertyName; //导入依赖的package包/类
/**
 * Fill the set of properties
 */
protected void initProperties()
{
    if ( !exists() || propsInitialized )
    {
        return;
    }

    // set (or reset) fundamental properties
    if ( getDisplayName() != null )
    {
        properties.add( new DefaultDavProperty( DavPropertyName.DISPLAYNAME, getDisplayName() ) );
    }
    if ( isCollection() )
    {
        properties.add( new ResourceType( ResourceType.COLLECTION ) );
        // Windows XP support
        properties.add( new DefaultDavProperty( DavPropertyName.ISCOLLECTION, "1" ) );
    }
    else
    {
        properties.add( new ResourceType( ResourceType.DEFAULT_RESOURCE ) );

        // Windows XP support
        properties.add( new DefaultDavProperty( DavPropertyName.ISCOLLECTION, "0" ) );
    }

    // Need to get the ISO8601 date for properties
    DateTime dt = new DateTime( 0 );
    DateTimeFormatter fmt = ISODateTimeFormat.dateTime();
    String modifiedDate = fmt.print( dt );

    properties.add( new DefaultDavProperty( DavPropertyName.GETLASTMODIFIED, modifiedDate ) );

    properties.add( new DefaultDavProperty( DavPropertyName.CREATIONDATE, modifiedDate ) );

    properties.add( new DefaultDavProperty( DavPropertyName.GETCONTENTLENGTH, 0 ) );

    propsInitialized = true;
}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:43,代码来源:ArchivaVirtualDavResource.java


示例19: setMeta

import org.apache.jackrabbit.webdav.property.DavPropertyName; //导入依赖的package包/类
/**
 * set meta information on this dav's resource.
 * if the property value is null, that property will be removed.
 * otherwise, the property will be either added or updated.
 * @param metas
 * @return
 */
public boolean setMeta(WspaceMeta ... metas) {
    if (metas == null) return false;
    for(WspaceMeta meta : metas) {

        Map<String, String> props = meta.getProperties();
        if (props != null && props.size() > 0) {
            DavPropertySet newProps=new DavPropertySet();
            DavPropertyNameSet removeProps=new DavPropertyNameSet();

            for (String key : props.keySet()) {
                String v = props.get(key);
                if (v == null) {
                    removeProps.add(DavPropertyName.create(key, IRSA_NS));
                } else {
                    DavProperty p = new DefaultDavProperty(key, props.get(key), IRSA_NS);
                    newProps.add(p);
                }
            }
            try {
                PropPatchMethod proPatch=new PropPatchMethod(getResourceUrl(meta.getRelPath()), newProps, removeProps);
                if ( !executeMethod(proPatch)) {
                    // handle error
                    System.out.println("Unable to update property:" + newProps.toString() +  " -- " + proPatch.getStatusText());
                    return false;
                }
                return true;
            } catch (IOException e) {
                LOG.error(e, "Error while setting property: " + meta);
                e.printStackTrace();
            }

        }

    }
    return false;
}
 
开发者ID:lsst,项目名称:firefly,代码行数:44,代码来源:WorkspaceManager.java


示例20: getProperty

import org.apache.jackrabbit.webdav.property.DavPropertyName; //导入依赖的package包/类
@Override
    public
    @Nullable
    DavProperty<?> getProperty( @Nullable DavPropertyName propertyName ) {
//        System.out.println( "prop name " + aPropertyName.getName() );
        return properties.get( propertyName );
    }
 
开发者ID:openCage,项目名称:niodav,代码行数:8,代码来源:DavPath.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java NamenodeRegistration类代码示例发布时间:2022-05-22
下一篇:
Java OFFeaturesRequest类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap