Revision 4665
Added by daigle about 16 years ago
src/edu/ucsb/nceas/metacat/service/XMLSchema.java | ||
---|---|---|
29 | 29 |
import org.apache.log4j.Logger; |
30 | 30 |
|
31 | 31 |
import edu.ucsb.nceas.metacat.util.SystemUtil; |
32 |
import edu.ucsb.nceas.utilities.FileUtil; |
|
32 | 33 |
import edu.ucsb.nceas.utilities.PropertyNotFoundException; |
33 | 34 |
|
34 | 35 |
public class XMLSchema { |
... | ... | |
94 | 95 |
} |
95 | 96 |
|
96 | 97 |
this.fileName = fileName; |
97 |
try { |
|
98 |
try {
|
|
98 | 99 |
this.localFileUri = SystemUtil.getContextURL() + XMLSchemaService.SCHEMA_DIR |
99 | 100 |
+ fileName; |
101 |
logMetacat.debug("localFileUri: " + this.localFileUri); |
|
100 | 102 |
} catch (PropertyNotFoundException pnfe) { |
101 | 103 |
localFileUri = XMLSchemaService.SCHEMA_DIR + fileName; |
102 | 104 |
logMetacat.warn("Could not get context url. Setting localFileUri to: " |
103 | 105 |
+ localFileUri); |
104 | 106 |
} |
105 | 107 |
try { |
106 |
this.localFileDir = SystemUtil.getContextDir() + XMLSchemaService.SCHEMA_DIR |
|
107 |
+ fileName; |
|
108 |
String fileDir = SystemUtil.getContextDir() + XMLSchemaService.SCHEMA_DIR |
|
109 |
+ fileName; |
|
110 |
this.localFileDir = FileUtil.normalizePath(fileDir); |
|
111 |
logMetacat.debug("localFileDir: " + this.localFileDir); |
|
108 | 112 |
} catch (PropertyNotFoundException pnfe) { |
109 | 113 |
localFileDir = XMLSchemaService.SCHEMA_DIR + fileName; |
110 | 114 |
logMetacat.warn("Could not get context directory. Setting localFileDir to: " |
Also available in: Unified diff
Correct the pathing for the schema directories based on OS. Leave them in the database with linux style paths (forward slashes) since the values are also used to create urls.