Author: dsakovich
Date: 2008-10-20 09:11:52 -0400 (Mon, 20 Oct 2008)
New Revision: 10984
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/DocTypeUtil.java
Log:
Code adjustment
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/DocTypeUtil.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/DocTypeUtil.java 2008-10-20
13:06:59 UTC (rev 10983)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/DocTypeUtil.java 2008-10-20
13:11:52 UTC (rev 10984)
@@ -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(Constants.FILE_PREFIX + 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());
}
+
}
}
Show replies by date