*/
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
try {
// Create the atom document request object
AtomDocumentRequest adr = new AtomDocumentRequest();
// Are there any authentication details?
String usernamePassword = getUsernamePassword(request);
if ((usernamePassword != null) && (!usernamePassword.equals(""))) {
int p = usernamePassword.indexOf(":");
if (p != -1) {
adr.setUsername(usernamePassword.substring(0, p));
adr.setPassword(usernamePassword.substring(p + 1));
}
} else if (authenticateWithBasic()) {
String s = "Basic realm=\"SWORD\"";
response.setHeader("WWW-Authenticate", s);
response.setStatus(401);
return;
}
// Set the IP address
adr.setIPAddress(request.getRemoteAddr());
// Set the deposit location
adr.setLocation(getUrl(request));
// Generate the response
AtomDocumentResponse dr = myRepository.doAtomDocument(adr);
// Print out the Deposit Response