本文整理汇总了Java中org.apache.jackrabbit.webdav.property.DavPropertyNameSet类的典型用法代码示例。如果您正苦于以下问题:Java DavPropertyNameSet类的具体用法?Java DavPropertyNameSet怎么用?Java DavPropertyNameSet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DavPropertyNameSet类属于org.apache.jackrabbit.webdav.property包,在下文中一共展示了DavPropertyNameSet类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:apache,项目名称:openmeetings,代码行数:27,代码来源:CtagHandler.java
示例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);
}
}
开发者ID:apache,项目名称:openmeetings,代码行数:22,代码来源:MultigetHandler.java
示例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;
}
开发者ID:PicFrame,项目名称:picframe,代码行数:26,代码来源:WebdavUtils.java
示例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;
}
开发者ID:PicFrame,项目名称:picframe,代码行数:23,代码来源:WebdavUtils.java
示例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");
}
开发者ID:1and1,项目名称:cosmo,代码行数:29,代码来源:MultigetReport.java
示例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);
}
开发者ID:1and1,项目名称:cosmo,代码行数:21,代码来源:BaseProvider.java
示例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);
}
开发者ID:wso2,项目名称:wso2-commons-vfs,代码行数:26,代码来源:WebdavFileContentInfoFactory.java
示例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;
}
开发者ID:lsst,项目名称:firefly,代码行数:44,代码来源:WorkspaceManager.java
示例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);
}
}
开发者ID:1and1,项目名称:cosmo,代码行数:11,代码来源:MultiStatusReport.java
示例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);
}
开发者ID:1and1,项目名称:cosmo,代码行数:16,代码来源:MultiStatusReport.java
示例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;
}
开发者ID:1and1,项目名称:cosmo,代码行数:20,代码来源:CaldavMultiStatusReport.java
示例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);
}
开发者ID:1and1,项目名称:cosmo,代码行数:41,代码来源:BaseProvider.java
示例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;
}
开发者ID:1and1,项目名称:cosmo,代码行数:13,代码来源:DavItemResourceBase.java
示例14: getPropFindProperties
import org.apache.jackrabbit.webdav.property.DavPropertyNameSet; //导入依赖的package包/类
/**
*
* {@inheritDoc}
*/
public DavPropertyNameSet getPropFindProperties() throws CosmoDavException {
if (propfindProps == null) {
parsePropFindRequest();
}
return propfindProps;
}
开发者ID:1and1,项目名称:cosmo,代码行数:11,代码来源:StandardDavRequest.java
示例15: getProppatchRemoveProperties
import org.apache.jackrabbit.webdav.property.DavPropertyNameSet; //导入依赖的package包/类
/**
*
*
*/
public DavPropertyNameSet getProppatchRemoveProperties()
throws CosmoDavException {
if (proppatchRemove == null) {
parsePropPatchRequest();
}
return proppatchRemove;
}
开发者ID:1and1,项目名称:cosmo,代码行数:12,代码来源:StandardDavRequest.java
示例16: doSetAttribute
import org.apache.jackrabbit.webdav.property.DavPropertyNameSet; //导入依赖的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
示例17: getProperty
import org.apache.jackrabbit.webdav.property.DavPropertyNameSet; //导入依赖的package包/类
DavProperty getProperty(URLFileName fileName, DavPropertyName name)
throws FileSystemException
{
DavPropertyNameSet nameSet = new DavPropertyNameSet();
nameSet.add(name);
DavPropertySet propertySet = getProperties(fileName, nameSet, false);
return propertySet.get(name);
}
开发者ID:wso2,项目名称:wso2-commons-vfs,代码行数:9,代码来源:WebdavFileObject.java
示例18: getProperties
import org.apache.jackrabbit.webdav.property.DavPropertyNameSet; //导入依赖的package包/类
DavPropertySet getProperties(URLFileName name, int type, DavPropertyNameSet nameSet,
boolean addEncoding)
throws FileSystemException
{
try
{
String urlStr = urlString(name);
PropFindMethod method = new PropFindMethod(urlStr, type, nameSet, DavConstants.DEPTH_0);
setupMethod(method);
execute(method);
if (method.succeeded())
{
MultiStatus multiStatus = method.getResponseBodyAsMultiStatus();
MultiStatusResponse response = multiStatus.getResponses()[0];
DavPropertySet props = response.getProperties(HttpStatus.SC_OK);
if (addEncoding)
{
DavProperty prop = new DefaultDavProperty(RESPONSE_CHARSET,
method.getResponseCharSet());
props.add(prop);
}
return props;
}
return new DavPropertySet();
}
catch (FileSystemException fse)
{
throw fse;
}
catch (Exception e)
{
throw new FileSystemException("vfs.provider.webdav/propfind.error", getName(), e);
}
}
开发者ID:wso2,项目名称:wso2-commons-vfs,代码行数:35,代码来源:WebdavFileObject.java
示例19: doSetAttribute
import org.apache.jackrabbit.webdav.property.DavPropertyNameSet; //导入依赖的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
示例20: alterProperties
import org.apache.jackrabbit.webdav.property.DavPropertyNameSet; //导入依赖的package包/类
public MultiStatusResponse alterProperties( DavPropertySet arg0, DavPropertyNameSet arg1 )
throws DavException
{
return null;
}
开发者ID:ruikom,项目名称:apache-archiva,代码行数:6,代码来源:ArchivaVirtualDavResource.java
注:本文中的org.apache.jackrabbit.webdav.property.DavPropertyNameSet类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论