本文整理汇总了Java中org.apache.jackrabbit.webdav.property.DavPropertySet类的典型用法代码示例。如果您正苦于以下问题:Java DavPropertySet类的具体用法?Java DavPropertySet怎么用?Java DavPropertySet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DavPropertySet类属于org.apache.jackrabbit.webdav.property包,在下文中一共展示了DavPropertySet类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: internalSyncItems
import org.apache.jackrabbit.webdav.property.DavPropertySet; //导入依赖的package包/类
@Override
DavMethodBase internalSyncItems() throws IOException, DavException {
//Calendar already inited.
DavPropertyNameSet properties = new DavPropertyNameSet();
properties.add(DNAME_GETCTAG);
PropFindMethod method = new PropFindMethod(path, properties, CalDAVConstants.DEPTH_0);
client.executeMethod(method);
if (method.succeeded()) {
for (MultiStatusResponse response : method.getResponseBodyAsMultiStatus().getResponses()) {
DavPropertySet set = response.getProperties(SC_OK);
String ctag = AppointmentManager.getTokenFromProperty(set.get(DNAME_GETCTAG));
if (ctag != null && !ctag.equals(calendar.getToken())) {
EtagsHandler etagsHandler = new EtagsHandler(path, calendar, client, appointmentDao, utils);
etagsHandler.syncItems();
calendar.setToken(ctag);
}
}
} else {
log.error("Error executing PROPFIND Method, with status Code: {}", method.getStatusCode());
}
return method;
}
开发者ID:apache,项目名称:openmeetings,代码行数:27,代码来源:CtagHandler.java
示例2: convertToWspaceMeta
import org.apache.jackrabbit.webdav.property.DavPropertySet; //导入依赖的package包/类
private WspaceMeta convertToWspaceMeta(WspaceMeta meta, MultiStatusResponse res) {
if (meta == null) {
meta = new WspaceMeta(getWsHome(), res.getHref().replaceFirst(getWsHome(), ""));
}
DavPropertySet props = res.getProperties(200);
if (props != null) {
for (DavProperty p : props) {
String name = (p == null || p.getName() == null) ? null : p.getName().getName();
if (name != null) {
String v = String.valueOf(p.getValue());
if (name.equals(DavConstants.PROPERTY_GETLASTMODIFIED)) {
meta.setLastModified(v);
} else if (name.equals(DavConstants.PROPERTY_GETCONTENTLENGTH)) {
try {
meta.setSize(Long.parseLong(v));
} catch (Exception e) {}
} else if (name.equals(DavConstants.PROPERTY_GETCONTENTTYPE)) {
meta.setContentType(v);
} else if (p.getName().getNamespace().equals(IRSA_NS)) {
meta.setProperty(name, String.valueOf(p.getValue()));
}
}
}
}
return meta;
}
开发者ID:lsst,项目名称:firefly,代码行数:27,代码来源:WorkspaceManager.java
示例3: loadLiveProperties
import org.apache.jackrabbit.webdav.property.DavPropertySet; //导入依赖的package包/类
protected void loadLiveProperties(DavPropertySet properties) {
properties.add(new CreationDate(user.getCreationDate()));
properties.add(new DisplayName(getDisplayName()));
properties.add(new ResourceType(getResourceTypes()));
properties.add(new IsCollection(isCollection()));
properties.add(new Etag(user.getEntityTag()));
properties.add(new LastModified(user.getModifiedDate()));
properties.add(new CalendarHomeSet(getResourceLocator(), user));
// for now scheduling is an option
if(isSchedulingEnabled()) {
properties.add(new CalendarUserAddressSet(user, userIdentitySupplier));
properties.add(new ScheduleInboxURL(getResourceLocator(), user));
properties.add(new ScheduleOutboxURL(getResourceLocator(), user));
}
properties.add(new AlternateUriSet());
properties.add(new PrincipalUrl(getResourceLocator(), user));
properties.add(new GroupMembership());
}
开发者ID:1and1,项目名称:cosmo,代码行数:21,代码来源:DavUserPrincipal.java
示例4: proppatch
import org.apache.jackrabbit.webdav.property.DavPropertySet; //导入依赖的package包/类
/**
*
* {@inheritDoc}
*/
public void proppatch(DavRequest request,
DavResponse response,
WebDavResource resource)
throws CosmoDavException, IOException {
if (! resource.exists()){
throw new NotFoundException();
}
DavPropertySet set = request.getProppatchSetProperties();
DavPropertyNameSet remove = request.getProppatchRemoveProperties();
MultiStatus ms = new MultiStatus();
MultiStatusResponse msr = resource.updateProperties(set, remove);
ms.addResponse(msr);
response.sendMultiStatus(ms);
}
开发者ID:1and1,项目名称:cosmo,代码行数:21,代码来源:BaseProvider.java
示例5: loadLiveProperties
import org.apache.jackrabbit.webdav.property.DavPropertySet; //导入依赖的package包/类
/** */
protected void loadLiveProperties(DavPropertySet properties) {
super.loadLiveProperties(properties);
FileItem content = (FileItem) getItem();
if (content == null) {
return;
}
if (content.getContentLanguage() != null) {
properties.add(new ContentLanguage(content.getContentLanguage()));
}
properties.add(new ContentLength(content.getContentLength()));
properties.add(new ContentType(content.getContentType(),
content.getContentEncoding()));
}
开发者ID:1and1,项目名称:cosmo,代码行数:17,代码来源:DavFile.java
示例6: loadLiveProperties
import org.apache.jackrabbit.webdav.property.DavPropertySet; //导入依赖的package包/类
protected void loadLiveProperties(DavPropertySet properties) {
if (item == null) {
return;
}
properties.add(new CreationDate(item.getCreationDate()));
properties.add(new LastModified(item.getModifiedDate()));
properties.add(new Etag(getETag()));
properties.add(new DisplayName(getDisplayName()));
properties.add(new ResourceType(getResourceTypes()));
properties.add(new IsCollection(isCollection()));
properties.add(new Owner(getResourceLocator(), item.getOwner()));
properties.add(new PrincipalCollectionSet(getResourceLocator()));
properties.add(new TicketDiscovery(getResourceLocator(), getTickets()));
properties.add(new Uuid(item.getUid()));
}
开发者ID:1and1,项目名称:cosmo,代码行数:17,代码来源:DavItemResourceBase.java
示例7: loadDeadProperties
import org.apache.jackrabbit.webdav.property.DavPropertySet; //导入依赖的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
示例8: create
import org.apache.jackrabbit.webdav.property.DavPropertySet; //导入依赖的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
示例9: ArchivaVirtualDavResource
import org.apache.jackrabbit.webdav.property.DavPropertySet; //导入依赖的package包/类
public ArchivaVirtualDavResource( List<File> localResources, String logicalResource, MimeTypes mimeTypes,
ArchivaDavResourceLocator locator, DavResourceFactory factory )
{
this.localResources = localResources;
this.logicalResource = logicalResource;
this.locator = locator;
this.factory = factory;
this.properties = new DavPropertySet();
}
开发者ID:ruikom,项目名称:apache-archiva,代码行数:10,代码来源:ArchivaVirtualDavResource.java
示例10: setMeta
import org.apache.jackrabbit.webdav.property.DavPropertySet; //导入依赖的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
示例11: DavPath
import org.apache.jackrabbit.webdav.property.DavPropertySet; //导入依赖的package包/类
@SuppressWarnings( "PMD.ConstructorCallsOverridableMethod" )
DavPath( Path file, DavSession session, PathDavFactory davResourceFactory, DavResourceLocator davResourceLocator, LockManager lockManager ) {
this.file = file;
this.pathDavFactory = davResourceFactory;
this.resourceLocator = davResourceLocator;
this.session = session;
this.properties = new DavPropertySet();
this.isDirectory = Files.isDirectory( file );
this.lockManager = lockManager;
initProperties();
}
开发者ID:openCage,项目名称:niodav,代码行数:13,代码来源:DavPath.java
示例12: loadLiveProperties
import org.apache.jackrabbit.webdav.property.DavPropertySet; //导入依赖的package包/类
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()));
}
开发者ID:1and1,项目名称:cosmo,代码行数:8,代码来源:DavUserPrincipalCollection.java
示例13: mkcalendar
import org.apache.jackrabbit.webdav.property.DavPropertySet; //导入依赖的package包/类
@Override
public void mkcalendar(DavRequest request, DavResponse response, DavCollection collection)
throws CosmoDavException, IOException {
if (collection.exists()) {
throw new ExistsException();
}
DavItemCollection parent = (DavItemCollection) collection.getParent();
if (!parent.exists()) {
throw new MissingParentException("One or more intermediate collections must be created");
}
if (parent.isCalendarCollection()) {
throw new InvalidCalendarLocationException(
"A calendar collection may not be created within a calendar collection");
}
// XXX DAV:needs-privilege DAV:bind on parent collection
if (LOG.isDebugEnabled()) {
LOG.debug("MKCALENDAR at " + collection.getResourcePath());
}
DavPropertySet properties = request.getMkCalendarSetProperties();
MultiStatusResponse msr = collection.getParent().addCollection(collection, properties);
if (properties.isEmpty() || !hasNonOK(msr)) {
response.setStatus(201);
response.setHeader("Cache-control", "no-cache");
response.setHeader("Pragma", "no-cache");
return;
}
MultiStatus ms = new MultiStatus();
ms.addResponse(msr);
response.sendMultiStatus(ms);
}
开发者ID:1and1,项目名称:cosmo,代码行数:36,代码来源:CalendarCollectionProvider.java
示例14: addCollection
import org.apache.jackrabbit.webdav.property.DavPropertySet; //导入依赖的package包/类
public MultiStatusResponse addCollection(DavCollection collection, DavPropertySet properties) throws CosmoDavException {
if(!(collection instanceof DavCollectionBase)){
throw new IllegalArgumentException("Expected instance of :[" + DavCollectionBase.class.getName() + "]");
}
DavCollectionBase base = (DavCollectionBase) collection;
base.populateItem(null);
MultiStatusResponse msr = base.populateAttributes(properties);
if (!hasNonOK(msr)) {
saveSubcollection(base);
members.add(base);
}
return msr;
}
开发者ID:1and1,项目名称:cosmo,代码行数:15,代码来源:DavCollectionBase.java
示例15: loadLiveProperties
import org.apache.jackrabbit.webdav.property.DavPropertySet; //导入依赖的package包/类
/** */
protected void loadLiveProperties(DavPropertySet properties) {
super.loadLiveProperties(properties);
CollectionItem cc = (CollectionItem) getItem();
if (cc == null) {
return;
}
properties.add(new ExcludeFreeBusyRollup(cc.isExcludeFreeBusyRollup()));
}
开发者ID:1and1,项目名称:cosmo,代码行数:12,代码来源:DavCollectionBase.java
示例16: DavResourceBase
import org.apache.jackrabbit.webdav.property.DavPropertySet; //导入依赖的package包/类
public DavResourceBase(DavResourceLocator locator,
DavResourceFactory factory)
throws CosmoDavException {
this.locator = locator;
this.factory = factory;
this.properties = new DavPropertySet();
this.initialized = false;
}
开发者ID:1and1,项目名称:cosmo,代码行数:9,代码来源:DavResourceBase.java
示例17: loadLiveProperties
import org.apache.jackrabbit.webdav.property.DavPropertySet; //导入依赖的package包/类
/** */
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"));
}
开发者ID:1and1,项目名称:cosmo,代码行数:14,代码来源:DavCalendarResource.java
示例18: updateProperties
import org.apache.jackrabbit.webdav.property.DavPropertySet; //导入依赖的package包/类
public MultiStatusResponse updateProperties(DavPropertySet setProperties,
DavPropertyNameSet removePropertyNames) throws CosmoDavException {
MultiStatusResponse msr = super.updateProperties(setProperties,
removePropertyNames);
if (hasNonOK(msr)) {
return msr;
}
updateItem();
return msr;
}
开发者ID:1and1,项目名称:cosmo,代码行数:13,代码来源:DavItemResourceBase.java
示例19: getProppatchSetProperties
import org.apache.jackrabbit.webdav.property.DavPropertySet; //导入依赖的package包/类
/**
*
* {@inheritDoc}
*/
public DavPropertySet getProppatchSetProperties() throws CosmoDavException {
if (proppatchSet == null) {
parsePropPatchRequest();
}
return proppatchSet;
}
开发者ID:1and1,项目名称:cosmo,代码行数:11,代码来源:StandardDavRequest.java
示例20: getMkCalendarSetProperties
import org.apache.jackrabbit.webdav.property.DavPropertySet; //导入依赖的package包/类
/**
*
* {@inheritDoc}
*/
public DavPropertySet getMkCalendarSetProperties() throws CosmoDavException {
if (mkcalendarSet == null) {
mkcalendarSet = parseMkCalendarRequest();
}
return mkcalendarSet;
}
开发者ID:1and1,项目名称:cosmo,代码行数:11,代码来源:StandardDavRequest.java
注:本文中的org.apache.jackrabbit.webdav.property.DavPropertySet类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论