// Set the deposit location
sdr.setLocation(getUrl(request));
// Get the ServiceDocument
try {
ServiceDocument sd = myRepository.doServiceDocument(sdr);
if ((sd.getService().getMaxUploadSize() == -1) && (maxUploadSize != -1)) {
sd.getService().setMaxUploadSize(maxUploadSize);
}
// Print out the Service Document
response.setContentType("application/atomsvc+xml; charset=UTF-8");
PrintWriter out = response.getWriter();
out.write(sd.marshall());
out.flush();
} catch (SWORDAuthenticationException sae) {
if (authN.equals("Basic")) {
String s = "Basic realm=\"SWORD\"";
response.setHeader("WWW-Authenticate", s);