457 |
"</" (symbol-name tag) ">\n")))) |
"</" (symbol-name tag) ">\n")))) |
458 |
(url-dav-process-response (url-retrieve-synchronously url) url))) |
(url-dav-process-response (url-retrieve-synchronously url) url))) |
459 |
|
|
|
;;;###autoload |
|
460 |
(defun url-dav-get-properties (url &optional attributes depth namespaces) |
(defun url-dav-get-properties (url &optional attributes depth namespaces) |
461 |
"Return properties for URL, up to DEPTH levels deep. |
"Return properties for URL, up to DEPTH levels deep. |
462 |
|
|
486 |
to other users when the DAV:lockdiscovery property is requested, so |
to other users when the DAV:lockdiscovery property is requested, so |
487 |
make sure you are comfortable with it leaking to the outside world.") |
make sure you are comfortable with it leaking to the outside world.") |
488 |
|
|
|
;;;###autoload |
|
489 |
(defun url-dav-lock-resource (url exclusive &optional depth) |
(defun url-dav-lock-resource (url exclusive &optional depth) |
490 |
"Request a lock on URL. If EXCLUSIVE is non-nil, get an exclusive lock. |
"Request a lock on URL. If EXCLUSIVE is non-nil, get an exclusive lock. |
491 |
Optional 3rd argument DEPTH says how deep the lock should go, default is 0 |
Optional 3rd argument DEPTH says how deep the lock should go, default is 0 |
526 |
(push (list url child-status) failures))) |
(push (list url child-status) failures))) |
527 |
(cons successes failures))) |
(cons successes failures))) |
528 |
|
|
|
;;;###autoload |
|
529 |
(defun url-dav-active-locks (url &optional depth) |
(defun url-dav-active-locks (url &optional depth) |
530 |
"Return an assoc list of all active locks on URL." |
"Return an assoc list of all active locks on URL." |
531 |
(let ((response (url-dav-get-properties url '(DAV:lockdiscovery) depth)) |
(let ((response (url-dav-get-properties url '(DAV:lockdiscovery) depth)) |
560 |
results))) |
results))) |
561 |
results)) |
results)) |
562 |
|
|
|
;;;###autoload |
|
563 |
(defun url-dav-unlock-resource (url lock-token) |
(defun url-dav-unlock-resource (url lock-token) |
564 |
"Release the lock on URL represented by LOCK-TOKEN. |
"Release the lock on URL represented by LOCK-TOKEN. |
565 |
Returns t iff the lock was successfully released." |
Returns t iff the lock was successfully released." |
620 |
|
|
621 |
(autoload 'url-http-head-file-attributes "url-http") |
(autoload 'url-http-head-file-attributes "url-http") |
622 |
|
|
|
;;;###autoload |
|
623 |
(defun url-dav-file-attributes (url &optional id-format) |
(defun url-dav-file-attributes (url &optional id-format) |
624 |
(let ((properties (cdar (url-dav-get-properties url))) |
(let ((properties (cdar (url-dav-get-properties url))) |
625 |
(attributes nil)) |
(attributes nil)) |
675 |
(setq attributes (url-http-head-file-attributes url id-format))) |
(setq attributes (url-http-head-file-attributes url id-format))) |
676 |
attributes)) |
attributes)) |
677 |
|
|
|
;;;###autoload |
|
678 |
(defun url-dav-save-resource (url obj &optional content-type lock-token) |
(defun url-dav-save-resource (url obj &optional content-type lock-token) |
679 |
"Save OBJ as URL using WebDAV. |
"Save OBJ as URL using WebDAV. |
680 |
URL must be a fully qualified URL. |
URL must be a fully qualified URL. |
730 |
(concat "(<" ,lock-token ">)")))))))) |
(concat "(<" ,lock-token ">)")))))))) |
731 |
|
|
732 |
|
|
|
;;;###autoload |
|
733 |
(defun url-dav-delete-directory (url &optional recursive lock-token) |
(defun url-dav-delete-directory (url &optional recursive lock-token) |
734 |
"Delete the WebDAV collection URL. |
"Delete the WebDAV collection URL. |
735 |
If optional second argument RECURSIVE is non-nil, then delete all |
If optional second argument RECURSIVE is non-nil, then delete all |
754 |
props)) |
props)) |
755 |
nil) |
nil) |
756 |
|
|
|
;;;###autoload |
|
757 |
(defun url-dav-delete-file (url &optional lock-token) |
(defun url-dav-delete-file (url &optional lock-token) |
758 |
"Delete file named URL." |
"Delete file named URL." |
759 |
(let ((props nil) |
(let ((props nil) |
773 |
props)) |
props)) |
774 |
nil) |
nil) |
775 |
|
|
|
;;;###autoload |
|
776 |
(defun url-dav-directory-files (url &optional full match nosort files-only) |
(defun url-dav-directory-files (url &optional full match nosort files-only) |
777 |
"Return a list of names of files in DIRECTORY. |
"Return a list of names of files in DIRECTORY. |
778 |
There are three optional arguments: |
There are three optional arguments: |
819 |
files |
files |
820 |
(sort files 'string-lessp)))) |
(sort files 'string-lessp)))) |
821 |
|
|
|
;;;###autoload |
|
822 |
(defun url-dav-file-directory-p (url) |
(defun url-dav-file-directory-p (url) |
823 |
"Return t if URL names an existing DAV collection." |
"Return t if URL names an existing DAV collection." |
824 |
(let ((properties (cdar (url-dav-get-properties url '(DAV:resourcetype))))) |
(let ((properties (cdar (url-dav-get-properties url '(DAV:resourcetype))))) |
825 |
(eq (plist-get properties 'DAV:resourcetype) 'DAV:collection))) |
(eq (plist-get properties 'DAV:resourcetype) 'DAV:collection))) |
826 |
|
|
|
;;;###autoload |
|
827 |
(defun url-dav-make-directory (url &optional parents) |
(defun url-dav-make-directory (url &optional parents) |
828 |
"Create the directory DIR and any nonexistent parent dirs." |
"Create the directory DIR and any nonexistent parent dirs." |
829 |
(declare (special url-http-response-status)) |
(declare (special url-http-response-status)) |
853 |
(kill-buffer buffer))) |
(kill-buffer buffer))) |
854 |
result)) |
result)) |
855 |
|
|
|
;;;###autoload |
|
856 |
(defun url-dav-rename-file (oldname newname &optional overwrite) |
(defun url-dav-rename-file (oldname newname &optional overwrite) |
857 |
(if (not (and (string-match url-handler-regexp oldname) |
(if (not (and (string-match url-handler-regexp oldname) |
858 |
(string-match url-handler-regexp newname))) |
(string-match url-handler-regexp newname))) |
893 |
props) |
props) |
894 |
t)) |
t)) |
895 |
|
|
|
;;;###autoload |
|
896 |
(defun url-dav-file-name-all-completions (file url) |
(defun url-dav-file-name-all-completions (file url) |
897 |
"Return a list of all completions of file name FILE in directory DIRECTORY. |
"Return a list of all completions of file name FILE in directory DIRECTORY. |
898 |
These are all file names in directory DIRECTORY which begin with FILE." |
These are all file names in directory DIRECTORY which begin with FILE." |
899 |
(url-dav-directory-files url nil (concat "^" file ".*"))) |
(url-dav-directory-files url nil (concat "^" file ".*"))) |
900 |
|
|
|
;;;###autoload |
|
901 |
(defun url-dav-file-name-completion (file url) |
(defun url-dav-file-name-completion (file url) |
902 |
"Complete file name FILE in directory DIRECTORY. |
"Complete file name FILE in directory DIRECTORY. |
903 |
Returns the longest string |
Returns the longest string |
937 |
(put op 'url-file-handlers (intern-soft (format "url-dav-%s" op)))) |
(put op 'url-file-handlers (intern-soft (format "url-dav-%s" op)))) |
938 |
|
|
939 |
(mapcar 'url-dav-register-handler |
(mapcar 'url-dav-register-handler |
940 |
'(file-name-all-completions |
;; These handlers are disabled because they incorrectly presume that |
941 |
file-name-completion |
;; the URL specifies an HTTP location and thus break FTP URLs. |
942 |
rename-file |
'(;; file-name-all-completions |
943 |
make-directory |
;; file-name-completion |
944 |
file-directory-p |
;; rename-file |
945 |
directory-files |
;; make-directory |
946 |
delete-file |
;; file-directory-p |
947 |
delete-directory |
;; directory-files |
948 |
file-attributes)) |
;; delete-file |
949 |
|
;; delete-directory |
950 |
|
;; file-attributes |
951 |
|
)) |
952 |
|
|
953 |
|
|
954 |
;;; Version Control backend cruft |
;;; Version Control backend cruft |