You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by dl...@apache.org on 2001/10/11 17:01:35 UTC
cvs commit: xml-xalan/java/src/org/apache/xml/utils TreeWalker.java
dleslie 01/10/11 08:01:35
Modified: java/src/org/apache/xml/utils TreeWalker.java
Log:
In response to Jess Holle <je...@ptc.com>. put try/catch
blocks around System.getProperty("user.dir") calls. If
SecurityException occurs (from applet sandbox), supply an
empty string ("").
Revision Changes Path
1.14 +22 -6 xml-xalan/java/src/org/apache/xml/utils/TreeWalker.java
Index: TreeWalker.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xml/utils/TreeWalker.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- TreeWalker.java 2001/06/15 17:54:16 1.13
+++ TreeWalker.java 2001/10/11 15:01:35 1.14
@@ -117,9 +117,15 @@
this.m_contentHandler = contentHandler;
m_contentHandler.setDocumentLocator(m_locator);
if (systemId != null)
- m_locator.setSystemId(systemId);
- else
- m_locator.setSystemId(System.getProperty("user.dir"));
+ m_locator.setSystemId(systemId);
+ else {
+ try {
+ m_locator.setSystemId(System.getProperty("user.dir"));
+ }
+ catch (SecurityException se) {// user.dir not accessible from applet
+ m_locator.setSystemId("");
+ }
+ }
m_dh = dh;
}
@@ -131,8 +137,13 @@
public TreeWalker(ContentHandler contentHandler, DOMHelper dh)
{
this.m_contentHandler = contentHandler;
- m_contentHandler.setDocumentLocator(m_locator);
- m_locator.setSystemId(System.getProperty("user.dir"));
+ m_contentHandler.setDocumentLocator(m_locator);
+ try {
+ m_locator.setSystemId(System.getProperty("user.dir"));
+ }
+ catch (SecurityException se){// user.dir not accessible from applet
+ m_locator.setSystemId("");
+ }
m_dh = dh;
}
@@ -146,7 +157,12 @@
this.m_contentHandler = contentHandler;
if (m_contentHandler != null)
m_contentHandler.setDocumentLocator(m_locator);
- m_locator.setSystemId(System.getProperty("user.dir"));
+ try {
+ m_locator.setSystemId(System.getProperty("user.dir"));
+ }
+ catch (SecurityException se){// user.dir not accessible from applet
+ m_locator.setSystemId("");
+ }
m_dh = new org.apache.xpath.DOM2Helper();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org