1
0
mirror of https://github.com/etesync/android synced 2024-12-01 12:28:37 +00:00

fixes issue #11

This commit is contained in:
rfc2822 2013-10-16 00:09:29 +02:00
parent 6ee010905e
commit db1f2666e8

View File

@ -13,6 +13,7 @@ import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.StringWriter; import java.io.StringWriter;
import java.net.URI; import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
@ -169,7 +170,7 @@ public class WebDavCollection extends WebDavResource {
WebDavResource referenced = null; WebDavResource referenced = null;
if (location.equals(location.resolve(href))) { if (sameURL(location, location.resolve(href))) {
// response is about this property // response is about this property
referenced = this; referenced = this;
@ -226,4 +227,15 @@ public class WebDavCollection extends WebDavResource {
} }
this.members = members; this.members = members;
} }
private boolean sameURL(URI a, URI b) {
try {
a = new URI(a.getScheme(), null, a.getHost(), a.getPort(), a.getPath(), a.getQuery(), a.getFragment());
b = new URI(b.getScheme(), null, b.getHost(), b.getPort(), b.getPath(), b.getQuery(), b.getFragment());
return a.equals(b);
} catch (URISyntaxException e) {
return false;
}
}
} }