Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,9 @@
import java.net.HttpURLConnection;
import java.net.URL;

import net.imagej.plugins.uploaders.webdav.WebDAVUploader;
import net.imagej.updater.AbstractUploaderTestBase;

import org.junit.Test;

/**
* A conditional JUnit test for uploading via WebDAV.
*
Expand Down Expand Up @@ -92,5 +90,16 @@ public void delete(final String path) throws IOException {
throw new IOException("Could not delete " + url + ": " + code + " " + connection.getResponseMessage());
}
}

@Override
public boolean isDeleted(String path) throws IOException {
final URL target = new URL(url + path);
final boolean isDirectory = path.endsWith("/");
final HttpURLConnection connection = isDirectory ?
connect("GET", target, null) :
connect("GET", target, null, "Depth", "Infinity");
int code = connection.getResponseCode();
return code == 404;
}
}
}