Changeset 21864


Ignore:
Timestamp:
2010-04-09T13:48:44+12:00 (11 years ago)
Author:
ak19
Message:

Related fix to yesterday's. Deals with possible decimal point in classifier IDs.

Location:
other-projects/gs3-webservices-java-client/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • other-projects/gs3-webservices-java-client/trunk/src/GS3Fedora/org/greenstone/fedora/services/FedoraGS3Connection.java

    r21863 r21864  
    17411741        int decimal = classifier.indexOf('.'); // look for decimal point
    17421742        if(decimal != -1) {
    1743             classifier.substring(0, decimal);
     1743            classifier = classifier.substring(0, decimal);
    17441744        }
    17451745        int classifierNum = Integer.parseInt(classifier);
     
    18191819       
    18201820        // create <classifierNode><metadataList><metadata>s
    1821         // </metadataList></classifierNode> for all letters of alphabet
     1821        // </metadataList></classifierNode> for all letters of the alphabet
    18221822        for(int i = 0; i < classNodeIDs.length; i++) {
    18231823            // strip ID of everything before the first '.' (i.e. remove "CL#.")
    18241824            int index = classNodeIDs[i].indexOf('.');
    18251825            String subClassifierNumber = classNodeIDs[i].substring(index+1);
     1826            index = subClassifierNumber.indexOf('.'); // find next decimal point, if any
     1827            if(index != -1) {
     1828                subClassifierNumber = subClassifierNumber.substring(0, index);
     1829            }
    18261830            int subClassifierNum = Integer.parseInt(subClassifierNumber);
    18271831            String classifierName = "";
Note: See TracChangeset for help on using the changeset viewer.