本文整理汇总了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;
}
示例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);
}
}
示例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;
}
示例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;
}
示例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" ) );
}
}
示例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;
}
示例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
}
示例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);
}
}
示例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);
}
示例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);
}
示例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());
}
}
示例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);
}
示例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));
}
}
示例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;
}
示例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);
}