URI=Class.refactor(URI,{combine:function(f,e){if(!e||f.scheme!=e.scheme||f.host!=e.host||f.port!=e.port){return this.previous.apply(this,arguments)}var a=f.file+(f.query?"?"+f.query:"")+(f.fragment?"#"+f.fragment:"");if(!e.directory){return(f.directory||(f.file?"":"./"))+a}var d=e.directory.split("/"),c=f.directory.split("/"),g="",h;var b=0;for(h=0;h<d.length&&h<c.length&&d[h]==c[h];h++){}for(b=0;b<d.length-h-1;b++){g+="../"}for(b=h;b<c.length-1;b++){g+=c[b]+"/"}return(g||(f.file?"":"./"))+a},toAbsolute:function(a){a=new URI(a);if(a){a.set("directory","").set("file","")}return this.toRelative(a)},toRelative:function(a){return this.get("value",new URI(a))}});