Changeset 29752


Ignore:
Timestamp:
2015-02-19T16:37:12+13:00 (9 years ago)
Author:
ak19
Message:

Related to commits 29687, 29729, 29730. The changes to incorporating the new servlets.xml in web.xml requires additional processing for windows.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSEntityResolver.java

    r29730 r29752  
    1919package org.greenstone.gsdl3.util;
    2020
     21import org.greenstone.util.Misc;
    2122
    2223import org.xml.sax.InputSource;
     
    7172    // use the baseFilepath, if one was provided
    7273    if(this.baseFilepath != null) {
    73         return new InputSource("file://" + this.baseFilepath + File.separator + temp_id);
     74   
     75        // The file protocol for windows starts with file:/// and has URL slashes
     76        // http://en.wikipedia.org/wiki/File_URI_scheme#Windows
     77        String newpath = this.baseFilepath + File.separator + temp_id;     
     78        if(Misc.isWindows()) {         
     79            newpath = "file:///" + newpath.replace("\\", "/");
     80            System.err.println("### entity resolver for "+"file:///" + newpath);           
     81        } else { // linux version, file protocol starts with file:// and slashes are already URL-style
     82            newpath = "file://" + newpath;
     83        }
     84        return new InputSource(newpath);
    7485    }
    7586
Note: See TracChangeset for help on using the changeset viewer.