Ignore:
Timestamp:
2003-06-16T10:03:49+12:00 (21 years ago)
Author:
jmt12
Message:

* empty log message *

Location:
trunk/gli/src/org/greenstone/gatherer/msm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/msm/MSMUtils.java

    r4564 r4673  
    712712    element.setAttribute("occurances", new_value.toString());
    713713    }
     714
     715    /** Set the #text node value of some element.
     716     * @param element the Element whose value we wish to set
     717     * @param value the new value for the element as a String
     718     */
     719    static final public void setValue(Element element, String value) {
     720    // Remove any existing child node(s)
     721    while(element.hasChildNodes()) {
     722        element.removeChild(element.getFirstChild());
     723    }
     724    // Add new text node.
     725    element.appendChild(element.getOwnerDocument().createTextNode(value));
     726    }
     727
    714728    /** This method also traverses the tree, but this one is used to gather all the values and aliases at once, and to 'prune' the tree if necessary.
    715729     * @param current The current root <strong>Node</strong> of this AssignedValues tree subtree.
  • trunk/gli/src/org/greenstone/gatherer/msm/MetadataSetManager.java

    r4661 r4673  
    915915    // And make back ups of all existing metadata set files.
    916916    File temp[] = file.listFiles();
    917     for(int i = temp.length - 1; i >= 0; i--) {
     917    for(int i = 0; temp != null && i < temp.length; i++) {
    918918        if(temp[i].getName().endsWith(".mds") || temp[i].getName().endsWith(".mdv")) {
    919919        File backup = new File(temp[i].getAbsolutePath() + "~");
Note: See TracChangeset for help on using the changeset viewer.