TagSpaces is an offline, open source, document manager with tagging support
js-webdav-client version raised to 1.0.1
Borislav Sapundzhievaa6c82e30932
diff --git a/data/web/webdavlib/webdavlib.js b/data/web/webdavlib/webdavlib.jsindex 4715e5037..2eb97db47 100644--- a/data/web/webdavlib/webdavlib.js+++ b/data/web/webdavlib/webdavlib.js@@ -1,6 +1,5 @@-"use strict";-if(nl===undefined){var nl={};}if(nl.sara===undefined){nl.sara={};}if(nl.sara.webdav===undefined){nl.sara.webdav={};}if(nl.sara.webdav.codec===undefined){nl.sara.webdav.codec={};}"use strict";if(nl.sara.webdav.Exception!==undefined){throw"Class name nl.sara.webdav.Exception already taken, could not load JavaScript library for WebDAV connectivity.";}nl.sara.webdav.Exception=function(b,a){Object.defineProperty(this,"message",{value:null,enumerable:true,configurable:false,writable:true});Object.defineProperty(this,"code",{value:null,enumerable:true,configurable:false,writable:true});if(b!==undefined){this.message=b;}if(a!==undefined){this.code=a;}};nl.sara.webdav.Exception.WRONG_TYPE=1;nl.sara.webdav.Exception.NAMESPACE_TAKEN=2;nl.sara.webdav.Exception.UNEXISTING_PROPERTY=3;nl.sara.webdav.Exception.WRONG_XML=4;nl.sara.webdav.Exception.WRONG_VALUE=5;nl.sara.webdav.Exception.MISSING_REQUIRED_PARAMETER=6;nl.sara.webdav.Exception.AJAX_ERROR=7;nl.sara.webdav.Exception.NOT_IMPLEMENTED=8;nl.sara.webdav.Exception.prototype.toString=function(){return this.message;};"use strict";if(nl.sara.webdav.Ie!==undefined){throw"Class name nl.sara.webdav.Ie already taken, could not load JavaScript library for WebDAV connectivity.";}nl.sara.webdav.Ie={};nl.sara.webdav.Ie.isIE=false;+"use strict";if(nl===undefined){var nl={};}if(nl.sara===undefined){nl.sara={};}if(nl.sara.webdav===undefined){nl.sara.webdav={};}if(nl.sara.webdav.codec===undefined){nl.sara.webdav.codec={};}"use strict";if(nl.sara.webdav.Exception!==undefined){throw"Class name nl.sara.webdav.Exception already taken, could not load JavaScript library for WebDAV connectivity.";}nl.sara.webdav.Exception=function(b,a){Object.defineProperty(this,"message",{value:null,enumerable:true,configurable:false,writable:true});Object.defineProperty(this,"code",{value:null,enumerable:true,configurable:false,writable:true});if(b!==undefined){this.message=b;}if(a!==undefined){this.code=a;}};nl.sara.webdav.Exception.WRONG_TYPE=1;nl.sara.webdav.Exception.NAMESPACE_TAKEN=2;nl.sara.webdav.Exception.UNEXISTING_PROPERTY=3;nl.sara.webdav.Exception.WRONG_XML=4;nl.sara.webdav.Exception.WRONG_VALUE=5;nl.sara.webdav.Exception.MISSING_REQUIRED_PARAMETER=6;nl.sara.webdav.Exception.AJAX_ERROR=7;nl.sara.webdav.Exception.NOT_IMPLEMENTED=8;nl.sara.webdav.Exception.prototype.toString=function(){return this.message;};"use strict";if(nl.sara.webdav.Ie!==undefined){throw"Class name nl.sara.webdav.Ie already taken, could not load JavaScript library for WebDAV connectivity.";}nl.sara.webdav.Ie={};nl.sara.webdav.Ie.isIE=false;/*@cc_onnl.sara.webdav.Ie.isIE = true;@*/-;nl.sara.webdav.Ie.getLocalName=function(a){if(nl.sara.webdav.Ie.isIE&&a.baseName){return a.baseName;}else{return a.localName;}};"use strict";if(nl.sara.webdav.Client!==undefined){throw new nl.sara.webdav.Exception("Namespace nl.sara.webdav.Client already taken, could not load JavaScript library for WebDAV connectivity.",nl.sara.webdav.Exception.NAMESPACE_TAKEN);}nl.sara.webdav.Client=function(c,b,a){Object.defineProperty(this,"_baseUrl",{value:null,enumerable:false,configurable:false,writable:true});if(c!==undefined){var d=(b===true)?"https":"http";a=(a!==undefined)?a:((d==="https")?443:80);this._baseUrl=d+"://"+c+((((d==="http")&&(a===80))||((d==="https")&&(a===443)))?"":":"+a);}};nl.sara.webdav.Client.PROPNAME=1;nl.sara.webdav.Client.ALLPROP=2;nl.sara.webdav.Client.INFINITY="infinity";nl.sara.webdav.Client.FAIL_ON_OVERWRITE=3;nl.sara.webdav.Client.TRUNCATE_ON_OVERWRITE=4;nl.sara.webdav.Client.SILENT_OVERWRITE=5;nl.sara.webdav.Client.prototype.getUrl=function(a){if(a.substring(0,1)!=="/"){a="/"+a;}if(this._baseUrl!==null){return this._baseUrl+a;}else{return a;}};nl.sara.webdav.Client.prototype.propfind=function(r,o,g,k,c,d){if((r===undefined)||(o===undefined)){throw new nl.sara.webdav.Exception("PROPFIND requires the parameters path and callback",nl.sara.webdav.Exception.MISSING_REQUIRED_PARAMETER);}if(!(typeof r==="string")){throw new nl.sara.webdav.Exception("PROPFIND parameter; path should be a string",nl.sara.webdav.Exception.WRONG_TYPE);}var b=this.getUrl(r);if(g===undefined){g=0;}var n=null;switch(g){case 0:case 1:n=g;break;case nl.sara.webdav.Client.INFINITY:n="infinity";break;default:throw new nl.sara.webdav.Exception("Depth header should be '0', '1' or nl.sara.webdav.Client.INFINITY",nl.sara.webdav.Exception.WRONG_VALUE);break;}if(k===undefined){k=nl.sara.webdav.Client.ALLPROP;}var e=document.implementation.createDocument("DAV:","propfind",null);switch(k){case nl.sara.webdav.Client.PROPNAME:e.documentElement.appendChild(e.createElementNS("DAV:","propname"));break;case nl.sara.webdav.Client.ALLPROP:e.documentElement.appendChild(e.createElementNS("DAV:","allprop"));if(c!==undefined){if(!(c instanceof Array)){throw new nl.sara.webdav.Exception("Propfind parameter; include should be an array",nl.sara.webdav.Exception.WRONG_TYPE);}var h=e.createElementNS("DAV:","include");for(var f=0;f<c.length;f++){var p=c[f];if(!nl.sara.webdav.Ie.isIE&&!(p instanceof nl.sara.webdav.Property)){continue;}h.appendChild(e.createElementNS(p.namespace,p.tagname));}if(h.hasChildNodes()){e.documentElement.appendChild(h);}}break;default:if(!(k instanceof Array)){throw new nl.sara.webdav.Exception("Props parameter should be nl.sara.webdav.Client.PROPNAME, nl.sara.webdav.Client.ALLPROP or an array with Property objects",nl.sara.webdav.Exception.WRONG_VALUE);}var q=e.createElementNS("DAV:","prop");for(var f=0;f<k.length;f++){var a=k[f];if(!nl.sara.webdav.Ie.isIE&&!(a instanceof nl.sara.webdav.Property)){continue;}q.appendChild(e.createElementNS(a.namespace,a.tagname));}if(!q.hasChildNodes()){throw new nl.sara.webdav.Exception("Propfind parameter; if props is an array, it should be an array of Properties",nl.sara.webdav.Exception.WRONG_TYPE);}e.documentElement.appendChild(q);break;}var m=new XMLSerializer();var j='<?xml version="1.0" encoding="utf-8" ?>'+m.serializeToString(e);var l=nl.sara.webdav.Client.getAjax("PROPFIND",b,o,d);l.setRequestHeader("Depth",n);l.setRequestHeader("Content-Type",'application/xml; charset="utf-8"');l.send(j);return this;};nl.sara.webdav.Client.prototype.proppatch=function(o,g,n,m,c){if((o===undefined)||(g===undefined)||((n===undefined)&&(m===undefined))){throw new nl.sara.webdav.Exception("PROPPATCH requires the parameters path, callback and at least one of setProps or delProps",nl.sara.webdav.Exception.MISSING_REQUIRED_PARAMETER);}if(!(typeof o==="string")||((n!==undefined)&&!(n instanceof Array))||((m!==undefined)&&!(m instanceof Array))){throw new nl.sara.webdav.Exception("PROPPATCH parameter; path should be a string, setProps and delProps should be arrays",nl.sara.webdav.Exception.WRONG_TYPE);}var f=this.getUrl(o);var a=document.implementation.createDocument("DAV:","propertyupdate",null);a.documentElement.setAttribute("xmlns:D","DAV:");if(n!==undefined){var e=a.createElementNS("DAV:","prop");for(var r=0;r<n.length;r++){var d=n[r];if(!nl.sara.webdav.Ie.isIE&&!(d instanceof nl.sara.webdav.Property)){continue;}var b=a.createElementNS(d.namespace,d.tagname);for(var q=0;q<d.xmlvalue.length;q++){var p=a.importNode(d.xmlvalue.item(q),true);b.appendChild(p);}e.appendChild(b);}if(!e.hasChildNodes()){throw new nl.sara.webdav.Exception("Proppatch parameter; setProps should be an array of Properties",nl.sara.webdav.Exception.WRONG_TYPE);}var k=a.createElementNS("DAV:","set");k.appendChild(e);a.documentElement.appendChild(k);}if(m!==undefined){var e=a.createElementNS("DAV:","prop");for(var r=0;r<m.length;r++){var d=m[r];if(!nl.sara.webdav.Ie.isIE&&!(d instanceof nl.sara.webdav.Property)){continue;}var b=a.createElementNS(d.namespace,d.tagname);e.appendChild(b);}if(!e.hasChildNodes()){throw new nl.sara.webdav.Exception("Proppatch parameter; delProps should be an array of Properties",nl.sara.webdav.Exception.WRONG_TYPE);}var t=a.createElementNS("DAV:","remove");t.appendChild(e);a.documentElement.appendChild(t);}var s=new XMLSerializer();var h='<?xml version="1.0" encoding="utf-8" ?>'+s.serializeToString(a);var l=nl.sara.webdav.Client.getAjax("PROPPATCH",f,g,c);l.setRequestHeader("Content-Type",'application/xml; charset="utf-8"');l.send(h);return this;};nl.sara.webdav.Client.prototype.mkcol=function(e,g,a,b,f){if((e===undefined)||(g===undefined)){throw new nl.sara.webdav.Exception("MKCOL requires the parameters path and callback",nl.sara.webdav.Exception.MISSING_REQUIRED_PARAMETER);}if((typeof e!=="string")||((b!==undefined)&&(typeof b!=="string"))){throw new nl.sara.webdav.Exception("MKCOL parameter; path and contenttype should be strings",nl.sara.webdav.Exception.WRONG_TYPE);}var c=this.getUrl(e);var d=nl.sara.webdav.Client.getAjax("MKCOL",c,g,f);if(a!==undefined){if(b!==undefined){d.setRequestHeader("Content-Type",b);}d.send(a);}else{d.send();}return this;};nl.sara.webdav.Client.prototype.remove=function(c,e,d){if((c===undefined)||(e===undefined)){throw new nl.sara.webdav.Exception("DELETE requires the parameters path and callback",nl.sara.webdav.Exception.MISSING_REQUIRED_PARAMETER);}if(typeof c!=="string"){throw new nl.sara.webdav.Exception("DELETE parameter; path should be strings",nl.sara.webdav.Exception.WRONG_TYPE);}var a=this.getUrl(c);var b=nl.sara.webdav.Client.getAjax("DELETE",a,e,d);b.send();return this;};nl.sara.webdav.Client.prototype.get=function(c,e,d){if((c===undefined)||(e===undefined)){throw new nl.sara.webdav.Exception("GET requires the parameters path and callback",nl.sara.webdav.Exception.MISSING_REQUIRED_PARAMETER);}if(typeof c!=="string"){throw new nl.sara.webdav.Exception("GET parameter; path should be strings",nl.sara.webdav.Exception.WRONG_TYPE);}var a=this.getUrl(c);var b=null;b=nl.sara.webdav.Client.getAjax("GET",a,e,d);b.send();return this;};nl.sara.webdav.Client.prototype.head=function(c,e,d){if((c===undefined)||(e===undefined)){throw new nl.sara.webdav.Exception("HEAD requires the parameters path and callback",nl.sara.webdav.Exception.MISSING_REQUIRED_PARAMETER);}if(typeof c!=="string"){throw new nl.sara.webdav.Exception("HEAD parameter; path should be strings",nl.sara.webdav.Exception.WRONG_TYPE);}var a=this.getUrl(c);var b=null;b=nl.sara.webdav.Client.getAjax("HEAD",a,e,d);b.send();return this;};nl.sara.webdav.Client.prototype.put=function(e,g,a,b,f){if((e===undefined)||(g===undefined)||(a===undefined)){throw new nl.sara.webdav.Exception("PUT requires the parameters path, callback and body",nl.sara.webdav.Exception.MISSING_REQUIRED_PARAMETER);}if((typeof e!=="string")||((b!==undefined)&&(typeof b!=="string"))){throw new nl.sara.webdav.Exception("PUT parameter; path and contenttype should be strings",nl.sara.webdav.Exception.WRONG_TYPE);}var c=this.getUrl(e);var d=null;d=nl.sara.webdav.Client.getAjax("PUT",c,g,f);if(b!==undefined){d.setRequestHeader("Content-Type",b);}d.send(a);return this;};nl.sara.webdav.Client.prototype.post=function(e,g,a,b,f){if((e===undefined)||(g===undefined)){throw new nl.sara.webdav.Exception("POST requires the parameters path and callback",nl.sara.webdav.Exception.MISSING_REQUIRED_PARAMETER);}if((typeof e!=="string")||((a!==undefined)&&(typeof a!=="string"))||((b!==undefined)&&(typeof b!=="string"))){throw new nl.sara.webdav.Exception("POST parameter; path, body and contenttype should be strings",nl.sara.webdav.Exception.WRONG_TYPE);}var c=this.getUrl(e);var d=null;d=nl.sara.webdav.Client.getAjax("POST",c,g,f);if(a!==undefined){if(b!==undefined){d.setRequestHeader("Content-Type",b);}else{d.setRequestHeader("Content-Type","application/x-www-form-urlencoded");}d.send(a);}else{d.send();}return this;};nl.sara.webdav.Client.prototype.copy=function(e,h,a,b,g,f){if((e===undefined)||(h===undefined)||(a===undefined)){throw new nl.sara.webdav.Exception("COPY requires the parameters path, callback and destination",nl.sara.webdav.Exception.MISSING_REQUIRED_PARAMETER);}if((typeof e!=="string")||(typeof a!=="string")){throw new nl.sara.webdav.Exception("COPY parameter; path and destination should be strings",nl.sara.webdav.Exception.WRONG_TYPE);}var c=this.getUrl(e);if(a.substr(0,1)==="/"){a=this.getUrl(a);}var d=nl.sara.webdav.Client.getAjax("COPY",c,h,f);d.setRequestHeader("Destination",a);if(g!==undefined){if((g!==0)&&(g!=="infinity")){throw new nl.sara.webdav.Exception("COPY parameter; depth should be '0' or 'infinity'",nl.sara.webdav.Exception.WRONG_VALUE);}d.setRequestHeader("Depth",g);}if(b===nl.sara.webdav.Client.FAIL_ON_OVERWRITE){d.setRequestHeader("Overwrite","F");}d.send();return this;};nl.sara.webdav.Client.prototype.move=function(e,g,a,b,f){if((e===undefined)||(g===undefined)||(a===undefined)){throw new nl.sara.webdav.Exception("MOVE requires the parameters path, callback and destination",nl.sara.webdav.Exception.MISSING_REQUIRED_PARAMETER);}if((typeof e!=="string")||(typeof a!=="string")){throw new nl.sara.webdav.Exception("MOVE parameter; path and destination should be strings",nl.sara.webdav.Exception.WRONG_TYPE);}var c=this.getUrl(e);if(a.substr(0,1)==="/"){a=this.getUrl(a);}var d=nl.sara.webdav.Client.getAjax("MOVE",c,g,f);d.setRequestHeader("Destination",a);if(b===nl.sara.webdav.Client.FAIL_ON_OVERWRITE){d.setRequestHeader("Overwrite","F");}else{if(b===nl.sara.webdav.Client.TRUNCATE_ON_OVERWRITE){d.setRequestHeader("Overwrite","T");}}d.send();return this;};nl.sara.webdav.Client.prototype.lock=function(a,c,b){throw new nl.sara.webdav.Exception("LOCK is not implemented yet",nl.sara.webdav.Exception.NOT_IMPLEMENTED);return this;};nl.sara.webdav.Client.prototype.unlock=function(a,c,b){throw new nl.sara.webdav.Exception("UNLOCK is not implemented yet",nl.sara.webdav.Exception.NOT_IMPLEMENTED);return this;};nl.sara.webdav.Client.getAjax=function(f,a,e,c){var b=new XMLHttpRequest();b.open(f,a,true);b.onreadystatechange=function(){nl.sara.webdav.Client.ajaxHandler(b,e);};for(var d in c){b.setRequestHeader(d,c[d]);}return b;};nl.sara.webdav.Client.ajaxHandler=function(c,d){if(c.readyState===4){var a=c.responseText;if(c.status===207){for(var b=0;b<c.responseXML.childNodes.length;b++){if(nl.sara.webdav.Ie.getLocalName(c.responseXML.childNodes.item(b))==="multistatus"){a=new nl.sara.webdav.Multistatus(c.responseXML.childNodes.item(b));break;}}}d(c.status,a,c.getAllResponseHeaders());}};"use strict";if(nl.sara.webdav.Codec!==undefined){throw new nl.sara.webdav.Exception("Namespace name nl.sara.webdav.Codec already taken, could not load JavaScript library for WebDAV connectivity.",nl.sara.webdav.Exception.NAMESPACE_TAKEN);}nl.sara.webdav.Codec=function(b,c,a,d){Object.defineProperty(this,"namespace",{value:null,enumerable:true,configurable:false,writable:true});Object.defineProperty(this,"tagname",{value:null,enumerable:true,configurable:false,writable:true});Object.defineProperty(this,"toXML",{value:undefined,enumerable:true,configurable:false,writable:true});Object.defineProperty(this,"fromXML",{value:undefined,enumerable:true,configurable:false,writable:true});if(b!==undefined){this.namespace=b;}if(c!==undefined){this.tagname=c;}if(a!==undefined){this.toXML=a;}if(d!==undefined){this.fromXML=d;}};"use strict";if(nl.sara.webdav.Multistatus!==undefined){throw new nl.sara.webdav.Exception("Namespace nl.sara.webdav.Multistatus already taken, could not load JavaScript library for WebDAV connectivity.",nl.sara.webdav.Exception.NAMESPACE_TAKEN);}nl.sara.webdav.Multistatus=function(n){Object.defineProperty(this,"_responses",{value:{},enumerable:false,configurable:false,writable:true});Object.defineProperty(this,"responsedescription",{value:null,enumerable:true,configurable:false,writable:true});if(typeof n!=="undefined"){if((n.namespaceURI!=="DAV:")||(nl.sara.webdav.Ie.getLocalName(n)!=="multistatus")){throw new nl.sara.webdav.Exception("Node is not of type DAV:multistatus",nl.sara.webdav.Exception.WRONG_XML);}var g=n.childNodes;for(var l=0;l<g.length;l++){var b=g.item(l);if((b.namespaceURI===null)||(b.namespaceURI!=="DAV:")){continue;}switch(nl.sara.webdav.Ie.getLocalName(b)){case"responsedescription":this.responsedescription=b.childNodes.item(0).nodeValue;break;case"response":var e=new nl.sara.webdav.Response(b);var h=b.childNodes;var m=[];for(var f=0;f<h.length;f++){var c=h.item(f);if((nl.sara.webdav.Ie.getLocalName(c)==="href")&&(c.namespaceURI!==null)&&(c.namespaceURI==="DAV:")){m.push(c.childNodes.item(0).nodeValue);}}if(m.length>1){for(var d=0;d<m.length;d++){var a=new nl.sara.webdav.Response();a.href=m[d];a.status=e.status;a.error=e.error;a.responsedescription=e.responsedescription;a.location=e.location;this.addResponse(a);}}else{this.addResponse(e);}break;}}}};nl.sara.webdav.Multistatus.prototype.addResponse=function(a){if(!nl.sara.webdav.Ie.isIE&&!(a instanceof nl.sara.webdav.Response)){throw new nl.sara.webdav.Exception("Response should be instance of Response",nl.sara.webdav.Exception.WRONG_TYPE);}var b=a.href;this._responses[b]=a;return this;};nl.sara.webdav.Multistatus.prototype.getResponse=function(a){return this._responses[a];};nl.sara.webdav.Multistatus.prototype.getResponseNames=function(){return Object.keys(this._responses);};"use strict";if(nl.sara.webdav.Property!==undefined){throw new nl.sara.webdav.Exception("Namespace name nl.sara.webdav.Property already taken, could not load JavaScript library for WebDAV connectivity.",nl.sara.webdav.Exception.NAMESPACE_TAKEN);}nl.sara.webdav.Property=function(c,a,d,e){Object.defineProperty(this,"_xmlvalue",{value:null,enumerable:false,configurable:false,writable:true});Object.defineProperty(this,"_errors",{value:[],enumerable:false,configurable:false,writable:true});Object.defineProperty(this,"namespace",{value:null,enumerable:true,configurable:false,writable:true});Object.defineProperty(this,"tagname",{value:null,enumerable:true,configurable:false,writable:true});Object.defineProperty(this,"status",{value:null,enumerable:true,configurable:false,writable:true});Object.defineProperty(this,"responsedescription",{value:null,enumerable:true,configurable:false,writable:true});if((typeof c!=="undefined")&&(c.nodeType===1)){this.namespace=c.namespaceURI;this.tagname=nl.sara.webdav.Ie.getLocalName(c);this.xmlvalue=c.childNodes;}if(a!==undefined){this.status=a;}if(d!==undefined){this.responsedescription=d;}if(e instanceof Array){for(var b=0;b<e.length;b++){this.addError(e[b]);}}};(function(){var a={};Object.defineProperty(nl.sara.webdav.Property.prototype,"xmlvalue",{set:function(b){if(b===null){this._xmlvalue=null;return;}if(!nl.sara.webdav.Ie.isIE&&!(b instanceof NodeList)){throw new nl.sara.webdav.Exception("xmlvalue must be an instance of NodeList",nl.sara.webdav.Exception.WRONG_TYPE);}this._xmlvalue=b;},get:function(){return this._xmlvalue;}});nl.sara.webdav.Property.addCodec=function(b){if(typeof b.namespace!=="string"){throw new nl.sara.webdav.Exception("addCodec: codec.namespace must be a String",nl.sara.webdav.Exception.WRONG_TYPE);}if(typeof b.tagname!=="string"){throw new nl.sara.webdav.Exception("addCodec: codec.tagname must be a String",nl.sara.webdav.Exception.WRONG_TYPE);}if(a[b.namespace]===undefined){a[b.namespace]={};}a[b.namespace][b.tagname]={fromXML:(b.fromXML?b.fromXML:undefined),toXML:(b.toXML?b.toXML:undefined)};};nl.sara.webdav.Property.prototype.setValueAndRebuildXml=function(d){var c=document.implementation.createDocument(this.namespace,this.tagname,null);if((a[this.namespace]===undefined)||(a[this.namespace][this.tagname]===undefined)||(a[this.namespace][this.tagname]["toXML"]===undefined)){if(d!==null){var b=c.createCDATASection(d);c.documentElement.appendChild(b);}this._xmlvalue=c.documentElement.childNodes;}else{this._xmlvalue=a[this.namespace][this.tagname]["toXML"](d,c).documentElement.childNodes;}};nl.sara.webdav.Property.prototype.getParsedValue=function(){if(this._xmlvalue.length>0){if((a[this.namespace]===undefined)||(a[this.namespace][this.tagname]===undefined)||(a[this.namespace][this.tagname]["fromXML"]===undefined)){var b="";for(var c=0;c<this._xmlvalue.length;c++){var d=this._xmlvalue.item(c);if((d.nodeType===3)||(d.nodeType===4)){b+=d.nodeValue;}else{b=undefined;break;}}return b;}else{return a[this.namespace][this.tagname]["fromXML"](this._xmlvalue);}}return null;};})();nl.sara.webdav.Property.prototype.addError=function(a){if(!nl.sara.webdav.Ie.isIE&&!(a instanceof Node)){throw new nl.sara.webdav.Exception("Error must be an instance of Node",nl.sara.webdav.Exception.WRONG_TYPE);}this._errors.push(a);return this;};nl.sara.webdav.Property.prototype.getErrors=function(){return this._errors;};nl.sara.webdav.Property.prototype.toString=function(){return this.getParsedValue();};"use strict";if(nl.sara.webdav.Response!==undefined){throw new nl.sara.webdav.Exception("Namespace nl.sara.webdav.Response already taken, could not load JavaScript library for WebDAV connectivity.",nl.sara.webdav.Exception.NAMESPACE_TAKEN);}nl.sara.webdav.Response=function(o){Object.defineProperty(this,"_namespaces",{value:{},enumerable:false,configurable:false,writable:true});Object.defineProperty(this,"href",{value:null,enumerable:true,configurable:false,writable:true});Object.defineProperty(this,"status",{value:null,enumerable:true,configurable:false,writable:true});Object.defineProperty(this,"error",{value:null,enumerable:true,configurable:false,writable:true});Object.defineProperty(this,"responsedescription",{value:null,enumerable:true,configurable:false,writable:true});Object.defineProperty(this,"location",{value:null,enumerable:true,configurable:false,writable:true});if(typeof o!=="undefined"){if((o.namespaceURI!=="DAV:")||(nl.sara.webdav.Ie.getLocalName(o)!=="response")){throw new nl.sara.webdav.Exception("Node is not of type DAV:response",nl.sara.webdav.Exception.WRONG_XML);}var f=o.childNodes;for(var g=0;g<f.length;g++){var a=f.item(g);if((a.namespaceURI===null)||(a.namespaceURI!=="DAV:")){continue;}switch(nl.sara.webdav.Ie.getLocalName(a)){case"href":case"status":case"error":case"responsedescription":this[nl.sara.webdav.Ie.getLocalName(a)]=a.childNodes.item(0).nodeValue;break;case"location":this[nl.sara.webdav.Ie.getLocalName(a)]=a.childNodes.item(0).childNodes.item(0).nodeValue;break;case"propstat":var p=a.childNodes;var e=null;var m=[];var b=null;var l=[];for(var d=0;d<p.length;d++){var h=p.item(d);if((h.nodeType!==1)||(h.namespaceURI!=="DAV:")){continue;}switch(nl.sara.webdav.Ie.getLocalName(h)){case"prop":for(var c=0;c<h.childNodes.length;c++){l.push(h.childNodes.item(c));}break;case"error":for(c=0;c<h.childNodes.length;c++){m.push(h.childNodes.item(c));}break;break;case"status":e=h.childNodes.item(0).nodeValue;e=parseInt(e.substr(e.indexOf(" ")+1,3));break;case"responsedescription":b=h.childNodes.item(0).nodeValue;break;}}for(d=0;d<l.length;d++){if(l[d].nodeType===1){var n=new nl.sara.webdav.Property(l[d],e,b,m);this.addProperty(n);}}break;}}}};nl.sara.webdav.Response.prototype.addProperty=function(b){if(!nl.sara.webdav.Ie.isIE&&!(b instanceof nl.sara.webdav.Property)){throw new nl.sara.webdav.Exception("Response property should be instance of Property",nl.sara.webdav.Exception.WRONG_TYPE);}var a=b.namespace;if(typeof a!=="string"){a="";}if(this._namespaces[a]===undefined){this._namespaces[a]={};}this._namespaces[a][b.tagname]=b;return this;};nl.sara.webdav.Response.prototype.getProperty=function(a,b){if((this._namespaces[a]===undefined)||(this._namespaces[a][b]===undefined)){return undefined;}return this._namespaces[a][b];};nl.sara.webdav.Response.prototype.getNamespaceNames=function(){return Object.keys(this._namespaces);};nl.sara.webdav.Response.prototype.getPropertyNames=function(a){if(this._namespaces[a]===undefined){return new Array();}return Object.keys(this._namespaces[a]);};"use strict";if(nl.sara.webdav.Ace!==undefined){throw new nl.sara.webdav.Exception("Namespace nl.sara.webdav.Ace already taken, could not load JavaScript library for WebDAV connectivity.",nl.sara.webdav.Exception.NAMESPACE_TAKEN);}nl.sara.webdav.Ace=function(e){Object.defineProperty(this,"_namespaces",{value:{},enumerable:false,configurable:false,writable:true});Object.defineProperty(this,"_principal",{value:null,enumerable:false,configurable:false,writable:true});Object.defineProperty(this,"_invertprincipal",{value:false,enumerable:false,configurable:false,writable:true});Object.defineProperty(this,"_grantdeny",{value:null,enumerable:false,configurable:false,writable:true});Object.defineProperty(this,"_isprotected",{value:false,enumerable:false,configurable:false,writable:true});Object.defineProperty(this,"_inherited",{value:false,enumerable:false,configurable:false,writable:true});function a(m,q){if(!nl.sara.webdav.Ie.isIE&&!(q instanceof Node)){throw new nl.sara.webdav.Exception("Principal XML node not recognized!",nl.sara.webdav.Exception.WRONG_XML);}for(var l=0;l<q.childNodes.length;l++){var o=q.childNodes.item(l);if((o.nodeType!==1)||(o.namespaceURI===null)||(o.namespaceURI!=="DAV:")){continue;}switch(nl.sara.webdav.Ie.getLocalName(o)){case"href":m.principal=o.childNodes.item(0).nodeValue;break;case"all":m.principal=nl.sara.webdav.Ace.ALL;break;case"authenticated":m.principal=nl.sara.webdav.Ace.AUTHENTICATED;break;case"unauthenticated":m.principal=nl.sara.webdav.Ace.UNAUTHENTICATED;break;case"property":for(var i=0;i<o.childNodes.length;i++){var n=o.childNodes.item(i);if(n.nodeType!==1){continue;}var p=new nl.sara.webdav.Property(n);m.principal=p;break;}break;case"self":m.principal=nl.sara.webdav.Ace.SELF;break;default:throw new nl.sara.webdav.Exception("Principal XML Node contains illegal child node: "+nl.sara.webdav.Ie.getLocalName(o),nl.sara.webdav.Exception.WRONG_XML);break;}}}function f(k,m){for(var l=0;l<m.length;l++){var j=m.item(l);if((j.nodeType===1)&&(j.namespaceURI==="DAV:")&&(nl.sara.webdav.Ie.getLocalName(j)==="privilege")){k.addPrivilege(new nl.sara.webdav.Privilege(j.childNodes[0]));}}}if(typeof e!=="undefined"){if((e.namespaceURI!=="DAV:")||(nl.sara.webdav.Ie.getLocalName(e)!=="ace")){throw new nl.sara.webdav.Exception("Node is not of type DAV:ace",nl.sara.webdav.Exception.WRONG_XML);}var g=e.childNodes;for(var d=0;d<g.length;d++){var h=g.item(d);if((h.namespaceURI===null)||(h.namespaceURI!=="DAV:")){continue;}switch(nl.sara.webdav.Ie.getLocalName(h)){case"principal":this.invertprincipal=false;a(this,h);break;case"invert":this.invertprincipal=true;for(var b=0;b<h.childNodes.length;b++){var c=h.childNodes.item(b);if((c.namespaceURI!=="DAV:")||(nl.sara.webdav.Ie.getLocalName(c)!=="principal")){continue;}a(this,c);}break;case"grant":this.grantdeny=nl.sara.webdav.Ace.GRANT;f(this,h.childNodes);break;case"deny":this.grantdeny=nl.sara.webdav.Ace.DENY;f(this,h.childNodes);break;case"protected":this.isprotected=true;break;case"inherited":for(var b=0;b<h.childNodes.length;b++){var c=h.childNodes.item(b);if((c.namespaceURI!=="DAV:")||(nl.sara.webdav.Ie.getLocalName(c)!=="href")){continue;}this.inherited=h.childNodes.item(b).childNodes.item(0).nodeValue;}break;}}}};nl.sara.webdav.Ace.GRANT=1;nl.sara.webdav.Ace.DENY=2;nl.sara.webdav.Ace.ALL=3;nl.sara.webdav.Ace.AUTHENTICATED=4;nl.sara.webdav.Ace.UNAUTHENTICATED=5;nl.sara.webdav.Ace.SELF=6;Object.defineProperty(nl.sara.webdav.Ace.prototype,"principal",{set:function(a){switch(a){case nl.sara.webdav.Ace.ALL:case nl.sara.webdav.Ace.AUTHENTICATED:case nl.sara.webdav.Ace.UNAUTHENTICATED:case nl.sara.webdav.Ace.SELF:break;default:if(!nl.sara.webdav.Ie.isIE&&!(a instanceof nl.sara.webdav.Property)){a=String(a);}break;}this._principal=a;},get:function(){return this._principal;}});Object.defineProperty(nl.sara.webdav.Ace.prototype,"invertprincipal",{set:function(a){this._invertprincipal=Boolean(a);},get:function(){return this._invertprincipal;}});Object.defineProperty(nl.sara.webdav.Ace.prototype,"isprotected",{set:function(a){this._isprotected=Boolean(a);},get:function(){return this._isprotected;}});Object.defineProperty(nl.sara.webdav.Ace.prototype,"grantdeny",{set:function(a){if((a!==nl.sara.webdav.Ace.GRANT)&&(a!==nl.sara.webdav.Ace.DENY)){throw new nl.sara.webdav.Exception("grantdeny must be either nl.sara.webdav.Ace.GRANT or nl.sara.webdav.Ace.DENY",nl.sara.webdav.Exception.WRONG_VALUE);}this._grantdeny=a;},get:function(){return this._grantdeny;}});Object.defineProperty(nl.sara.webdav.Ace.prototype,"inherited",{set:function(a){if(Boolean(a)){this._inherited=String(a);}else{this._inherited=false;}},get:function(){return this._inherited;}});nl.sara.webdav.Ace.prototype.addPrivilege=function(a){if(!nl.sara.webdav.Ie.isIE&&!(a instanceof nl.sara.webdav.Privilege)){throw new nl.sara.webdav.Exception("Privilege should be instance of Privilege",nl.sara.webdav.Exception.WRONG_TYPE);}var b=a.namespace;if(b){if(this._namespaces[b]===undefined){this._namespaces[b]={};}}else{throw new nl.sara.webdav.Exception("Privilege should have a namespace",nl.sara.webdav.Exception.WRONG_TYPE);}this._namespaces[b][a.tagname]=a;return this;};nl.sara.webdav.Ace.prototype.getPrivilege=function(b,a){if((this._namespaces[b]===undefined)||(this._namespaces[b][a]===undefined)){return undefined;}return this._namespaces[b][a];};nl.sara.webdav.Ace.prototype.getNamespaceNames=function(){return Object.keys(this._namespaces);};nl.sara.webdav.Ace.prototype.getPrivilegeNames=function(a){if(this._namespaces[a]===undefined){return new Array();}return Object.keys(this._namespaces[a]);};"use strict";if(nl.sara.webdav.Acl!==undefined){throw new nl.sara.webdav.Exception("Namespace nl.sara.webdav.Acl already taken, could not load JavaScript library for WebDAV connectivity.",nl.sara.webdav.Exception.NAMESPACE_TAKEN);}nl.sara.webdav.Acl=function(b){Object.defineProperty(this,"_aces",{value:[],enumerable:false,configurable:false,writable:true});if(typeof b!=="undefined"){if((b.namespaceURI!=="DAV:")||(nl.sara.webdav.Ie.getLocalName(b)!=="acl")){throw new nl.sara.webdav.Exception("Node is not of type DAV:acl",nl.sara.webdav.Exception.WRONG_XML);}for(var a=0;a<b.childNodes.length;a++){var c=b.childNodes.item(a);if((c.namespaceURI===null)||(c.namespaceURI!=="DAV:")||(nl.sara.webdav.Ie.getLocalName(c)!=="ace")){continue;}this.addAce(new nl.sara.webdav.Ace(c));}}};nl.sara.webdav.Acl.prototype.addAce=function(b,a){if(!nl.sara.webdav.Ie.isIE&&!(b instanceof nl.sara.webdav.Ace)){throw new nl.sara.webdav.Exception("Ace should be instance of Ace",nl.sara.webdav.Exception.WRONG_TYPE);}if((a===undefined)||(a>(this._aces.length-1))){this._aces.push(b);}else{a=Number(a);if(a<1){this._aces.unshift(b);}else{this._aces.splice(a,0,b);}}return this;};nl.sara.webdav.Acl.prototype.getAces=function(){return this._aces;};nl.sara.webdav.Acl.prototype.getAce=function(a){a=Number(a);if((a<0)||(a>=this.getLength())){throw new nl.sara.webdav.Exception("No ACE found on position "+a,nl.sara.webdav.Exception.UNEXISTING_PROPERTY);}return this._aces[a];};nl.sara.webdav.Acl.prototype.getLength=function(){return this._aces.length;};"use strict";if(nl.sara.webdav.codec.AclCodec!==undefined){throw new nl.sara.webdav.Exception("Namespace nl.sara.webdav.codec.AclCodec already taken, could not load JavaScript library for WebDAV connectivity.",nl.sara.webdav.Exception.NAMESPACE_TAKEN);}nl.sara.webdav.codec.AclCodec=new nl.sara.webdav.Codec();nl.sara.webdav.codec.AclCodec.namespace="DAV:";nl.sara.webdav.codec.AclCodec.tagname="acl";nl.sara.webdav.codec.AclCodec.fromXML=function(b){var c=document.implementation.createDocument("DAV:","acl",null);var d=c.documentElement;for(var a=0;a<b.length;a++){d.appendChild(c.importNode(b.item(a),true));}return new nl.sara.webdav.Acl(d);};nl.sara.webdav.codec.AclCodec.toXML=function(a,n){var v=a.getLength();for(var w=0;w<v;w++){var d=a.getAce(w);var y=n.createElementNS("DAV:","ace");var z=n.createElementNS("DAV:","principal");var h=d.principal;switch(h){case nl.sara.webdav.Ace.ALL:z.appendChild(n.createElementNS("DAV:","all"));break;case nl.sara.webdav.Ace.AUTHENTICATED:z.appendChild(n.createElementNS("DAV:","authenticated"));break;case nl.sara.webdav.Ace.UNAUTHENTICATED:z.appendChild(n.createElementNS("DAV:","unauthenticated"));break;case nl.sara.webdav.Ace.SELF:z.appendChild(n.createElementNS("DAV:","self"));break;default:if(typeof h==="string"){var x=n.createElementNS("DAV:","href");x.appendChild(n.createCDATASection(h));z.appendChild(x);}else{var e=n.createElementNS("DAV:","property");var b=n.createElementNS(h.namespace,h.tagname);if(h.xmlvalue!==null){for(var u=0;u<h.xmlvalue.length;u++){var t=n.importNode(h.xmlValue.item(u),true);b.appendChild(t);}}e.appendChild(b);z.appendChild(e);}break;}if(d.invertprincipal){var q=n.createElementNS("DAV:","invert");q.appendChild(z);y.appendChild(q);}else{y.appendChild(z);}var f=null;if(d.grantdeny===nl.sara.webdav.Ace.DENY){f=n.createElementNS("DAV:","deny");}else{if(d.grantdeny===nl.sara.webdav.Ace.GRANT){f=n.createElementNS("DAV:","grant");}else{throw new nl.sara.webdav.Exception("'grantdeny' property not set on one of the ACE's in this ACL",nl.sara.webdav.Exception.WRONG_VALUE);}}var o=d.getNamespaceNames();for(u=0;u<o.length;u++){var p=o[u];var m=d.getPrivilegeNames(p);for(var s=0;s<m.length;s++){var c=d.getPrivilege(p,m[s]);var g=n.createElementNS("DAV:","privilege");var A=n.createElementNS(c.namespace,c.tagname);if(c.xmlvalue!==null){for(var r=0;r<c.xmlvalue.length;r++){var t=n.importNode(c.xmlValue.item(u),true);A.appendChild(t);}}g.appendChild(A);f.appendChild(g);}}y.appendChild(f);n.documentElement.appendChild(y);}return n;};nl.sara.webdav.Property.addCodec(nl.sara.webdav.codec.AclCodec);"use strict";nl.sara.webdav.Client.prototype.acl=function(i,g,h,b){if((i===undefined)||(g===undefined)){throw new nl.sara.webdav.Exception("ACL requires the parameters path, callback and acl",nl.sara.webdav.Exception.MISSING_REQUIRED_PARAMETER);}if(!(typeof i==="string")||(!nl.sara.webdav.Ie.isIE&&!(h instanceof nl.sara.webdav.Acl))){throw new nl.sara.webdav.Exception("ACL parameter; path should be a string, acl should be an instance of Acl",nl.sara.webdav.Exception.WRONG_TYPE);}var a=this.getUrl(i);var c=document.implementation.createDocument("DAV:","acl",null);c=nl.sara.webdav.codec.AclCodec.toXML(h,c);var f=new XMLSerializer();var d='<?xml version="1.0" encoding="utf-8" ?>'+f.serializeToString(c);var e=null;if(nl.sara.webdav.Ie.isIE){if(a.lastIndexOf("?")!==-1){a=a+"&_method=acl";}else{a=a+"?_method=acl";}e=nl.sara.webdav.Client.getAjax("POST",a,g,b);}else{e=nl.sara.webdav.Client.getAjax("ACL",a,g,b);}e.setRequestHeader("Content-Type",'application/xml; charset="utf-8"');e.send(d);return this;};nl.sara.webdav.Client.prototype.report=function(e,g,a,f){if((e===undefined)||(g===undefined)||(a===undefined)){throw new nl.sara.webdav.Exception("REPORT requires the parameters path, callback and body",nl.sara.webdav.Exception.MISSING_REQUIRED_PARAMETER);}if((typeof e!=="string")||(!nl.sara.webdav.Ie.isIE&&!(a instanceof Document))){throw new nl.sara.webdav.Exception("REPORT parameter; path should be a string, body should be an instance of Document",nl.sara.webdav.Exception.WRONG_TYPE);}var b=this.getUrl(e);var c=new XMLSerializer();var a='<?xml version="1.0" encoding="utf-8" ?>'+c.serializeToString(a);var d=null;if(nl.sara.webdav.Ie.isIE){if(b.lastIndexOf("?")!==-1){b=b+"&_method=report";}else{b=b+"?_method=report";}d=nl.sara.webdav.Client.getAjax("POST",b,g,f);}else{d=nl.sara.webdav.Client.getAjax("REPORT",b,g,f);}d.setRequestHeader("Content-Type",'application/xml; charset="utf-8"');d.send(a);return this;};"use strict";if(nl.sara.webdav.Privilege!==undefined){throw new nl.sara.webdav.Exception("Namespace nl.sara.webdav.Privilege already taken, could not load JavaScript library for WebDAV connectivity.",nl.sara.webdav.Exception.NAMESPACE_TAKEN);}nl.sara.webdav.Privilege=function(a){Object.defineProperty(this,"_xmlvalue",{value:null,enumerable:false,configurable:false,writable:true});Object.defineProperty(this,"namespace",{value:null,enumerable:true,configurable:false,writable:true});Object.defineProperty(this,"tagname",{value:null,enumerable:true,configurable:false,writable:true});if(typeof a!=="undefined"){this.namespace=a.namespaceURI;this.tagname=nl.sara.webdav.Ie.getLocalName(a);this.xmlvalue=a.childNodes;}};(function(){var a={};Object.defineProperty(nl.sara.webdav.Privilege.prototype,"xmlvalue",{set:function(b){if(b===null){this._xmlvalue=null;return;}if(!nl.sara.webdav.Ie.isIE&&!(b instanceof NodeList)){throw new nl.sara.webdav.Exception("xmlvalue must be an instance of NodeList",nl.sara.webdav.Exception.WRONG_TYPE);}this._xmlvalue=b;},get:function(){return this._xmlvalue;}});nl.sara.webdav.Privilege.addCodec=function(b){if(typeof b.namespace!=="string"){throw new nl.sara.webdav.Exception("addCodec: codec.namespace must be a String",nl.sara.webdav.Exception.WRONG_TYPE);}if(typeof b.tagname!=="string"){throw new nl.sara.webdav.Exception("addCodec: codec.tagname must be a String",nl.sara.webdav.Exception.WRONG_TYPE);}if(a[b.namespace]===undefined){a[b.namespace]={};}a[b.namespace][b.tagname]={fromXML:(b.fromXML?b.fromXML:undefined),toXML:(b.toXML?b.toXML:undefined)};};nl.sara.webdav.Privilege.prototype.setValueAndRebuildXml=function(d){var c=document.implementation.createDocument(this.namespace,this.tagname,null);if((a[this.namespace]===undefined)||(a[this.namespace][this.tagname]===undefined)||(a[this.namespace][this.tagname]["toXML"]===undefined)){if(d!==null){var b=c.createCDATASection(d);c.documentElement.appendChild(b);}this._xmlvalue=c.documentElement.childNodes;}else{this._xmlvalue=a[this.namespace][this.tagname]["toXML"](d,c).documentElement.childNodes;}};nl.sara.webdav.Privilege.prototype.getParsedValue=function(){if(this._xmlvalue.length>0){if((a[this.namespace]===undefined)||(a[this.namespace][this.tagname]===undefined)||(a[this.namespace][this.tagname]["fromXML"]===undefined)){var b="";for(var c=0;c<this._xmlvalue.length;c++){var d=this._xmlvalue.item(c);if((d.nodeType===3)||(d.nodeType===4)){b+=d.nodeValue;}else{b=undefined;break;}}return b;}else{return a[this.namespace][this.tagname]["fromXML"](this._xmlvalue);}}return null;};})();nl.sara.webdav.Privilege.prototype.toString=function(){return this.getParsedValue();};"use strict";if(nl.sara.webdav.codec.CreationdateCodec!==undefined){throw new nl.sara.webdav.Exception("Namespace nl.sara.webdav.codec.CreationdateCodec already taken, could not load JavaScript library for WebDAV connectivity.",nl.sara.webdav.Exception.NAMESPACE_TAKEN);}nl.sara.webdav.codec.CreationdateCodec=new nl.sara.webdav.Codec();nl.sara.webdav.codec.CreationdateCodec.namespace="DAV:";nl.sara.webdav.codec.CreationdateCodec.tagname="creationdate";nl.sara.webdav.codec.CreationdateCodec.fromXML=function(b){var a=b.item(0);if((a.nodeType===3)||(a.nodeType===4)){return new Date(a.nodeValue);}else{return null;}};nl.sara.webdav.codec.CreationdateCodec.toXML=function(c,b){var a=b.createCDATASection(c.toISOString());b.documentElement.appendChild(a);return b;};nl.sara.webdav.Property.addCodec(nl.sara.webdav.codec.CreationdateCodec);"use strict";if(nl.sara.webdav.codec.GetcontentlengthCodec!==undefined){throw new nl.sara.webdav.Exception("Namespace nl.sara.webdav.codec.GetcontentlengthCodec already taken, could not load JavaScript library for WebDAV connectivity.",nl.sara.webdav.Exception.NAMESPACE_TAKEN);}nl.sara.webdav.codec.GetcontentlengthCodec=new nl.sara.webdav.Codec();nl.sara.webdav.codec.GetcontentlengthCodec.namespace="DAV:";nl.sara.webdav.codec.GetcontentlengthCodec.tagname="getcontentlength";nl.sara.webdav.codec.GetcontentlengthCodec.fromXML=function(b){var a=b.item(0);if((a.nodeType===3)||(a.nodeType===4)){return parseInt(a.nodeValue);}else{return null;}};nl.sara.webdav.codec.GetcontentlengthCodec.toXML=function(c,b){var a=b.createCDATASection(c.toString());b.documentElement.appendChild(a);return b;};nl.sara.webdav.Property.addCodec(nl.sara.webdav.codec.GetcontentlengthCodec);"use strict";if(nl.sara.webdav.codec.GetlastmodifiedCodec!==undefined){throw new nl.sara.webdav.Exception("Namespace nl.sara.webdav.codec.GetlastmodifiedCodec already taken, could not load JavaScript library for WebDAV connectivity.",nl.sara.webdav.Exception.NAMESPACE_TAKEN);}nl.sara.webdav.codec.GetlastmodifiedCodec=new nl.sara.webdav.Codec();nl.sara.webdav.codec.GetlastmodifiedCodec.namespace="DAV:";nl.sara.webdav.codec.GetlastmodifiedCodec.tagname="getlastmodified";nl.sara.webdav.codec.GetlastmodifiedCodec.fromXML=function(b){var a=b.item(0);if((a.nodeType===3)||(a.nodeType===4)){return new Date(a.nodeValue);}else{return null;}};nl.sara.webdav.codec.GetlastmodifiedCodec.toXML=function(c,b){function g(i){i=i.toString();while(i.length<2){i="0"+i;}return i;}var h=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];var f=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];var e=g(c.getUTCDate())+" "+f[c.getUTCMonth()]+" "+c.getUTCFullYear();var d=g(c.getUTCHours())+":"+g(c.getUTCMinutes())+":"+g(c.getUTCSeconds());var a=b.createCDATASection(h[c.getUTCDay()]+", "+e+" "+d+" GMT");b.documentElement.appendChild(a);return b;};nl.sara.webdav.Property.addCodec(nl.sara.webdav.codec.GetlastmodifiedCodec);"use strict";if(nl.sara.webdav.codec.OwnerCodec!==undefined){throw new nl.sara.webdav.Exception("Namespace nl.sara.webdav.codec.OwnerCodec already taken, could not load JavaScript library for WebDAV connectivity.",nl.sara.webdav.Exception.NAMESPACE_TAKEN);}nl.sara.webdav.codec.OwnerCodec=new nl.sara.webdav.Codec();nl.sara.webdav.codec.OwnerCodec.namespace="DAV:";nl.sara.webdav.codec.OwnerCodec.tagname="owner";nl.sara.webdav.codec.OwnerCodec.fromXML=function(d){var a=null;var c=d[0];if((c.nodeType===1)&&(c.namespaceURI==="DAV:")&&(c.localName==="href")){var b=c.childNodes.item(0);if((b.nodeType===3)||(b.nodeType===4)){a=b.nodeValue;}}return a;};nl.sara.webdav.codec.OwnerCodec.toXML=function(c,b){var a=b.createElementNS("DAV:","href");a.appendChild(b.createCDATASection(c.toString()));b.documentElement.appendChild(a);return b;};nl.sara.webdav.Property.addCodec(nl.sara.webdav.codec.OwnerCodec);"use strict";if(nl.sara.webdav.codec===undefined){nl.sara.webdav.codec={};}if(nl.sara.webdav.codec.ResourcetypeCodec!==undefined){throw new nl.sara.webdav.Exception("Namespace nl.sara.webdav.codec.ResourcetypeCodec already taken, could not load JavaScript library for WebDAV connectivity.",nl.sara.webdav.Exception.NAMESPACE_TAKEN);}nl.sara.webdav.codec.ResourcetypeCodec=new nl.sara.webdav.Codec();nl.sara.webdav.codec.ResourcetypeCodec.namespace="DAV:";nl.sara.webdav.codec.ResourcetypeCodec.tagname="resourcetype";nl.sara.webdav.codec.ResourcetypeCodec.COLLECTION=1;nl.sara.webdav.codec.ResourcetypeCodec.UNSPECIFIED=2;nl.sara.webdav.codec.ResourcetypeCodec.PRINCIPAL=4;nl.sara.webdav.codec.ResourcetypeCodec.fromXML=function(c){for(var a=0;a<c.length;a++){var b=c.item(a);if(b.namespaceURI==="DAV:"){switch(nl.sara.webdav.Ie.getLocalName(b)){case"collection":return nl.sara.webdav.codec.ResourcetypeCodec.COLLECTION;case"principal":return nl.sara.webdav.codec.ResourcetypeCodec.PRINCIPAL;}}}return nl.sara.webdav.codec.ResourcetypeCodec.UNSPECIFIED;};nl.sara.webdav.codec.ResourcetypeCodec.toXML=function(b,a){switch(b){case nl.sara.webdav.codec.ResourcetypeCodec.COLLECTION:var c=a.createElementNS("DAV:","collection");a.documentElement.appendChild(c);case nl.sara.webdav.codec.ResourcetypeCodec.PRINCIPAL:var c=a.createElementNS("DAV:","principal");a.documentElement.appendChild(c);break;}return a;};nl.sara.webdav.Property.addCodec(nl.sara.webdav.codec.ResourcetypeCodec);\ No newline at end of file+nl.sara.webdav.Ie.getLocalName=function(a){if(nl.sara.webdav.Ie.isIE&&a.baseName){return a.baseName;}else{return a.localName;}};"use strict";if(nl.sara.webdav.Client!==undefined){throw new nl.sara.webdav.Exception("Namespace nl.sara.webdav.Client already taken, could not load JavaScript library for WebDAV connectivity.",nl.sara.webdav.Exception.NAMESPACE_TAKEN);}nl.sara.webdav.Client=function(c,b,a,e){Object.defineProperty(this,"_baseUrl",{value:null,enumerable:false,configurable:false,writable:true});Object.defineProperty(this,"_username",{value:null,enumerable:false,configurable:false,writable:true});Object.defineProperty(this,"_password",{value:null,enumerable:false,configurable:false,writable:true});Object.defineProperty(this,"_headers",{value:{},enumerable:false,configurable:false,writable:true});if(c!==undefined){var d;if(typeof(c)!=="string"){d=c.host;b=(c.useHTTPS!==false);a=c.port;e=c.defaultHeaders;if(c.username!==undefined){this._username=c.username;if(c.password!==undefined){this._password=c.password;}else{this._password="";}}}else{d=c;}if(d!==undefined){var f=(b===true)?"https":"http";a=(a!==undefined)?a:((f==="https")?443:80);this._baseUrl=f+"://"+d+((((f==="http")&&(a===80))||((f==="https")&&(a===443)))?"":":"+a);}}if(e!==undefined){this._headers=e;}};nl.sara.webdav.Client.PROPNAME=1;nl.sara.webdav.Client.ALLPROP=2;nl.sara.webdav.Client.INFINITY="infinity";nl.sara.webdav.Client.FAIL_ON_OVERWRITE=3;nl.sara.webdav.Client.TRUNCATE_ON_OVERWRITE=4;nl.sara.webdav.Client.SILENT_OVERWRITE=5;nl.sara.webdav.Client.prototype.getUrl=function(a){if(a.substring(0,1)!=="/"){a="/"+a;}if(this._baseUrl!==null){return this._baseUrl+a;}else{return a;}};nl.sara.webdav.Client.prototype.propfind=function(r,o,g,k,c,d){if((r===undefined)||(o===undefined)){throw new nl.sara.webdav.Exception("PROPFIND requires the parameters path and callback",nl.sara.webdav.Exception.MISSING_REQUIRED_PARAMETER);}if(!(typeof r==="string")){throw new nl.sara.webdav.Exception("PROPFIND parameter; path should be a string",nl.sara.webdav.Exception.WRONG_TYPE);}var b=this.getUrl(r);if(g===undefined){g=0;}var n=null;switch(g){case 0:case 1:n=g;break;case nl.sara.webdav.Client.INFINITY:n="infinity";break;default:throw new nl.sara.webdav.Exception("Depth header should be '0', '1' or nl.sara.webdav.Client.INFINITY",nl.sara.webdav.Exception.WRONG_VALUE);break;}if(k===undefined){k=nl.sara.webdav.Client.ALLPROP;}var e=document.implementation.createDocument("DAV:","propfind",null);switch(k){case nl.sara.webdav.Client.PROPNAME:e.documentElement.appendChild(e.createElementNS("DAV:","propname"));break;case nl.sara.webdav.Client.ALLPROP:e.documentElement.appendChild(e.createElementNS("DAV:","allprop"));if(c!==undefined){if(!(c instanceof Array)){throw new nl.sara.webdav.Exception("Propfind parameter; include should be an array",nl.sara.webdav.Exception.WRONG_TYPE);}var h=e.createElementNS("DAV:","include");for(var f=0;f<c.length;f++){var p=c[f];if(!nl.sara.webdav.Ie.isIE&&!(p instanceof nl.sara.webdav.Property)){continue;}h.appendChild(e.createElementNS(p.namespace,p.tagname));}if(h.hasChildNodes()){e.documentElement.appendChild(h);}}break;default:if(!(k instanceof Array)){throw new nl.sara.webdav.Exception("Props parameter should be nl.sara.webdav.Client.PROPNAME, nl.sara.webdav.Client.ALLPROP or an array with Property objects",nl.sara.webdav.Exception.WRONG_VALUE);}var q=e.createElementNS("DAV:","prop");for(var f=0;f<k.length;f++){var a=k[f];if(!nl.sara.webdav.Ie.isIE&&!(a instanceof nl.sara.webdav.Property)){continue;}q.appendChild(e.createElementNS(a.namespace,a.tagname));}if(!q.hasChildNodes()){throw new nl.sara.webdav.Exception("Propfind parameter; if props is an array, it should be an array of Properties",nl.sara.webdav.Exception.WRONG_TYPE);}e.documentElement.appendChild(q);break;}var m=new XMLSerializer();var j='<?xml version="1.0" encoding="utf-8" ?>'+m.serializeToString(e);var l=this.getAjax("PROPFIND",b,o,d);l.setRequestHeader("Depth",n);l.setRequestHeader("Content-Type",'application/xml; charset="utf-8"');l.send(j);return this;};nl.sara.webdav.Client.prototype.proppatch=function(o,g,n,m,c){if((o===undefined)||(g===undefined)||((n===undefined)&&(m===undefined))){throw new nl.sara.webdav.Exception("PROPPATCH requires the parameters path, callback and at least one of setProps or delProps",nl.sara.webdav.Exception.MISSING_REQUIRED_PARAMETER);}if(!(typeof o==="string")||((n!==undefined)&&!(n instanceof Array))||((m!==undefined)&&!(m instanceof Array))){throw new nl.sara.webdav.Exception("PROPPATCH parameter; path should be a string, setProps and delProps should be arrays",nl.sara.webdav.Exception.WRONG_TYPE);}var f=this.getUrl(o);var a=document.implementation.createDocument("DAV:","propertyupdate",null);if(n!==undefined){var e=a.createElementNS("DAV:","prop");for(var r=0;r<n.length;r++){var d=n[r];if(!nl.sara.webdav.Ie.isIE&&!(d instanceof nl.sara.webdav.Property)){continue;}var b=a.createElementNS(d.namespace,d.tagname);for(var q=0;q<d.xmlvalue.length;q++){var p=a.importNode(d.xmlvalue.item(q),true);b.appendChild(p);}e.appendChild(b);}if(!e.hasChildNodes()){throw new nl.sara.webdav.Exception("Proppatch parameter; setProps should be an array of Properties",nl.sara.webdav.Exception.WRONG_TYPE);}var k=a.createElementNS("DAV:","set");k.appendChild(e);a.documentElement.appendChild(k);}if(m!==undefined){var e=a.createElementNS("DAV:","prop");for(var r=0;r<m.length;r++){var d=m[r];if(!nl.sara.webdav.Ie.isIE&&!(d instanceof nl.sara.webdav.Property)){continue;}var b=a.createElementNS(d.namespace,d.tagname);e.appendChild(b);}if(!e.hasChildNodes()){throw new nl.sara.webdav.Exception("Proppatch parameter; delProps should be an array of Properties",nl.sara.webdav.Exception.WRONG_TYPE);}var t=a.createElementNS("DAV:","remove");t.appendChild(e);a.documentElement.appendChild(t);}var s=new XMLSerializer();var h='<?xml version="1.0" encoding="utf-8" ?>'+s.serializeToString(a);var l=this.getAjax("PROPPATCH",f,g,c);l.setRequestHeader("Content-Type",'application/xml; charset="utf-8"');l.send(h);return this;};nl.sara.webdav.Client.prototype.mkcol=function(e,g,a,b,f){if((e===undefined)||(g===undefined)){throw new nl.sara.webdav.Exception("MKCOL requires the parameters path and callback",nl.sara.webdav.Exception.MISSING_REQUIRED_PARAMETER);}if((typeof e!=="string")||((b!==undefined)&&(typeof b!=="string"))){throw new nl.sara.webdav.Exception("MKCOL parameter; path and contenttype should be strings",nl.sara.webdav.Exception.WRONG_TYPE);}var c=this.getUrl(e);var d=this.getAjax("MKCOL",c,g,f);if(a!==undefined){if(b!==undefined){d.setRequestHeader("Content-Type",b);}d.send(a);}else{d.send();}return this;};nl.sara.webdav.Client.prototype.remove=function(c,e,d){if((c===undefined)||(e===undefined)){throw new nl.sara.webdav.Exception("DELETE requires the parameters path and callback",nl.sara.webdav.Exception.MISSING_REQUIRED_PARAMETER);}if(typeof c!=="string"){throw new nl.sara.webdav.Exception("DELETE parameter; path should be strings",nl.sara.webdav.Exception.WRONG_TYPE);}var a=this.getUrl(c);var b=this.getAjax("DELETE",a,e,d);b.send();return this;};nl.sara.webdav.Client.prototype.get=function(c,e,d){if((c===undefined)||(e===undefined)){throw new nl.sara.webdav.Exception("GET requires the parameters path and callback",nl.sara.webdav.Exception.MISSING_REQUIRED_PARAMETER);}if(typeof c!=="string"){throw new nl.sara.webdav.Exception("GET parameter; path should be strings",nl.sara.webdav.Exception.WRONG_TYPE);}var a=this.getUrl(c);var b=null;b=this.getAjax("GET",a,e,d);b.send();return this;};nl.sara.webdav.Client.prototype.head=function(c,e,d){if((c===undefined)||(e===undefined)){throw new nl.sara.webdav.Exception("HEAD requires the parameters path and callback",nl.sara.webdav.Exception.MISSING_REQUIRED_PARAMETER);}if(typeof c!=="string"){throw new nl.sara.webdav.Exception("HEAD parameter; path should be strings",nl.sara.webdav.Exception.WRONG_TYPE);}var a=this.getUrl(c);var b=null;b=this.getAjax("HEAD",a,e,d);b.send();return this;};nl.sara.webdav.Client.prototype.put=function(e,g,a,b,f){if((e===undefined)||(g===undefined)||(a===undefined)){throw new nl.sara.webdav.Exception("PUT requires the parameters path, callback and body",nl.sara.webdav.Exception.MISSING_REQUIRED_PARAMETER);}if((typeof e!=="string")||((b!==undefined)&&(typeof b!=="string"))){throw new nl.sara.webdav.Exception("PUT parameter; path and contenttype should be strings",nl.sara.webdav.Exception.WRONG_TYPE);}var c=this.getUrl(e);var d=null;d=this.getAjax("PUT",c,g,f);if(b!==undefined){d.setRequestHeader("Content-Type",b);}d.send(a);return this;};nl.sara.webdav.Client.prototype.options=function(e,g,a,b,f){if((e===undefined)||(g===undefined)){throw new nl.sara.webdav.Exception("OPTIONS requires the parameters path and callback",nl.sara.webdav.Exception.MISSING_REQUIRED_PARAMETER);}if((typeof e!=="string")||((a!==undefined)&&(typeof a!=="string"))||((b!==undefined)&&(typeof b!=="string"))){throw new nl.sara.webdav.Exception("OPTIONS parameter; path, body and contenttype should be strings",nl.sara.webdav.Exception.WRONG_TYPE);}var c=this.getUrl(e);var d=null;d=this.getAjax("OPTIONS",c,g,f);if(a!==undefined){if(b!==undefined){d.setRequestHeader("Content-Type",b);}else{d.setRequestHeader("Content-Type","application/x-www-form-urlencoded");}d.send(a);}else{d.send();}return this;};nl.sara.webdav.Client.prototype.post=function(e,g,a,b,f){if((e===undefined)||(g===undefined)){throw new nl.sara.webdav.Exception("POST requires the parameters path and callback",nl.sara.webdav.Exception.MISSING_REQUIRED_PARAMETER);}if((typeof e!=="string")||((a!==undefined)&&(typeof a!=="string"))||((b!==undefined)&&(typeof b!=="string"))){throw new nl.sara.webdav.Exception("POST parameter; path, body and contenttype should be strings",nl.sara.webdav.Exception.WRONG_TYPE);}var c=this.getUrl(e);var d=null;d=this.getAjax("POST",c,g,f);if(a!==undefined){if(b!==undefined){d.setRequestHeader("Content-Type",b);}else{d.setRequestHeader("Content-Type","application/x-www-form-urlencoded");}d.send(a);}else{d.send();}return this;};nl.sara.webdav.Client.prototype.copy=function(e,h,a,b,g,f){if((e===undefined)||(h===undefined)||(a===undefined)){throw new nl.sara.webdav.Exception("COPY requires the parameters path, callback and destination",nl.sara.webdav.Exception.MISSING_REQUIRED_PARAMETER);}if((typeof e!=="string")||(typeof a!=="string")){throw new nl.sara.webdav.Exception("COPY parameter; path and destination should be strings",nl.sara.webdav.Exception.WRONG_TYPE);}var c=this.getUrl(e);if(a.substr(0,1)==="/"){a=this.getUrl(a);}var d=this.getAjax("COPY",c,h,f);d.setRequestHeader("Destination",a);if(g!==undefined){if((g!==0)&&(g!=="infinity")){throw new nl.sara.webdav.Exception("COPY parameter; depth should be '0' or 'infinity'",nl.sara.webdav.Exception.WRONG_VALUE);}d.setRequestHeader("Depth",g);}if(b===nl.sara.webdav.Client.FAIL_ON_OVERWRITE){d.setRequestHeader("Overwrite","F");}d.send();return this;};nl.sara.webdav.Client.prototype.move=function(e,g,a,b,f){if((e===undefined)||(g===undefined)||(a===undefined)){throw new nl.sara.webdav.Exception("MOVE requires the parameters path, callback and destination",nl.sara.webdav.Exception.MISSING_REQUIRED_PARAMETER);}if((typeof e!=="string")||(typeof a!=="string")){throw new nl.sara.webdav.Exception("MOVE parameter; path and destination should be strings",nl.sara.webdav.Exception.WRONG_TYPE);}var c=this.getUrl(e);if(a.substr(0,1)==="/"){a=this.getUrl(a);}var d=this.getAjax("MOVE",c,g,f);d.setRequestHeader("Destination",a);if(b===nl.sara.webdav.Client.FAIL_ON_OVERWRITE){d.setRequestHeader("Overwrite","F");}else{if(b===nl.sara.webdav.Client.TRUNCATE_ON_OVERWRITE){d.setRequestHeader("Overwrite","T");}}d.send();return this;};nl.sara.webdav.Client.prototype.lock=function(e,g,a,f){if((e===undefined)||(g===undefined)){throw new nl.sara.webdav.Exception("LOCK requires the parameters path and callback",nl.sara.webdav.Exception.MISSING_REQUIRED_PARAMETER);}if((typeof e!=="string")||(!nl.sara.webdav.Ie.isIE&&(a!==undefined)&&!(a instanceof Document))){throw new nl.sara.webdav.Exception("LOCK parameter; path should be a string, body should be an instance of Document",nl.sara.webdav.Exception.WRONG_TYPE);}var b=this.getUrl(e);var c=new XMLSerializer();var a='<?xml version="1.0" encoding="utf-8" ?>'+c.serializeToString(a);var d=null;d=this.getAjax("LOCK",b,g,f);if(a!==undefined){d.setRequestHeader("Content-Type",'application/xml; charset="utf-8"');d.send(a);}else{d.send();}return this;};nl.sara.webdav.Client.prototype.unlock=function(d,f,b,e){if((d===undefined)||(f===undefined)||(b===undefined)){throw new nl.sara.webdav.Exception("UNLOCK requires the parameters path, callback and lockToken",nl.sara.webdav.Exception.MISSING_REQUIRED_PARAMETER);}if((typeof d!=="string")||(typeof b!=="string")){throw new nl.sara.webdav.Exception("UNLOCK parameter; path and lockToken should be strings",nl.sara.webdav.Exception.WRONG_TYPE);}var a=this.getUrl(d);e["Lock-Token"]=b;var c=null;c=this.getAjax("UNLOCK",a,f,e);c.send();return this;};nl.sara.webdav.Client.prototype.getAjax=function(f,a,e,c){var b=(((typeof Components!=="undefined")&&(typeof Components.classes!=="undefined"))?Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(Components.interfaces.nsIXMLHttpRequest):new XMLHttpRequest());if(this._username!==null){b.open(f,a,true,this._username,this._password);}else{b.open(f,a,true);}b.onreadystatechange=function(){nl.sara.webdav.Client.ajaxHandler(b,e);};if(c===undefined){c={};}for(var d in this._headers){if(c[d]===undefined){b.setRequestHeader(d,this._headers[d]);}}for(var d in c){b.setRequestHeader(d,c[d]);}return b;};nl.sara.webdav.Client.ajaxHandler=function(c,d){if(c.readyState===4){var a=c.responseText;if(c.status===207){for(var b=0;b<c.responseXML.childNodes.length;b++){if(nl.sara.webdav.Ie.getLocalName(c.responseXML.childNodes.item(b))==="multistatus"){a=new nl.sara.webdav.Multistatus(c.responseXML.childNodes.item(b));break;}}}d(c.status,a,c.getAllResponseHeaders());}};"use strict";if(nl.sara.webdav.Codec!==undefined){throw new nl.sara.webdav.Exception("Namespace name nl.sara.webdav.Codec already taken, could not load JavaScript library for WebDAV connectivity.",nl.sara.webdav.Exception.NAMESPACE_TAKEN);}nl.sara.webdav.Codec=function(b,c,a,d){Object.defineProperty(this,"namespace",{value:null,enumerable:true,configurable:false,writable:true});Object.defineProperty(this,"tagname",{value:null,enumerable:true,configurable:false,writable:true});Object.defineProperty(this,"toXML",{value:undefined,enumerable:true,configurable:false,writable:true});Object.defineProperty(this,"fromXML",{value:undefined,enumerable:true,configurable:false,writable:true});if(b!==undefined){this.namespace=b;}if(c!==undefined){this.tagname=c;}if(a!==undefined){this.toXML=a;}if(d!==undefined){this.fromXML=d;}};"use strict";if(nl.sara.webdav.Multistatus!==undefined){throw new nl.sara.webdav.Exception("Namespace nl.sara.webdav.Multistatus already taken, could not load JavaScript library for WebDAV connectivity.",nl.sara.webdav.Exception.NAMESPACE_TAKEN);}nl.sara.webdav.Multistatus=function(n){Object.defineProperty(this,"_responses",{value:{},enumerable:false,configurable:false,writable:true});Object.defineProperty(this,"responsedescription",{value:null,enumerable:true,configurable:false,writable:true});if(typeof n!=="undefined"){if((n.namespaceURI!=="DAV:")||(nl.sara.webdav.Ie.getLocalName(n)!=="multistatus")){throw new nl.sara.webdav.Exception("Node is not of type DAV:multistatus",nl.sara.webdav.Exception.WRONG_XML);}var g=n.childNodes;for(var l=0;l<g.length;l++){var b=g.item(l);if((b.namespaceURI===null)||(b.namespaceURI!=="DAV:")){continue;}switch(nl.sara.webdav.Ie.getLocalName(b)){case"responsedescription":this.responsedescription=b.childNodes.item(0).nodeValue;break;case"response":var e=new nl.sara.webdav.Response(b);var h=b.childNodes;var m=[];for(var f=0;f<h.length;f++){var c=h.item(f);if((nl.sara.webdav.Ie.getLocalName(c)==="href")&&(c.namespaceURI!==null)&&(c.namespaceURI==="DAV:")){m.push(c.childNodes.item(0).nodeValue);}}if(m.length>1){for(var d=0;d<m.length;d++){var a=new nl.sara.webdav.Response();a.href=m[d];a.status=e.status;a.error=e.error;a.responsedescription=e.responsedescription;a.location=e.location;this.addResponse(a);}}else{this.addResponse(e);}break;}}}};nl.sara.webdav.Multistatus.prototype.addResponse=function(a){if(!nl.sara.webdav.Ie.isIE&&!(a instanceof nl.sara.webdav.Response)){throw new nl.sara.webdav.Exception("Response should be instance of Response",nl.sara.webdav.Exception.WRONG_TYPE);}var b=a.href;this._responses[b]=a;return this;};nl.sara.webdav.Multistatus.prototype.getResponse=function(a){return this._responses[a];};nl.sara.webdav.Multistatus.prototype.getResponseNames=function(){return Object.keys(this._responses);};"use strict";if(nl.sara.webdav.Property!==undefined){throw new nl.sara.webdav.Exception("Namespace name nl.sara.webdav.Property already taken, could not load JavaScript library for WebDAV connectivity.",nl.sara.webdav.Exception.NAMESPACE_TAKEN);}nl.sara.webdav.Property=function(c,a,d,e){Object.defineProperty(this,"_xmlvalue",{value:null,enumerable:false,configurable:false,writable:true});Object.defineProperty(this,"_errors",{value:[],enumerable:false,configurable:false,writable:true});Object.defineProperty(this,"namespace",{value:null,enumerable:true,configurable:false,writable:true});Object.defineProperty(this,"tagname",{value:null,enumerable:true,configurable:false,writable:true});Object.defineProperty(this,"status",{value:null,enumerable:true,configurable:false,writable:true});Object.defineProperty(this,"responsedescription",{value:null,enumerable:true,configurable:false,writable:true});if((typeof c!=="undefined")&&(c.nodeType===1)){this.namespace=c.namespaceURI;this.tagname=nl.sara.webdav.Ie.getLocalName(c);this.xmlvalue=c.childNodes;}if(a!==undefined){this.status=a;}if(d!==undefined){this.responsedescription=d;}if(e instanceof Array){for(var b=0;b<e.length;b++){this.addError(e[b]);}}};(function(){var a={};Object.defineProperty(nl.sara.webdav.Property.prototype,"xmlvalue",{set:function(b){if(b===null){this._xmlvalue=null;return;}if(!nl.sara.webdav.Ie.isIE&&!(b instanceof NodeList)){throw new nl.sara.webdav.Exception("xmlvalue must be an instance of NodeList",nl.sara.webdav.Exception.WRONG_TYPE);}this._xmlvalue=b;},get:function(){return this._xmlvalue;}});nl.sara.webdav.Property.addCodec=function(b){if(typeof b.namespace!=="string"){throw new nl.sara.webdav.Exception("addCodec: codec.namespace must be a String",nl.sara.webdav.Exception.WRONG_TYPE);}if(typeof b.tagname!=="string"){throw new nl.sara.webdav.Exception("addCodec: codec.tagname must be a String",nl.sara.webdav.Exception.WRONG_TYPE);}if(a[b.namespace]===undefined){a[b.namespace]={};}a[b.namespace][b.tagname]={fromXML:(b.fromXML?b.fromXML:undefined),toXML:(b.toXML?b.toXML:undefined)};};nl.sara.webdav.Property.prototype.setValueAndRebuildXml=function(d){var c=document.implementation.createDocument(this.namespace,this.tagname,null);if((a[this.namespace]===undefined)||(a[this.namespace][this.tagname]===undefined)||(a[this.namespace][this.tagname]["toXML"]===undefined)){if(d!==null){var b=c.createCDATASection(d);c.documentElement.appendChild(b);}this._xmlvalue=c.documentElement.childNodes;}else{this._xmlvalue=a[this.namespace][this.tagname]["toXML"](d,c).documentElement.childNodes;}};nl.sara.webdav.Property.prototype.getParsedValue=function(){if(this._xmlvalue.length>0){if((a[this.namespace]===undefined)||(a[this.namespace][this.tagname]===undefined)||(a[this.namespace][this.tagname]["fromXML"]===undefined)){var b="";for(var c=0;c<this._xmlvalue.length;c++){var d=this._xmlvalue.item(c);if((d.nodeType===3)||(d.nodeType===4)){b+=d.nodeValue;}else{b=undefined;break;}}return b;}else{return a[this.namespace][this.tagname]["fromXML"](this._xmlvalue);}}return null;};})();nl.sara.webdav.Property.prototype.addError=function(a){if(!nl.sara.webdav.Ie.isIE&&!(a instanceof Node)){throw new nl.sara.webdav.Exception("Error must be an instance of Node",nl.sara.webdav.Exception.WRONG_TYPE);}this._errors.push(a);return this;};nl.sara.webdav.Property.prototype.getErrors=function(){return this._errors;};nl.sara.webdav.Property.prototype.toString=function(){return this.getParsedValue();};"use strict";if(nl.sara.webdav.Response!==undefined){throw new nl.sara.webdav.Exception("Namespace nl.sara.webdav.Response already taken, could not load JavaScript library for WebDAV connectivity.",nl.sara.webdav.Exception.NAMESPACE_TAKEN);}nl.sara.webdav.Response=function(o){Object.defineProperty(this,"_namespaces",{value:{},enumerable:false,configurable:false,writable:true});Object.defineProperty(this,"href",{value:null,enumerable:true,configurable:false,writable:true});Object.defineProperty(this,"status",{value:null,enumerable:true,configurable:false,writable:true});Object.defineProperty(this,"error",{value:null,enumerable:true,configurable:false,writable:true});Object.defineProperty(this,"responsedescription",{value:null,enumerable:true,configurable:false,writable:true});Object.defineProperty(this,"location",{value:null,enumerable:true,configurable:false,writable:true});if(typeof o!=="undefined"){if((o.namespaceURI!=="DAV:")||(nl.sara.webdav.Ie.getLocalName(o)!=="response")){throw new nl.sara.webdav.Exception("Node is not of type DAV:response",nl.sara.webdav.Exception.WRONG_XML);}var f=o.childNodes;for(var g=0;g<f.length;g++){var a=f.item(g);if((a.namespaceURI===null)||(a.namespaceURI!=="DAV:")){continue;}switch(nl.sara.webdav.Ie.getLocalName(a)){case"href":case"status":case"error":case"responsedescription":this[nl.sara.webdav.Ie.getLocalName(a)]=a.childNodes.item(0).nodeValue;break;case"location":this[nl.sara.webdav.Ie.getLocalName(a)]=a.childNodes.item(0).childNodes.item(0).nodeValue;break;case"propstat":var p=a.childNodes;var e=null;var m=[];var b=null;var l=[];for(var d=0;d<p.length;d++){var h=p.item(d);if((h.nodeType!==1)||(h.namespaceURI!=="DAV:")){continue;}switch(nl.sara.webdav.Ie.getLocalName(h)){case"prop":for(var c=0;c<h.childNodes.length;c++){l.push(h.childNodes.item(c));}break;case"error":for(c=0;c<h.childNodes.length;c++){m.push(h.childNodes.item(c));}break;break;case"status":e=h.childNodes.item(0).nodeValue;e=parseInt(e.substr(e.indexOf(" ")+1,3));break;case"responsedescription":b=h.childNodes.item(0).nodeValue;break;}}for(d=0;d<l.length;d++){if(l[d].nodeType===1){var n=new nl.sara.webdav.Property(l[d],e,b,m);this.addProperty(n);}}break;}}}};nl.sara.webdav.Response.prototype.addProperty=function(b){if(!nl.sara.webdav.Ie.isIE&&!(b instanceof nl.sara.webdav.Property)){throw new nl.sara.webdav.Exception("Response property should be instance of Property",nl.sara.webdav.Exception.WRONG_TYPE);}var a=b.namespace;if(typeof a!=="string"){a="";}if(this._namespaces[a]===undefined){this._namespaces[a]={};}this._namespaces[a][b.tagname]=b;return this;};nl.sara.webdav.Response.prototype.getProperty=function(a,b){if((this._namespaces[a]===undefined)||(this._namespaces[a][b]===undefined)){return undefined;}return this._namespaces[a][b];};nl.sara.webdav.Response.prototype.getNamespaceNames=function(){return Object.keys(this._namespaces);};nl.sara.webdav.Response.prototype.getPropertyNames=function(a){if(this._namespaces[a]===undefined){return new Array();}return Object.keys(this._namespaces[a]);};"use strict";if(nl.sara.webdav.codec.Principal_collection_setCodec!==undefined){throw new nl.sara.webdav.Exception("Namespace nl.sara.webdav.codec.Principal_collection_setCodec already taken, could not load JavaScript library for WebDAV connectivity.",nl.sara.webdav.Exception.NAMESPACE_TAKEN);}nl.sara.webdav.codec.Principal_collection_setCodec=new nl.sara.webdav.Codec();nl.sara.webdav.codec.Principal_collection_setCodec.namespace="DAV:";nl.sara.webdav.codec.Principal_collection_setCodec.tagname="principal-collection-set";nl.sara.webdav.codec.Principal_collection_setCodec.fromXML=function(g){var f=[];for(var d=0;d<g.length;d++){var e=g.item(d);if((e.nodeType===1)&&(e.localName==="href")&&(e.namespaceURI==="DAV:")){var b="";for(var a=0;a<e.childNodes.length;a++){var c=e.childNodes.item(a);if((c.nodeType===3)||(c.nodeType===4)){b+=c.nodeValue;}}f.push(b);}}return f;};nl.sara.webdav.codec.Principal_collection_setCodec.toXML=function(d,c){for(var b in d){var a=c.createElementNS("DAV:","href");a.appendChild(c.createCDATASection(d[b]));c.documentElement.appendChild(a);}return c;};nl.sara.webdav.Property.addCodec(nl.sara.webdav.codec.Principal_collection_setCodec);"use strict";if(nl.sara.webdav.codec.Inherited_acl_setCodec!==undefined){throw new nl.sara.webdav.Exception("Namespace nl.sara.webdav.codec.Inherited_acl_setCodec already taken, could not load JavaScript library for WebDAV connectivity.",nl.sara.webdav.Exception.NAMESPACE_TAKEN);}nl.sara.webdav.codec.Inherited_acl_setCodec=new nl.sara.webdav.Codec();nl.sara.webdav.codec.Inherited_acl_setCodec.namespace="DAV:";nl.sara.webdav.codec.Inherited_acl_setCodec.tagname="inherited-acl-set";nl.sara.webdav.codec.Inherited_acl_setCodec.fromXML=nl.sara.webdav.codec.Principal_collection_setCodec.fromXML;nl.sara.webdav.codec.Inherited_acl_setCodec.toXML=nl.sara.webdav.codec.Principal_collection_setCodec.toXML;nl.sara.webdav.Property.addCodec(nl.sara.webdav.codec.Inherited_acl_setCodec);"use strict";if(nl.sara.webdav.Ace!==undefined){throw new nl.sara.webdav.Exception("Namespace nl.sara.webdav.Ace already taken, could not load JavaScript library for WebDAV connectivity.",nl.sara.webdav.Exception.NAMESPACE_TAKEN);}nl.sara.webdav.Ace=function(e){Object.defineProperty(this,"_namespaces",{value:{},enumerable:false,configurable:false,writable:true});Object.defineProperty(this,"_principal",{value:null,enumerable:false,configurable:false,writable:true});Object.defineProperty(this,"_invertprincipal",{value:false,enumerable:false,configurable:false,writable:true});Object.defineProperty(this,"_grantdeny",{value:null,enumerable:false,configurable:false,writable:true});Object.defineProperty(this,"_isprotected",{value:false,enumerable:false,configurable:false,writable:true});Object.defineProperty(this,"_inherited",{value:false,enumerable:false,configurable:false,writable:true});function a(m,q){if(!nl.sara.webdav.Ie.isIE&&!(q instanceof Node)){throw new nl.sara.webdav.Exception("Principal XML node not recognized!",nl.sara.webdav.Exception.WRONG_XML);}for(var l=0;l<q.childNodes.length;l++){var o=q.childNodes.item(l);if((o.nodeType!==1)||(o.namespaceURI===null)||(o.namespaceURI!=="DAV:")){continue;}switch(nl.sara.webdav.Ie.getLocalName(o)){case"href":m.principal=o.childNodes.item(0).nodeValue;break;case"all":m.principal=nl.sara.webdav.Ace.ALL;break;case"authenticated":m.principal=nl.sara.webdav.Ace.AUTHENTICATED;break;case"unauthenticated":m.principal=nl.sara.webdav.Ace.UNAUTHENTICATED;break;case"property":for(var i=0;i<o.childNodes.length;i++){var n=o.childNodes.item(i);if(n.nodeType!==1){continue;}var p=new nl.sara.webdav.Property(n);m.principal=p;break;}break;case"self":m.principal=nl.sara.webdav.Ace.SELF;break;default:throw new nl.sara.webdav.Exception("Principal XML Node contains illegal child node: "+nl.sara.webdav.Ie.getLocalName(o),nl.sara.webdav.Exception.WRONG_XML);break;}}}function f(k,m){for(var l=0;l<m.length;l++){var j=m.item(l);if((j.nodeType===1)&&(j.namespaceURI==="DAV:")&&(nl.sara.webdav.Ie.getLocalName(j)==="privilege")){k.addPrivilege(new nl.sara.webdav.Privilege(j.childNodes[0]));}}}if(typeof e!=="undefined"){if((e.namespaceURI!=="DAV:")||(nl.sara.webdav.Ie.getLocalName(e)!=="ace")){throw new nl.sara.webdav.Exception("Node is not of type DAV:ace",nl.sara.webdav.Exception.WRONG_XML);}var g=e.childNodes;for(var d=0;d<g.length;d++){var h=g.item(d);if((h.namespaceURI===null)||(h.namespaceURI!=="DAV:")){continue;}switch(nl.sara.webdav.Ie.getLocalName(h)){case"principal":this.invertprincipal=false;a(this,h);break;case"invert":this.invertprincipal=true;for(var b=0;b<h.childNodes.length;b++){var c=h.childNodes.item(b);if((c.namespaceURI!=="DAV:")||(nl.sara.webdav.Ie.getLocalName(c)!=="principal")){continue;}a(this,c);}break;case"grant":this.grantdeny=nl.sara.webdav.Ace.GRANT;f(this,h.childNodes);break;case"deny":this.grantdeny=nl.sara.webdav.Ace.DENY;f(this,h.childNodes);break;case"protected":this.isprotected=true;break;case"inherited":for(var b=0;b<h.childNodes.length;b++){var c=h.childNodes.item(b);if((c.namespaceURI!=="DAV:")||(nl.sara.webdav.Ie.getLocalName(c)!=="href")){continue;}this.inherited=h.childNodes.item(b).childNodes.item(0).nodeValue;}break;}}}};nl.sara.webdav.Ace.GRANT=1;nl.sara.webdav.Ace.DENY=2;nl.sara.webdav.Ace.ALL=3;nl.sara.webdav.Ace.AUTHENTICATED=4;nl.sara.webdav.Ace.UNAUTHENTICATED=5;nl.sara.webdav.Ace.SELF=6;Object.defineProperty(nl.sara.webdav.Ace.prototype,"principal",{set:function(a){switch(a){case nl.sara.webdav.Ace.ALL:case nl.sara.webdav.Ace.AUTHENTICATED:case nl.sara.webdav.Ace.UNAUTHENTICATED:case nl.sara.webdav.Ace.SELF:break;default:if(!nl.sara.webdav.Ie.isIE&&!(a instanceof nl.sara.webdav.Property)){a=String(a);}break;}this._principal=a;},get:function(){return this._principal;}});Object.defineProperty(nl.sara.webdav.Ace.prototype,"invertprincipal",{set:function(a){this._invertprincipal=Boolean(a);},get:function(){return this._invertprincipal;}});Object.defineProperty(nl.sara.webdav.Ace.prototype,"isprotected",{set:function(a){this._isprotected=Boolean(a);},get:function(){return this._isprotected;}});Object.defineProperty(nl.sara.webdav.Ace.prototype,"grantdeny",{set:function(a){if((a!==nl.sara.webdav.Ace.GRANT)&&(a!==nl.sara.webdav.Ace.DENY)){throw new nl.sara.webdav.Exception("grantdeny must be either nl.sara.webdav.Ace.GRANT or nl.sara.webdav.Ace.DENY",nl.sara.webdav.Exception.WRONG_VALUE);}this._grantdeny=a;},get:function(){return this._grantdeny;}});Object.defineProperty(nl.sara.webdav.Ace.prototype,"inherited",{set:function(a){if(Boolean(a)){this._inherited=String(a);}else{this._inherited=false;}},get:function(){return this._inherited;}});nl.sara.webdav.Ace.prototype.addPrivilege=function(a){if(!nl.sara.webdav.Ie.isIE&&!(a instanceof nl.sara.webdav.Privilege)){throw new nl.sara.webdav.Exception("Privilege should be instance of Privilege",nl.sara.webdav.Exception.WRONG_TYPE);}var b=a.namespace;if(b){if(this._namespaces[b]===undefined){this._namespaces[b]={};}}else{throw new nl.sara.webdav.Exception("Privilege should have a namespace",nl.sara.webdav.Exception.WRONG_TYPE);}this._namespaces[b][a.tagname]=a;return this;};nl.sara.webdav.Ace.prototype.getPrivilege=function(b,a){if((this._namespaces[b]===undefined)||(this._namespaces[b][a]===undefined)){return undefined;}return this._namespaces[b][a];};nl.sara.webdav.Ace.prototype.getNamespaceNames=function(){return Object.keys(this._namespaces);};nl.sara.webdav.Ace.prototype.getPrivilegeNames=function(a){if(this._namespaces[a]===undefined){return new Array();}return Object.keys(this._namespaces[a]);};"use strict";if(nl.sara.webdav.Acl!==undefined){throw new nl.sara.webdav.Exception("Namespace nl.sara.webdav.Acl already taken, could not load JavaScript library for WebDAV connectivity.",nl.sara.webdav.Exception.NAMESPACE_TAKEN);}nl.sara.webdav.Acl=function(b){Object.defineProperty(this,"_aces",{value:[],enumerable:false,configurable:false,writable:true});if(typeof b!=="undefined"){if((b.namespaceURI!=="DAV:")||(nl.sara.webdav.Ie.getLocalName(b)!=="acl")){throw new nl.sara.webdav.Exception("Node is not of type DAV:acl",nl.sara.webdav.Exception.WRONG_XML);}for(var a=0;a<b.childNodes.length;a++){var c=b.childNodes.item(a);if((c.namespaceURI===null)||(c.namespaceURI!=="DAV:")||(nl.sara.webdav.Ie.getLocalName(c)!=="ace")){continue;}this.addAce(new nl.sara.webdav.Ace(c));}}};nl.sara.webdav.Acl.prototype.addAce=function(b,a){if(!nl.sara.webdav.Ie.isIE&&!(b instanceof nl.sara.webdav.Ace)){throw new nl.sara.webdav.Exception("Ace should be instance of Ace",nl.sara.webdav.Exception.WRONG_TYPE);}if((a===undefined)||(a>(this._aces.length-1))){this._aces.push(b);}else{a=Number(a);if(a<1){this._aces.unshift(b);}else{this._aces.splice(a,0,b);}}return this;};nl.sara.webdav.Acl.prototype.getAces=function(){return this._aces;};nl.sara.webdav.Acl.prototype.getAce=function(a){a=Number(a);if((a<0)||(a>=this.getLength())){throw new nl.sara.webdav.Exception("No ACE found on position "+a,nl.sara.webdav.Exception.UNEXISTING_PROPERTY);}return this._aces[a];};nl.sara.webdav.Acl.prototype.getLength=function(){return this._aces.length;};"use strict";if(nl.sara.webdav.codec.AclCodec!==undefined){throw new nl.sara.webdav.Exception("Namespace nl.sara.webdav.codec.AclCodec already taken, could not load JavaScript library for WebDAV connectivity.",nl.sara.webdav.Exception.NAMESPACE_TAKEN);}nl.sara.webdav.codec.AclCodec=new nl.sara.webdav.Codec();nl.sara.webdav.codec.AclCodec.namespace="DAV:";nl.sara.webdav.codec.AclCodec.tagname="acl";nl.sara.webdav.codec.AclCodec.fromXML=function(b){var c=document.implementation.createDocument("DAV:","acl",null);var d=c.documentElement;for(var a=0;a<b.length;a++){d.appendChild(c.importNode(b.item(a),true));}return new nl.sara.webdav.Acl(d);};nl.sara.webdav.codec.AclCodec.toXML=function(a,n){var v=a.getLength();for(var w=0;w<v;w++){var d=a.getAce(w);var y=n.createElementNS("DAV:","ace");var z=n.createElementNS("DAV:","principal");var h=d.principal;switch(h){case nl.sara.webdav.Ace.ALL:z.appendChild(n.createElementNS("DAV:","all"));break;case nl.sara.webdav.Ace.AUTHENTICATED:z.appendChild(n.createElementNS("DAV:","authenticated"));break;case nl.sara.webdav.Ace.UNAUTHENTICATED:z.appendChild(n.createElementNS("DAV:","unauthenticated"));break;case nl.sara.webdav.Ace.SELF:z.appendChild(n.createElementNS("DAV:","self"));break;default:if(typeof h==="string"){var x=n.createElementNS("DAV:","href");x.appendChild(n.createCDATASection(h));z.appendChild(x);}else{var e=n.createElementNS("DAV:","property");var b=n.createElementNS(h.namespace,h.tagname);if(h.xmlvalue!==null){for(var u=0;u<h.xmlvalue.length;u++){var t=n.importNode(h.xmlValue.item(u),true);b.appendChild(t);}}e.appendChild(b);z.appendChild(e);}break;}if(d.invertprincipal){var q=n.createElementNS("DAV:","invert");q.appendChild(z);y.appendChild(q);}else{y.appendChild(z);}var f=null;if(d.grantdeny===nl.sara.webdav.Ace.DENY){f=n.createElementNS("DAV:","deny");}else{if(d.grantdeny===nl.sara.webdav.Ace.GRANT){f=n.createElementNS("DAV:","grant");}else{throw new nl.sara.webdav.Exception("'grantdeny' property not set on one of the ACE's in this ACL",nl.sara.webdav.Exception.WRONG_VALUE);}}var o=d.getNamespaceNames();for(u=0;u<o.length;u++){var p=o[u];var m=d.getPrivilegeNames(p);for(var s=0;s<m.length;s++){var c=d.getPrivilege(p,m[s]);var g=n.createElementNS("DAV:","privilege");var A=n.createElementNS(c.namespace,c.tagname);if(c.xmlvalue!==null){for(var r=0;r<c.xmlvalue.length;r++){var t=n.importNode(c.xmlValue.item(u),true);A.appendChild(t);}}g.appendChild(A);f.appendChild(g);}}y.appendChild(f);n.documentElement.appendChild(y);}return n;};nl.sara.webdav.Property.addCodec(nl.sara.webdav.codec.AclCodec);"use strict";nl.sara.webdav.Client.prototype.acl=function(i,g,h,b){if((i===undefined)||(g===undefined)){throw new nl.sara.webdav.Exception("ACL requires the parameters path, callback and acl",nl.sara.webdav.Exception.MISSING_REQUIRED_PARAMETER);}if(!(typeof i==="string")||(!nl.sara.webdav.Ie.isIE&&!(h instanceof nl.sara.webdav.Acl))){throw new nl.sara.webdav.Exception("ACL parameter; path should be a string, acl should be an instance of Acl",nl.sara.webdav.Exception.WRONG_TYPE);}var a=this.getUrl(i);var c=document.implementation.createDocument("DAV:","acl",null);c=nl.sara.webdav.codec.AclCodec.toXML(h,c);var f=new XMLSerializer();var d='<?xml version="1.0" encoding="utf-8" ?>'+f.serializeToString(c);var e=null;if(nl.sara.webdav.Ie.isIE){if(a.lastIndexOf("?")!==-1){a=a+"&_method=acl";}else{a=a+"?_method=acl";}e=this.getAjax("POST",a,g,b);}else{e=this.getAjax("ACL",a,g,b);}e.setRequestHeader("Content-Type",'application/xml; charset="utf-8"');e.send(d);return this;};nl.sara.webdav.Client.prototype.report=function(e,g,a,f){if((e===undefined)||(g===undefined)||(a===undefined)){throw new nl.sara.webdav.Exception("REPORT requires the parameters path, callback and body",nl.sara.webdav.Exception.MISSING_REQUIRED_PARAMETER);}if((typeof e!=="string")||(!nl.sara.webdav.Ie.isIE&&!(a instanceof Document))){throw new nl.sara.webdav.Exception("REPORT parameter; path should be a string, body should be an instance of Document",nl.sara.webdav.Exception.WRONG_TYPE);}var b=this.getUrl(e);var c=new XMLSerializer();var a='<?xml version="1.0" encoding="utf-8" ?>'+c.serializeToString(a);var d=null;if(nl.sara.webdav.Ie.isIE){if(b.lastIndexOf("?")!==-1){b=b+"&_method=report";}else{b=b+"?_method=report";}d=this.getAjax("POST",b,g,f);}else{d=this.getAjax("REPORT",b,g,f);}d.setRequestHeader("Content-Type",'application/xml; charset="utf-8"');d.send(a);return this;};"use strict";if(nl.sara.webdav.codec.Current_user_privilege_setCodec!==undefined){throw new nl.sara.webdav.Exception("Namespace nl.sara.webdav.codec.Current_user_privilege_setCodec already taken, could not load JavaScript library for WebDAV connectivity.",nl.sara.webdav.Exception.NAMESPACE_TAKEN);}nl.sara.webdav.codec.Current_user_privilege_setCodec=new nl.sara.webdav.Codec();nl.sara.webdav.codec.Current_user_privilege_setCodec.namespace="DAV:";nl.sara.webdav.codec.Current_user_privilege_setCodec.tagname="current-user-privilege-set";nl.sara.webdav.codec.Current_user_privilege_setCodec.fromXML=function(e){var c=[];for(var b=0;b<e.length;b++){var d=e.item(b);if((d.nodeType===1)){var a=new nl.sara.webdav.Privilege(d);c.push(a);}}return c;};nl.sara.webdav.codec.Current_user_privilege_setCodec.toXML=function(d,c){for(var b in d){var a=c.createElementNS(d[b].namespace,d[b].tagname);c.documentElement.appendChild(a);}return c;};nl.sara.webdav.Property.addCodec(nl.sara.webdav.codec.Current_user_privilege_setCodec);"use strict";if(nl.sara.webdav.Privilege!==undefined){throw new nl.sara.webdav.Exception("Namespace nl.sara.webdav.Privilege already taken, could not load JavaScript library for WebDAV connectivity.",nl.sara.webdav.Exception.NAMESPACE_TAKEN);}nl.sara.webdav.Privilege=function(a){Object.defineProperty(this,"_xmlvalue",{value:null,enumerable:false,configurable:false,writable:true});Object.defineProperty(this,"namespace",{value:null,enumerable:true,configurable:false,writable:true});Object.defineProperty(this,"tagname",{value:null,enumerable:true,configurable:false,writable:true});if(typeof a!=="undefined"){this.namespace=a.namespaceURI;this.tagname=nl.sara.webdav.Ie.getLocalName(a);this.xmlvalue=a.childNodes;}};(function(){var a={};Object.defineProperty(nl.sara.webdav.Privilege.prototype,"xmlvalue",{set:function(b){if(b===null){this._xmlvalue=null;return;}if(!nl.sara.webdav.Ie.isIE&&!(b instanceof NodeList)){throw new nl.sara.webdav.Exception("xmlvalue must be an instance of NodeList",nl.sara.webdav.Exception.WRONG_TYPE);}this._xmlvalue=b;},get:function(){return this._xmlvalue;}});nl.sara.webdav.Privilege.addCodec=function(b){if(typeof b.namespace!=="string"){throw new nl.sara.webdav.Exception("addCodec: codec.namespace must be a String",nl.sara.webdav.Exception.WRONG_TYPE);}if(typeof b.tagname!=="string"){throw new nl.sara.webdav.Exception("addCodec: codec.tagname must be a String",nl.sara.webdav.Exception.WRONG_TYPE);}if(a[b.namespace]===undefined){a[b.namespace]={};}a[b.namespace][b.tagname]={fromXML:(b.fromXML?b.fromXML:undefined),toXML:(b.toXML?b.toXML:undefined)};};nl.sara.webdav.Privilege.prototype.setValueAndRebuildXml=function(d){var c=document.implementation.createDocument(this.namespace,this.tagname,null);if((a[this.namespace]===undefined)||(a[this.namespace][this.tagname]===undefined)||(a[this.namespace][this.tagname]["toXML"]===undefined)){if(d!==null){var b=c.createCDATASection(d);c.documentElement.appendChild(b);}this._xmlvalue=c.documentElement.childNodes;}else{this._xmlvalue=a[this.namespace][this.tagname]["toXML"](d,c).documentElement.childNodes;}};nl.sara.webdav.Privilege.prototype.getParsedValue=function(){if(this._xmlvalue.length>0){if((a[this.namespace]===undefined)||(a[this.namespace][this.tagname]===undefined)||(a[this.namespace][this.tagname]["fromXML"]===undefined)){var b="";for(var c=0;c<this._xmlvalue.length;c++){var d=this._xmlvalue.item(c);if((d.nodeType===3)||(d.nodeType===4)){b+=d.nodeValue;}else{b=undefined;break;}}return b;}else{return a[this.namespace][this.tagname]["fromXML"](this._xmlvalue);}}return null;};})();nl.sara.webdav.Privilege.prototype.toString=function(){return this.getParsedValue();};"use strict";if(nl.sara.webdav.codec.CreationdateCodec!==undefined){throw new nl.sara.webdav.Exception("Namespace nl.sara.webdav.codec.CreationdateCodec already taken, could not load JavaScript library for WebDAV connectivity.",nl.sara.webdav.Exception.NAMESPACE_TAKEN);}nl.sara.webdav.codec.CreationdateCodec=new nl.sara.webdav.Codec();nl.sara.webdav.codec.CreationdateCodec.namespace="DAV:";nl.sara.webdav.codec.CreationdateCodec.tagname="creationdate";nl.sara.webdav.codec.CreationdateCodec.fromXML=function(b){var a=b.item(0);if((a.nodeType===3)||(a.nodeType===4)){return new Date(a.nodeValue);}else{return null;}};nl.sara.webdav.codec.CreationdateCodec.toXML=function(c,b){var a=b.createCDATASection(c.toISOString());b.documentElement.appendChild(a);return b;};nl.sara.webdav.Property.addCodec(nl.sara.webdav.codec.CreationdateCodec);"use strict";if(nl.sara.webdav.codec.GetcontentlengthCodec!==undefined){throw new nl.sara.webdav.Exception("Namespace nl.sara.webdav.codec.GetcontentlengthCodec already taken, could not load JavaScript library for WebDAV connectivity.",nl.sara.webdav.Exception.NAMESPACE_TAKEN);}nl.sara.webdav.codec.GetcontentlengthCodec=new nl.sara.webdav.Codec();nl.sara.webdav.codec.GetcontentlengthCodec.namespace="DAV:";nl.sara.webdav.codec.GetcontentlengthCodec.tagname="getcontentlength";nl.sara.webdav.codec.GetcontentlengthCodec.fromXML=function(b){var a=b.item(0);if((a.nodeType===3)||(a.nodeType===4)){return parseInt(a.nodeValue);}else{return null;}};nl.sara.webdav.codec.GetcontentlengthCodec.toXML=function(c,b){var a=b.createCDATASection(c.toString());b.documentElement.appendChild(a);return b;};nl.sara.webdav.Property.addCodec(nl.sara.webdav.codec.GetcontentlengthCodec);"use strict";if(nl.sara.webdav.codec.GetlastmodifiedCodec!==undefined){throw new nl.sara.webdav.Exception("Namespace nl.sara.webdav.codec.GetlastmodifiedCodec already taken, could not load JavaScript library for WebDAV connectivity.",nl.sara.webdav.Exception.NAMESPACE_TAKEN);}nl.sara.webdav.codec.GetlastmodifiedCodec=new nl.sara.webdav.Codec();nl.sara.webdav.codec.GetlastmodifiedCodec.namespace="DAV:";nl.sara.webdav.codec.GetlastmodifiedCodec.tagname="getlastmodified";nl.sara.webdav.codec.GetlastmodifiedCodec.fromXML=function(b){var a=b.item(0);if((a.nodeType===3)||(a.nodeType===4)){return new Date(a.nodeValue);}else{return null;}};nl.sara.webdav.codec.GetlastmodifiedCodec.toXML=function(c,b){function g(i){i=i.toString();while(i.length<2){i="0"+i;}return i;}var h=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];var f=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];var e=g(c.getUTCDate())+" "+f[c.getUTCMonth()]+" "+c.getUTCFullYear();var d=g(c.getUTCHours())+":"+g(c.getUTCMinutes())+":"+g(c.getUTCSeconds());var a=b.createCDATASection(h[c.getUTCDay()]+", "+e+" "+d+" GMT");b.documentElement.appendChild(a);return b;};nl.sara.webdav.Property.addCodec(nl.sara.webdav.codec.GetlastmodifiedCodec);"use strict";if(nl.sara.webdav.codec.OwnerCodec!==undefined){throw new nl.sara.webdav.Exception("Namespace nl.sara.webdav.codec.OwnerCodec already taken, could not load JavaScript library for WebDAV connectivity.",nl.sara.webdav.Exception.NAMESPACE_TAKEN);}nl.sara.webdav.codec.OwnerCodec=new nl.sara.webdav.Codec();nl.sara.webdav.codec.OwnerCodec.namespace="DAV:";nl.sara.webdav.codec.OwnerCodec.tagname="owner";nl.sara.webdav.codec.OwnerCodec.fromXML=function(d){var a=null;var c=d[0];if((c.nodeType===1)&&(c.namespaceURI==="DAV:")&&(c.localName==="href")){var b=c.childNodes.item(0);if((b.nodeType===3)||(b.nodeType===4)){a=b.nodeValue;}}return a;};nl.sara.webdav.codec.OwnerCodec.toXML=function(c,b){var a=b.createElementNS("DAV:","href");a.appendChild(b.createCDATASection(c.toString()));b.documentElement.appendChild(a);return b;};nl.sara.webdav.Property.addCodec(nl.sara.webdav.codec.OwnerCodec);"use strict";if(nl.sara.webdav.codec===undefined){nl.sara.webdav.codec={};}if(nl.sara.webdav.codec.ResourcetypeCodec!==undefined){throw new nl.sara.webdav.Exception("Namespace nl.sara.webdav.codec.ResourcetypeCodec already taken, could not load JavaScript library for WebDAV connectivity.",nl.sara.webdav.Exception.NAMESPACE_TAKEN);}nl.sara.webdav.codec.ResourcetypeCodec=new nl.sara.webdav.Codec();nl.sara.webdav.codec.ResourcetypeCodec.namespace="DAV:";nl.sara.webdav.codec.ResourcetypeCodec.tagname="resourcetype";nl.sara.webdav.codec.ResourcetypeCodec.COLLECTION=1;nl.sara.webdav.codec.ResourcetypeCodec.UNSPECIFIED=2;nl.sara.webdav.codec.ResourcetypeCodec.PRINCIPAL=4;nl.sara.webdav.codec.ResourcetypeCodec.fromXML=function(c){for(var a=0;a<c.length;a++){var b=c.item(a);if(b.namespaceURI==="DAV:"){switch(nl.sara.webdav.Ie.getLocalName(b)){case"collection":return nl.sara.webdav.codec.ResourcetypeCodec.COLLECTION;case"principal":return nl.sara.webdav.codec.ResourcetypeCodec.PRINCIPAL;}}}return nl.sara.webdav.codec.ResourcetypeCodec.UNSPECIFIED;};nl.sara.webdav.codec.ResourcetypeCodec.toXML=function(b,a){switch(b){case nl.sara.webdav.codec.ResourcetypeCodec.COLLECTION:var c=a.createElementNS("DAV:","collection");a.documentElement.appendChild(c);case nl.sara.webdav.codec.ResourcetypeCodec.PRINCIPAL:var c=a.createElementNS("DAV:","principal");a.documentElement.appendChild(c);break;}return a;};nl.sara.webdav.Property.addCodec(nl.sara.webdav.codec.ResourcetypeCodec);\ No newline at end of file