Package org.purl.sword.base

Examples of org.purl.sword.base.ServiceDocumentRequest


   * 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)) {
View Full Code Here


   * 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)) {
View Full Code Here

TOP

Related Classes of org.purl.sword.base.ServiceDocumentRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.