Author: dsakovich
Date: 2008-10-23 11:25:16 -0400 (Thu, 23 Oct 2008)
New Revision: 11111
Modified:
branches/jbosstools-3.0.0.Beta1/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/Constants.java
branches/jbosstools-3.0.0.Beta1/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/DocTypeUtil.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2894
Modified:
branches/jbosstools-3.0.0.Beta1/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/Constants.java
===================================================================
---
branches/jbosstools-3.0.0.Beta1/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/Constants.java 2008-10-23
13:54:44 UTC (rev 11110)
+++
branches/jbosstools-3.0.0.Beta1/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/Constants.java 2008-10-23
15:25:16 UTC (rev 11111)
@@ -24,4 +24,5 @@
public static final String PIXEL = "px"; //$NON-NLS-1$
public static final String PERCENT = "%"; //$NON-NLS-1$
public static final String COMMA = ","; //$NON-NLS-1$
+ public static final String FILE_PREFIX = "file://"; //$NON-NLS-1$
}
Modified:
branches/jbosstools-3.0.0.Beta1/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/DocTypeUtil.java
===================================================================
---
branches/jbosstools-3.0.0.Beta1/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/DocTypeUtil.java 2008-10-23
13:54:44 UTC (rev 11110)
+++
branches/jbosstools-3.0.0.Beta1/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/DocTypeUtil.java 2008-10-23
15:25:16 UTC (rev 11111)
@@ -12,6 +12,8 @@
package org.jboss.tools.vpe.editor.util;
import java.io.File;
+import java.net.URI;
+import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;
@@ -336,13 +338,18 @@
Attr attr = element.getAttributeNode(attributeName);
- File file = new File(attr.getValue());
- if (!file.exists()) {
- // corrected path
- attr.setValue(initFile.getParent()
- + File.separator + attr.getValue());
+ try {
+ URI uri = new URI(attr.getValue());
+ if (!uri.isAbsolute()) {
+ // corrected path
+ attr.setValue(Constants.FILE_PREFIX + initFile.getParent()
+ + File.separator + attr.getValue());
+ }
+ } catch (URISyntaxException e) {
+ VpePlugin.getPluginLog().logError(e.getMessage());
}
+
}
}