本文整理汇总了Java中org.apache.jackrabbit.webdav.property.DavPropertyNameSet类的典型用法代码示例。如果您正苦于以下问题:Java DavPropertyNameSet类的具体用法?Java DavPropertyNameSet怎么用?Java DavPropertyNameSet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DavPropertyNameSet类属于org.apache.jackrabbit.webdav.property包,在下文中一共展示了DavPropertyNameSet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: internalSyncItems
import org.apache.jackrabbit.webdav.property.DavPropertyNameSet; //导入依赖的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;
}
示例2: MultigetHandler
import org.apache.jackrabbit.webdav.property.DavPropertyNameSet; //导入依赖的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.DavPropertyNameSet; //导入依赖的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.DavPropertyNameSet; //导入依赖的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: runQuery
import org.apache.jackrabbit.webdav.property.DavPropertyNameSet; //导入依赖的package包/类
/**
* Resolves the hrefs provided in the report info to resources.
*/
protected void runQuery()
throws CosmoDavException {
DavPropertyNameSet propspec = createResultPropSpec();
if (getResource() instanceof DavCollection) {
DavCollection collection = (DavCollection) getResource();
for (String href : hrefs) {
WebDavResource target = collection.findMember(href);
if (target != null) {
getMultiStatus().addResponse(buildMultiStatusResponse(target, propspec));
}
else {
getMultiStatus().addResponse(new MultiStatusResponse(href,404));
}
}
return;
}
if (getResource() instanceof DavCalendarResource) {
getMultiStatus().addResponse(buildMultiStatusResponse(getResource(), propspec));
return;
}
throw new UnprocessableEntityException(getType() + " report not supported for non-calendar resources");
}
示例6: proppatch
import org.apache.jackrabbit.webdav.property.DavPropertyNameSet; //导入依赖的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);
}
示例7: create
import org.apache.jackrabbit.webdav.property.DavPropertyNameSet; //导入依赖的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);
}
示例8: setMeta
import org.apache.jackrabbit.webdav.property.DavPropertyNameSet; //导入依赖的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;
}
示例9: buildMultistatus
import org.apache.jackrabbit.webdav.property.DavPropertyNameSet; //导入依赖的package包/类
public final void buildMultistatus() throws CosmoDavException {
DavPropertyNameSet resultProps = createResultPropSpec();
for (WebDavResource result : getResults()) {
MultiStatusResponse msr =
buildMultiStatusResponse(result, resultProps);
multistatus.addResponse(msr);
}
}
示例10: buildMultiStatusResponse
import org.apache.jackrabbit.webdav.property.DavPropertyNameSet; //导入依赖的package包/类
/**
* Returns a <code>MultiStatusResponse</code> describing the
* specified resource including the specified properties.
*/
protected MultiStatusResponse
buildMultiStatusResponse(WebDavResource resource,
DavPropertyNameSet props)
throws CosmoDavException {
if (props.isEmpty()) {
String href = resource.getResourceLocator().
getHref(resource.isCollection());
return new MultiStatusResponse(href, 200);
}
return new MultiStatusResponse(resource, props, propfindType);
}
示例11: buildMultiStatusResponse
import org.apache.jackrabbit.webdav.property.DavPropertyNameSet; //导入依赖的package包/类
/**
* Includes the resource's calendar data in the response as the
* <code>CALDAV:calendar-data</code> property if it was requested. The
* calendar data is filtered if a filter was included in the request.
*/
protected MultiStatusResponse
buildMultiStatusResponse(WebDavResource resource,
DavPropertyNameSet props)
throws CosmoDavException {
MultiStatusResponse msr =
super.buildMultiStatusResponse(resource, props);
DavCalendarResource dcr = (DavCalendarResource) resource;
if (getPropFindProps().contains(CALENDARDATA)) {
msr.add(new CalendarData(readCalendarData(dcr)));
}
return msr;
}
示例12: propfind
import org.apache.jackrabbit.webdav.property.DavPropertyNameSet; //导入依赖的package包/类
/**
*
* {@inheritDoc}
*/
public void propfind(DavRequest request,
DavResponse response,
WebDavResource resource)
throws CosmoDavException, IOException {
if (! resource.exists()){
throw new NotFoundException();
}
int depth = getDepth(request);
if (depth != DEPTH_0 && ! resource.isCollection()){
throw new BadRequestException("Depth must be 0 for non-collection resources");
}
DavPropertyNameSet props = null;
int type = -1;
try{
props = request.getPropFindProperties();
type =request.getPropFindType();
}catch(DavException de){
throw new CosmoDavException(de);
}
// Since the propfind properties could not be determined in the
// security filter in order to check specific property privileges, the
// check must be done manually here.
checkPropFindAccess(resource, props, type);
MultiStatus ms = new MultiStatus();
ms.addResourceProperties(resource, props, type, depth);
response.sendMultiStatus(ms);
}
示例13: updateProperties
import org.apache.jackrabbit.webdav.property.DavPropertyNameSet; //导入依赖的package包/类
public MultiStatusResponse updateProperties(DavPropertySet setProperties,
DavPropertyNameSet removePropertyNames) throws CosmoDavException {
MultiStatusResponse msr = super.updateProperties(setProperties,
removePropertyNames);
if (hasNonOK(msr)) {
return msr;
}
updateItem();
return msr;
}
示例14: getPropFindProperties
import org.apache.jackrabbit.webdav.property.DavPropertyNameSet; //导入依赖的package包/类
/**
*
* {@inheritDoc}
*/
public DavPropertyNameSet getPropFindProperties() throws CosmoDavException {
if (propfindProps == null) {
parsePropFindRequest();
}
return propfindProps;
}
示例15: getProppatchRemoveProperties
import org.apache.jackrabbit.webdav.property.DavPropertyNameSet; //导入依赖的package包/类
/**
*
*
*/
public DavPropertyNameSet getProppatchRemoveProperties()
throws CosmoDavException {
if (proppatchRemove == null) {
parsePropPatchRequest();
}
return proppatchRemove;
}