Changeset 8143


Ignore:
Timestamp:
2004-09-23T16:08:51+12:00 (20 years ago)
Author:
mdewsnip
Message:

Fixed code for converting between Windows and Unix file paths.

File:
1 edited

Legend:

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

    r8142 r8143  
    168168            if (is_unix_path && Utility.isWindows()) {
    169169                // Convert path from Unix to Windows
    170                 gsdlsourcefilename_value = gsdlsourcefilename_value.replaceAll("/", File.separator);
    171             }
    172             if (!is_unix_path && !Utility.isWindows()) {
     170                gsdlsourcefilename_value = gsdlsourcefilename_value.replaceAll("\\/", "\\\\");
     171            }
     172            else if (!is_unix_path && !Utility.isWindows()) {
    173173                // Convert path from Windows to Unix
    174                 gsdlsourcefilename_value = gsdlsourcefilename_value.replaceAll("\\\\", File.separator);
     174                gsdlsourcefilename_value = gsdlsourcefilename_value.replaceAll("\\\\", "/");
    175175            }
    176176
    177177            // Remember this for quick access later
    178             if (gsdlsourcefilename_value != null) {
    179                 files_in_doc_xml_file.add(gsdlsourcefilename_value);
    180             }
     178            files_in_doc_xml_file.add(gsdlsourcefilename_value);
    181179            }
    182180            else {
Note: See TracChangeset for help on using the changeset viewer.