本文整理汇总了Java中org.apache.jackrabbit.webdav.MultiStatus类的典型用法代码示例。如果您正苦于以下问题:Java MultiStatus类的具体用法?Java MultiStatus怎么用?Java MultiStatus使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MultiStatus类属于org.apache.jackrabbit.webdav包,在下文中一共展示了MultiStatus类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: processResponseBody
import org.apache.jackrabbit.webdav.MultiStatus; //导入依赖的package包/类
/**
* Overridden to process the sync-token. Adapted from DavMethodBase.
*
* @see DavMethodBase#processResponseBody(HttpState, HttpConnection)
*/
@Override
protected void processResponseBody(HttpState httpState, HttpConnection httpConnection) {
if (getStatusCode() == DavServletResponse.SC_MULTI_STATUS) {
try {
Document document = getResponseBodyAsDocument();
if (document != null) {
synctoken = DomUtil.getChildText(document.getDocumentElement(), SyncReportInfo.XML_SYNC_TOKEN, DavConstants.NAMESPACE);
log.info("Sync-Token for REPORT: " + synctoken);
multiStatus = MultiStatus.createFromXml(document.getDocumentElement());
processMultiStatusBody(multiStatus, httpState, httpConnection);
}
} catch (IOException e) {
log.error("Error while parsing sync-token.", e);
setSuccess(false);
}
}
}
开发者ID:apache,项目名称:openmeetings,代码行数:24,代码来源:SyncMethod.java
示例2: readData
import org.apache.jackrabbit.webdav.MultiStatus; //导入依赖的package包/类
/**
* Read the data retrieved from the server about the contents of the target folder
*
*
* @param remoteData Full response got from the server with the data of the target
* folder and its direct children.
* @param client Client instance to the remote server where the data were
* retrieved.
* @return
*/
private void readData(MultiStatus remoteData, OwnCloudClient client) {
mFolderAndFiles = new ArrayList<Object>();
// parse data from remote folder
WebdavEntry we = new WebdavEntry(remoteData.getResponses()[0],
client.getWebdavUri().getPath());
mFolderAndFiles.add(fillOCFile(we));
// loop to update every child
RemoteFile remoteFile = null;
for (int i = 1; i < remoteData.getResponses().length; ++i) {
/// new OCFile instance with the data from the server
we = new WebdavEntry(remoteData.getResponses()[i], client.getWebdavUri().getPath());
remoteFile = fillOCFile(we);
mFolderAndFiles.add(remoteFile);
}
}
开发者ID:PicFrame,项目名称:picframe,代码行数:29,代码来源:ReadRemoteFolderOperation.java
示例3: proppatch
import org.apache.jackrabbit.webdav.MultiStatus; //导入依赖的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
示例4: getResponseBodyAsMultiStatus
import org.apache.jackrabbit.webdav.MultiStatus; //导入依赖的package包/类
/**
* Adapted from DavMethodBase to handle MultiStatus responses.
*
* @return MultiStatus response
* @throws IOException if the response body could not be parsed
* @throws DavException in case of error
*/
@Override
public MultiStatus getResponseBodyAsMultiStatus() throws IOException, DavException {
checkUsed();
if (multiStatus != null) {
return multiStatus;
} else {
DavException dx = getResponseException();
if (dx != null) {
throw dx;
} else {
throw new DavException(getStatusCode(), getName() + " resulted with unexpected status: " + getStatusLine());
}
}
}
开发者ID:apache,项目名称:openmeetings,代码行数:22,代码来源:SyncMethod.java
示例5: mkcalendar
import org.apache.jackrabbit.webdav.MultiStatus; //导入依赖的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
示例6: propfind
import org.apache.jackrabbit.webdav.MultiStatus; //导入依赖的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
示例7: getProperties
import org.apache.jackrabbit.webdav.MultiStatus; //导入依赖的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
示例8: getMultiStatus
import org.apache.jackrabbit.webdav.MultiStatus; //导入依赖的package包/类
protected MultiStatus getMultiStatus() {
return multistatus;
}
开发者ID:1and1,项目名称:cosmo,代码行数:4,代码来源:MultiStatusReport.java
注:本文中的org.apache.jackrabbit.webdav.MultiStatus类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论