Changeset 7603


Ignore:
Timestamp:
2004-06-17T11:12:25+12:00 (20 years ago)
Author:
kjdon
Message:

removed the xml stuff - we don't use it at present and it is confusing. also while reading in the collect.cfg file, if we find a command we are not looking for, we read in all teh tokens for that command (using CommandTokeniser) so that multi line tokens are eaten up

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/collection/BasicCollectionConfiguration.java

    r7591 r7603  
    5050    implements Comparable {
    5151   
    52     private Element creator_element;
    53     private Element description_element;
    54     private Element maintainer_element;
    55     private Element name_element;
    5652    private File file;
    57     private String creator;
    58     private String description;
    59     private String maintainer;
    60     private String name;
    61    
    62     private String site; // used for gs3 colls
     53    private String creator = "";
     54    private String description = "";
     55    private String maintainer = "";
     56    private String name = "";
     57   
     58    private String site = null; // used for gs3 colls
    6359   
    6460    public BasicCollectionConfiguration(File file) {
     
    6965        return;
    7066        }
    71         if(filename.endsWith(".xml")) {
    72         // This is where G3 compliant code will one day live
    73         }
    74         else if(filename.endsWith(".cfg")) {
     67        if(filename.endsWith(".cfg")) {
    7568        FileInputStream fis = new FileInputStream(file);
    7669        InputStreamReader isr = new InputStreamReader(fis, "UTF-8");
     
    128121                value_str = null;
    129122                meta_type_str = null;
     123            } else {
     124                // we want to process all the tokens to make sure we get rid of multi line commands before trying to find the next one
     125                while (tokenizer.hasMoreTokens()) {
     126                    tokenizer.nextToken();
     127                }
     128
    130129            } // end of coll meta bit
    131130            command_type_str = null;
     
    170169     */
    171170    public String getCreator() {
    172     String result = StaticStrings.EMPTY_STR;
    173     if(creator_element != null) {
    174         result = MSMUtils.getValue(creator_element);
    175     }
    176     else if(creator != null) {
    177         result = creator;
    178     }
    179     return result;
     171    return creator;
    180172    }
    181173
    182174    public String getDescription() {
    183     String result = StaticStrings.EMPTY_STR;
    184     if(description_element != null) {
    185         result = MSMUtils.getValue(description_element);
    186     }
    187     else if(description != null) {
    188         result = description;
    189     }
    190     return result;
     175    return description;
    191176    }
    192177
     
    196181   
    197182    public String getMaintainer() {
    198     String result = StaticStrings.EMPTY_STR;
    199     if(maintainer_element != null) {
    200         result = MSMUtils.getValue(maintainer_element);
    201     }
    202     else if(maintainer != null) {
    203         result = maintainer;
    204     }
    205     return result;
     183    return maintainer;
    206184    }
    207185
    208186    public String getName() {
    209     String result = StaticStrings.EMPTY_STR;
    210     if(name_element != null) {
    211         result = MSMUtils.getValue(name_element);
    212     }
    213     else if(name != null) {
    214         result = name;
    215     }
    216     return result;
     187    return name;
    217188    }
    218189   
Note: See TracChangeset for help on using the changeset viewer.