Examples of AtomDocumentRequest


Examples of org.purl.sword.base.AtomDocumentRequest

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

Examples of org.purl.sword.base.AtomDocumentRequest

   */
  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
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.