【发布时间】:2015-10-20 22:28:09
【问题描述】:
我正在使用jackrabbit 实现 WebDAV。有一个用户没有文件夹的写入权限。该用户能够在桌面应用程序中打开文件并能够进行编辑。当用户保存时,服务器拒绝更改,但客户端仍然有这些更改,但重新挂载后,这些更改将消失。所以,我正在寻找以下问题的答案:
- 有没有办法让文件/文件夹在通过 一个WebDAV?
- WebDAV 规范是否允许这样做?如果是这样,如何做到这一点 (响应格式/值)在 MAC 和 Windows 上?
感谢您的帮助。
使用 jackrabbit 服务器,在 Windows 原生 WebDAV 客户端上,我们可以使用属性名称 Z:Win32FileAttributes。
这是在 charles 中捕获的 PROPFIND 响应:
<D:response>
<D:href>http://10.40.61.110:8080/repository/default/content/test.txt</D:href>
<D:propstat>
<D:prop>
<Z:Win32FileAttributes xmlns:Z="urn:schemas-microsoft-com:">00000021</Z:Win32FileAttributes>
<D:creationdate>2015-07-30T05:38:24Z</D:creationdate>
<D:getetag>"11-1438238197046"</D:getetag>
<D:lockdiscovery />
<D:displayname>test.txt</D:displayname>
<D:supportedlock>
<D:lockentry>
<D:lockscope>
<D:exclusive />
</D:lockscope>
<D:locktype>
<D:write />
</D:locktype>
</D:lockentry>
</D:supportedlock>
<D:getlastmodified>Thu, 30 Jul 2015 06:36:37 GMT</D:getlastmodified>
<D:iscollection>0</D:iscollection>
<D:getcontenttype>application/xml</D:getcontenttype>
<D:getcontentlength>11</D:getcontentlength>
<D:resourcetype />
</D:prop>
<D:status>HTTP/1.1 200 OK</D:status>
</D:propstat>
</D:response>
<D:response>
<D:href>http://10.40.61.110:8080/repository/default/content/Desert.jpg</D:href>
<D:propstat>
<D:prop>
<D:creationdate>2015-07-30T09:49:31Z</D:creationdate>
<D:getetag>"329032-1438249785205"</D:getetag>
<D:getlastmodified>Thu, 30 Jul 2015 09:49:45 GMT</D:getlastmodified>
<D:iscollection>0</D:iscollection>
<Z:Win32LastModifiedTime xmlns:Z="urn:schemas-microsoft-com:">Thu, 30 Jul 2015 09:49:45 GMT</Z:Win32LastModifiedTime>
<Z:Win32LastAccessTime xmlns:Z="urn:schemas-microsoft-com:">Thu, 30 Jul 2015 09:49:32 GMT</Z:Win32LastAccessTime>
<D:getcontentlength>329032</D:getcontentlength>
<D:resourcetype />
<Z:Win32FileAttributes xmlns:Z="urn:schemas-microsoft-com:">00000020</Z:Win32FileAttributes>
<D:lockdiscovery />
<D:displayname>Desert.jpg</D:displayname>
<D:supportedlock>
<D:lockentry>
<D:lockscope>
<D:exclusive />
</D:lockscope>
<D:locktype>
<D:write />
</D:locktype>
</D:lockentry>
</D:supportedlock>
<D:getcontenttype>image/jpeg</D:getcontenttype>
<Z:Win32CreationTime xmlns:Z="urn:schemas-microsoft-com:">Thu, 30 Jul 2015 09:49:32 GMT</Z:Win32CreationTime>
</D:prop>
<D:status>HTTP/1.1 200 OK</D:status>
</D:propstat>
</D:response>
Z:Win32FileAttributes 的值:00000020 - 允许读/写
Z:Win32FileAttributes 的值:00000021 - 允许只读
也在寻找本地 MAC WebDAV 客户端的任何此类属性?
【问题讨论】:
标签: webdav jackrabbit