Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

##
## Variable Declaration
##
FILE_ID=11111
USERNAME={oc-examples-username}
PASSWORD={oc-examples-password}
API_PATH="remote.php/dav/trash-bin/${USERNAME}/${FILE_ID}"
SERVER_URI="{oc-examples-server-url}"

curl '$SERVER_URI/$API_PATH/' \
-X DELETE \
--user "${USERNAME}:${PASSWORD}"
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash

##
## Variable Declaration
##
USERNAME={oc-examples-username}
PASSWORD={oc-examples-password}
API_PATH="remote.php/dav/trash-bin/<username>"
SERVER_URI="{oc-examples-server-url}"
REQUEST_BODY=$(cat <<EOF
<?xml version="1.0"?>
<d:propfind xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">
<d:prop>
<oc:trashbin-original-filename />
<oc:trashbin-original-location />
<oc:trashbin-delete-datetime />
<d:getcontentlength />
<d:resourcetype />
</d:prop>
</d:propfind>
EOF
)

curl '$SERVER_URI/$API_PATH/' \
-H 'Content-Type: application/xml; charset=UTF-8' \
-H 'Depth: 1' \
-X PROPFIND \
--data-binary "${REQUEST_BODY}" \
--user "${USERNAME}:${PASSWORD}"
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

##
## Variable Declaration
##
USERNAME={oc-examples-username}
PASSWORD={oc-examples-password}
API_PATH="remote.php/dav/trash-bin/${USERNAME}/${FILE_ID}"
SERVER_URI="{oc-examples-server-url}"

curl '$SERVER_URI/$API_PATH/' \
-H 'Overwrite: F' \
-H 'Destination: ${SERVER_URI}/remote.php/dav/files/${USERNAME}/<filepath>' \
-X MOVE \
--user "${USERNAME}:${PASSWORD}"
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
<?xml version="1.0"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:oc="http://owncloud.org/ns">
<d:response>
<d:href>/remote.php/dav/trash-bin/admin/</d:href>
Comment thread
settermjd marked this conversation as resolved.
<d:propstat>
<d:prop>
<d:resourcetype>
<d:collection/>
</d:resourcetype>
</d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
<d:propstat>
<d:prop>
<oc:trashbin-original-filename/>
<oc:trashbin-original-location/>
<oc:trashbin-delete-datetime/>
<d:getcontentlength/>
</d:prop>
<d:status>HTTP/1.1 404 Not Found</d:status>
</d:propstat>
</d:response>
<d:response>
<d:href>/remote.php/dav/trash-bin/admin/255/</d:href>
<d:propstat>
<d:prop>
<oc:trashbin-original-filename>Level 1</oc:trashbin-original-filename>
<oc:trashbin-original-location>Level 1</oc:trashbin-original-location>
<oc:trashbin-delete-datetime>Tue, 09 Jul 2019 08:26:38 GMT</oc:trashbin-delete-datetime>
<d:resourcetype>
<d:collection/>
</d:resourcetype>
</d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
<d:propstat>
<d:prop>
<d:getcontentlength/>
</d:prop>
<d:status>HTTP/1.1 404 Not Found</d:status>
</d:propstat>
</d:response>
<d:response>
<d:href>/remote.php/dav/trash-bin/admin/255/256/</d:href>
<d:propstat>
<d:prop>
<oc:trashbin-original-filename>Level 2</oc:trashbin-original-filename>
<oc:trashbin-original-location>Level 1/Level 2</oc:trashbin-original-location>
<oc:trashbin-delete-datetime>Tue, 09 Jul 2019 08:26:38 GMT</oc:trashbin-delete-datetime>
<d:resourcetype>
<d:collection/>
</d:resourcetype>
</d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
<d:propstat>
<d:prop>
<d:getcontentlength/>
</d:prop>
<d:status>HTTP/1.1 404 Not Found</d:status>
</d:propstat>
</d:response>
<d:response>
<d:href>/remote.php/dav/trash-bin/admin/255/256/257/</d:href>
<d:propstat>
<d:prop>
<oc:trashbin-original-filename>Level 3</oc:trashbin-original-filename>
<oc:trashbin-original-location>Level 1/Level 2/Level 3</oc:trashbin-original-location>
<oc:trashbin-delete-datetime>Tue, 09 Jul 2019 08:26:38 GMT</oc:trashbin-delete-datetime>
<d:resourcetype>
<d:collection/>
</d:resourcetype>
</d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
<d:propstat>
<d:prop>
<d:getcontentlength/>
</d:prop>
<d:status>HTTP/1.1 404 Not Found</d:status>
</d:propstat>
</d:response>
<d:response>
<d:href>/remote.php/dav/trash-bin/admin/255/256/257/263</d:href>
<d:propstat>
<d:prop>
<oc:trashbin-original-filename>test.txt</oc:trashbin-original-filename>
<oc:trashbin-original-location>Level 1/Level 2/Level 3/test.txt</oc:trashbin-original-location>
<oc:trashbin-delete-datetime>Tue, 09 Jul 2019 08:26:38 GMT</oc:trashbin-delete-datetime>
<d:getcontentlength>34</d:getcontentlength>
<d:resourcetype/>
</d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
</d:response>
<d:response>
<d:href>/remote.php/dav/trash-bin/admin/123</d:href>
<d:propstat>
<d:prop>
<oc:trashbin-original-filename>git-image-one.png</oc:trashbin-original-filename>
<oc:trashbin-original-location>git-image-one.png</oc:trashbin-original-location>
<oc:trashbin-delete-datetime>Tue, 09 Jul 2019 08:15:55 GMT</oc:trashbin-delete-datetime>
<d:getcontentlength>1067792</d:getcontentlength>
<d:resourcetype/>
</d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
</d:response>
<d:response>
<d:href>/remote.php/dav/trash-bin/admin/119</d:href>
<d:propstat>
<d:prop>
<oc:trashbin-original-filename>git-image-one.png</oc:trashbin-original-filename>
<oc:trashbin-original-location>git-image-one.png</oc:trashbin-original-location>
<oc:trashbin-delete-datetime>Tue, 09 Jul 2019 08:17:54 GMT</oc:trashbin-delete-datetime>
<d:getcontentlength>1517914</d:getcontentlength>
<d:resourcetype/>
</d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
</d:response>
</d:multistatus>
3 changes: 2 additions & 1 deletion modules/developer_manual/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
***** xref:webdav_api/comments.adoc[The Comments API]
***** xref:webdav_api/groups.adoc[The Custom Groups Management API]
***** xref:webdav_api/files_versions.adoc[The Files Versions API]
***** xref:webdav_api/tags.adoc[The Tags API]
***** xref:webdav_api/search.adoc[The Search API]
***** xref:webdav_api/tags.adoc[The Tags API]
***** xref:webdav_api/trashbin.adoc[The Trash Bin API]
** xref:app/introduction.adoc[Application Development]
*** xref:app/fundamentals/index.adoc[Fundamental Concepts]
**** xref:app/fundamentals/info.adoc[Application Metadata]
Expand Down
Loading