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


Java Namespace类代码示例

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


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

示例1: getAllPropSet

import org.apache.jackrabbit.webdav.xml.Namespace; //导入依赖的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

示例2: getFilePropSet

import org.apache.jackrabbit.webdav.xml.Namespace; //导入依赖的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

示例3: toXml

import org.apache.jackrabbit.webdav.xml.Namespace; //导入依赖的package包/类
public Element toXml(Document document) {
    Element name = getName().toXml(document);

    for (QName qn : getQnames()) {
        Namespace ns =
            Namespace.getNamespace(qn.getPrefix(), qn.getNamespaceURI());
        Element e =
            DomUtil.createElement(document, qn.getLocalPart(), ns);
        name.appendChild(e);
    }

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

示例4: toXml

import org.apache.jackrabbit.webdav.xml.Namespace; //导入依赖的package包/类
/**
 * 
 * {@inheritDoc}
 */
public Element toXml(Document document) {
    Element name = getName().toXml(document);

    for (String type : getComponentTypes()) {
        Element e = DomUtil.createElement(document,
                ELEMENT_CALDAV_COMP, NAMESPACE_CALDAV);
        DomUtil.setAttribute(e, ATTR_CALDAV_NAME,  Namespace.EMPTY_NAMESPACE, 
                type);
        name.appendChild(e);
    }

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

示例5: propNameToQName

import org.apache.jackrabbit.webdav.xml.Namespace; //导入依赖的package包/类
private QName propNameToQName(DavPropertyName name) {
    if (name == null) {
        final String msg = "name cannot be null";
        throw new IllegalArgumentException(msg);
    }

    Namespace ns = name.getNamespace();
    String uri = ns != null ? ns.getURI() : "";

    return entityFactory.createQName(uri, name.getName());
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:12,代码来源:DavItemResourceBase.java

示例6: qNameToPropName

import org.apache.jackrabbit.webdav.xml.Namespace; //导入依赖的package包/类
private DavPropertyName qNameToPropName(QName qname) {
    // no namespace at all
    if ("".equals(qname.getNamespace())) {
        return DavPropertyName.create(qname.getLocalName());
    }

    Namespace ns = Namespace.getNamespace(qname.getNamespace());

    return DavPropertyName.create(qname.getLocalName(), ns);
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:11,代码来源:DavItemResourceBase.java

示例7: findProp

import org.apache.jackrabbit.webdav.xml.Namespace; //导入依赖的package包/类
/**
 * Finds Prop.
 * @param name The name.
 * @param ns The namespace.
 * @return The element.
 */
public Element findProp(String name,  Namespace ns) {
    for (Element prop : props) {
        if (DomUtil.matches(prop, name, ns)) {
            return prop;
        }
    }
    return null;
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:15,代码来源:MultiStatus.java

示例8: doSetAttribute

import org.apache.jackrabbit.webdav.xml.Namespace; //导入依赖的package包/类
/**
 * Sets an attribute of this file.  Is only called if {@link #doGetType}
 * does not return {@link FileType#IMAGINARY}.
 * <p/>
 * This implementation throws an exception.
 */
@Override
protected void doSetAttribute(final String attrName, final Object value)
    throws Exception
{
    try
    {
        URLFileName fileName = (URLFileName) getName();
        String urlStr = urlString(fileName);
        DavPropertySet properties = new DavPropertySet();
        DavPropertyNameSet propertyNameSet = new DavPropertyNameSet();
        DavProperty property = new DefaultDavProperty(attrName, value, Namespace.EMPTY_NAMESPACE);
        if (value != null)
        {
            properties.add(property);
        }
        else
        {
            propertyNameSet.add(property.getName()); // remove property
        }

        PropPatchMethod method = new PropPatchMethod(urlStr, properties, propertyNameSet);
        setupMethod(method);
        execute(method);
        if (!method.succeeded())
        {
            throw new FileSystemException("Property '" + attrName + "' could not be set.");
        }
    }
    catch (FileSystemException fse)
    {
        throw fse;
    }
    catch (Exception e)
    {
        throw new FileSystemException("vfs.provider.webdav/propfind.error", getName(), e);
    }
}
 
开发者ID:wso2,项目名称:wso2-commons-vfs,代码行数:44,代码来源:WebdavFileObject.java

示例9: doSetAttribute

import org.apache.jackrabbit.webdav.xml.Namespace; //导入依赖的package包/类
/**
 * Sets an attribute of this file.  Is only called if {@link #doGetType}
 * does not return {@link FileType#IMAGINARY}.
 * <p/>
 * This implementation throws an exception.
 */
protected void doSetAttribute(final String attrName, final Object value)
    throws Exception
{
    try
    {
        URLFileName fileName = (URLFileName) getName();
        String urlStr = urlString(fileName);
        DavPropertySet properties = new DavPropertySet();
        DavPropertyNameSet propertyNameSet = new DavPropertyNameSet();
        DavProperty property = new DefaultDavProperty(attrName, value, Namespace.EMPTY_NAMESPACE);
        if (value != null)
        {
            properties.add(property);
        }
        else
        {
            propertyNameSet.add(property.getName()); // remove property
        }

        PropPatchMethod method = new PropPatchMethod(urlStr, properties, propertyNameSet);
        setupMethod(method);
        execute(method);
        if (!method.succeeded())
        {
            throw new FileSystemException("Property '" + attrName + "' could not be set.");
        }
    }
    catch (FileSystemException fse)
    {
        throw fse;
    }
    catch(Exception e)
    {
        throw new FileSystemException("vfs.provider.webdav/propfind.error", getName(), e);
    }
}
 
开发者ID:pentaho,项目名称:pdi-vfs,代码行数:43,代码来源:WebdavFileObject.java

示例10: addProperty

import org.apache.jackrabbit.webdav.xml.Namespace; //导入依赖的package包/类
public void addProperty(String name, Namespace namespace) {
	this.addProperty(DavPropertyName.create(name, namespace));
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:4,代码来源:SyncReportInfo.java

示例11: qn

import org.apache.jackrabbit.webdav.xml.Namespace; //导入依赖的package包/类
private static final CosmoQName qn(Namespace ns,
                              String local) {
    return new CosmoQName(ns.getURI(), local, ns.getPrefix());
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:5,代码来源:DavPrivilege.java

示例12: ns

import org.apache.jackrabbit.webdav.xml.Namespace; //导入依赖的package包/类
private static final Namespace ns(CosmoQName qn) {
    return Namespace.getNamespace(qn.getPrefix(), qn.getNamespaceURI());
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:4,代码来源:DavPrivilege.java


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