Changeset 10480


Ignore:
Timestamp:
2005-08-11T11:29:25+12:00 (19 years ago)
Author:
mdewsnip
Message:

Minor efficiency improvements.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/metadata/MetadataXMLFileManager.java

    r10479 r10480  
    7676        boolean applicable_metadata_xml_file_found = false;
    7777        File current_file_directory = (current_file.isDirectory() ? current_file : current_file.getParentFile());
     78        String current_file_directory_path = current_file_directory.getAbsolutePath();
    7879        for (int j = 0; j < metadata_xml_files.size(); j++) {
    7980        MetadataXMLFile metadata_xml_file = (MetadataXMLFile) metadata_xml_files.get(j);
    8081
    8182        // This metadata.xml file is only applicable if it is at the same level as the file
    82         if (current_file_directory.getAbsolutePath().equals(metadata_xml_file.getParentFile().getAbsolutePath())) {
     83        if (current_file_directory_path.equals(metadata_xml_file.getParentFile().getAbsolutePath())) {
    8384            applicable_metadata_xml_file_found = true;
    8485            metadata_xml_file.addMetadata(current_file, metadata_values);
     
    299300        // Find which metadata.xml file needs editing
    300301        File current_file_directory = (current_file.isDirectory() ? current_file : current_file.getParentFile());
     302        String current_file_directory_path = current_file_directory.getAbsolutePath();
    301303        for (int j = 0; j < metadata_xml_files.size(); j++) {
    302304        MetadataXMLFile metadata_xml_file = (MetadataXMLFile) metadata_xml_files.get(j);
    303305
    304306        // This metadata.xml file is only potentially applicable if it is above or at the same level as the file
    305         if (current_file_directory.getAbsolutePath().startsWith(metadata_xml_file.getParentFile().getAbsolutePath())) {
     307        if (current_file_directory_path.startsWith(metadata_xml_file.getParentFile().getAbsolutePath())) {
    306308            metadata_xml_file.removeMetadata(current_file, metadata_values);
    307309            if (!modified_metadata_xml_files.contains(metadata_xml_file)) {
     
    335337        // Find which metadata.xml file needs editing
    336338        File current_file_directory = (current_file.isDirectory() ? current_file : current_file.getParentFile());
     339        String current_file_directory_path = current_file_directory.getAbsolutePath();
    337340        for (int j = 0; j < metadata_xml_files.size(); j++) {
    338341        MetadataXMLFile metadata_xml_file = (MetadataXMLFile) metadata_xml_files.get(j);
    339342
    340343        // This metadata.xml file is only applicable if it is at the same level as the file
    341         if (current_file_directory.getAbsolutePath().equals(metadata_xml_file.getParentFile().getAbsolutePath())) {
     344        if (current_file_directory_path.equals(metadata_xml_file.getParentFile().getAbsolutePath())) {
    342345            metadata_xml_file.replaceMetadata(current_file, old_metadata_value, new_metadata_value);
    343346            if (!modified_metadata_xml_files.contains(metadata_xml_file)) {
Note: See TracChangeset for help on using the changeset viewer.