Changeset 3776 in main


Ignore:
Timestamp:
04/30/12 15:57:39 (10 years ago)
Author:
Garth Braithwaite
Message:

java - fixed a problem with mail error causing problem with SendAccess?.java, and FileStoredDocument?.java directory not exists causing null pointer for no indicator profile xmls. added newUser method to UserProfileXML which SendAccess? now uses.

Location:
trunk/src/main
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/main/java/org/ibisph/user/modelmap/SendAccess.java

    r3716 r3776  
    6868    modelMap.put(this.userProfileModelMapKey, userProfileDocument);
    6969    if(null == userProfileDocument) {
    70       userProfileDocument = XMLLib.newDocument(userProfileElement);
     70      userProfileDocument = this.userProfileService.newUser(id);
    7171      modelMap.put(this.userProfileModelMapKey, userProfileDocument);
    7272      logger.warn(".processModelMap - USER DOES NOT EXIST.  User's ID: {}, User's IP: {}", id, request.getRemoteAddr());
  • trunk/src/main/java/org/ibisph/user/service/UserProfileXML.java

    r3734 r3776  
    4848    String filename = getXMLPathAndFilename(userName);
    4949    Document document = this.xmlDocumentService.get(filename);
    50 //    if(document == null) {
    51 //      document = XMLLib.newDocument(this.userRootElementName);
    52 //      XMLLib.addElement(document, this.userRootElementName, XMLLib.newElement("NAME", userName));
    53 //    }
    5450    return(document);
    5551  } //-------------------------- End of Method ------------------------------
     
    6157  } //-------------------------- End of Method ------------------------------
    6258
     59  public Document newUser(String id) throws Exception {
     60    Document document = XMLLib.newDocument(this.userRootElementName);
     61    XMLLib.addElement(document, this.userRootElementName, XMLLib.newElement("ID", id));
     62    return(document);
     63  } //-------------------------- End of Method ------------------------------
    6364
    6465
  • trunk/src/main/java/org/ibisph/xml/service/FileStoredDocument.java

    r3758 r3776  
    190190    List<String> fileList = new ArrayList<String>();
    191191    File directory = new File(xmlPath);
    192     String[] xmlFiles = directory.list( new XMLFileNameFilter() );
    193     for(int i=0; i < xmlFiles.length; i++) {
    194       fileList.add(IOPath.concat(xmlPath, xmlFiles[i], "/"));
     192    if((null != directory) && directory.exists()) {
     193      String[] xmlFiles = directory.list( new XMLFileNameFilter() );
     194      for(int i=0; i < xmlFiles.length; i++) {
     195        fileList.add(IOPath.concat(xmlPath, xmlFiles[i], "/"));
     196      }
    195197    }
    196198    return(fileList);
Note: See TracChangeset for help on using the changeset viewer.