* Process the get request.
*/
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
// Create the ServiceDocumentRequest
ServiceDocumentRequest sdr = new ServiceDocumentRequest();
// Are there any authentication details?
String usernamePassword = getUsernamePassword(request);
if ((usernamePassword != null) && (!usernamePassword.equals(""))) {
int p = usernamePassword.indexOf(":");
if (p != -1) {
sdr.setUsername(usernamePassword.substring(0, p));
sdr.setPassword(usernamePassword.substring(p + 1));
}
} else if (authenticateWithBasic()) {
String s = "Basic realm=\"SWORD\"";
response.setHeader("WWW-Authenticate", s);
response.setStatus(401);
return;
}
// Set the x-on-behalf-of header
sdr.setOnBehalfOf(request.getHeader(HttpHeaders.X_ON_BEHALF_OF
.toString()));
// Set the IP address
sdr.setIPAddress(request.getRemoteAddr());
// Set the deposit location
sdr.setLocation(getUrl(request));
// Get the ServiceDocument
try {
ServiceDocument sd = myRepository.doServiceDocument(sdr);
if ((sd.getService().getMaxUploadSize() == -1) && (maxUploadSize != -1)) {