Project

General

Profile

« Previous | Next » 

Revision 2992

Added by berkley about 18 years ago

fixed bugs in teh client that were preventing the lsid service from working right

View differences:

MetacatClient.java
673 673
         String response = null;
674 674
         try {
675 675
             response = sendDataForString(prop, null, null, 0);
676
             //parseRevisionResponse will return null if there is an 
677
             //error that it can't handle
676 678
             String revStr = parserRevisionResponse(response);
677 679
             Integer revObj = new Integer(revStr);
678 680
             rev = revObj.intValue();
679 681
             // Check for an error condition
680
             if (response.indexOf("<error>") != -1) {
682
             if (response.indexOf("<error>") != -1 && revStr == null) {
681 683
                 throw new MetacatException(response);
682 684
             }
683 685
         } catch (Exception e) {
......
852 854
      String revision = null;
853 855
      if (response != null)
854 856
      {
855
        int firstSemiCol = response.indexOf(";");
856
        revision = response.substring(0, firstSemiCol);
857
      }
857
        if(response.indexOf("<error>") != -1)
858
        {
859
          if(response.indexOf("There is not record") != -1)
860
          {
861
            return "0";
862
          }
863
          else
864
          {
865
            return null;
866
          }
867
        }
868
        else
869
        {
870
          int firstSemiCol = response.indexOf(";");
871
          revision = response.substring(0, firstSemiCol);
872
        }
873
      } 
858 874
      return revision;
859 875
    }
860 876
}

Also available in: Unified diff