8078427: More supportive home environment

Reviewed-by: dfuchs, lancea, skoivu
This commit is contained in:
Joe Wang 2015-05-26 10:37:23 -07:00
parent 9a0831a18e
commit a9f9be2377
4 changed files with 27 additions and 86 deletions

View file

@ -811,9 +811,7 @@ public class Catalog {
// tack on a basename because URLs point to files not dirs // tack on a basename because URLs point to files not dirs
catalogCwd = FileURL.makeURL("basename"); catalogCwd = FileURL.makeURL("basename");
} catch (MalformedURLException e) { } catch (MalformedURLException e) {
String userdir = SecuritySupport.getSystemProperty("user.dir"); catalogManager.debug.message(1, "Malformed URL on cwd", "user.dir");
userdir = userdir.replace('\\', '/');
catalogManager.debug.message(1, "Malformed URL on cwd", userdir);
catalogCwd = null; catalogCwd = null;
} }

View file

@ -1,13 +1,13 @@
/* /*
* reserved comment block * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT REMOVE OR ALTER!
*/ */
/* /*
* Copyright 1999-2005 The Apache Software Foundation. * Licensed to the Apache Software Foundation (ASF) under one or more
* * contributor license agreements. See the NOTICE file distributed with
* Licensed under the Apache License, Version 2.0 (the "License"); * this work for additional information regarding copyright ownership.
* you may not use this file except in compliance with the License. * The ASF licenses this file to You under the Apache License, Version 2.0
* You may obtain a copy of the License at * (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
@ -17,9 +17,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/*
* $Id: TreeWalker.java,v 1.1.4.1 2005/09/08 10:58:44 suresh_emailid Exp $
*/
package com.sun.org.apache.xml.internal.serializer; package com.sun.org.apache.xml.internal.serializer;
import com.sun.org.apache.xalan.internal.utils.SecuritySupport; import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
@ -94,33 +91,15 @@ public final class TreeWalker
m_contentHandler = contentHandler; m_contentHandler = contentHandler;
if (m_contentHandler instanceof SerializationHandler) { if (m_contentHandler instanceof SerializationHandler) {
m_Serializer = (SerializationHandler) m_contentHandler; m_Serializer = (SerializationHandler) m_contentHandler;
} } else {
else
m_Serializer = null; m_Serializer = null;
}
// Set the system ID, if it is given // Set the system ID, if it is given
m_contentHandler.setDocumentLocator(m_locator); m_contentHandler.setDocumentLocator(m_locator);
if (systemId != null) if (systemId != null) {
m_locator.setSystemId(systemId); m_locator.setSystemId(systemId);
else {
try {
// Bug see Bugzilla 26741
m_locator.setSystemId(SecuritySupport.getSystemProperty("user.dir") + File.separator + "dummy.xsl");
}
catch (SecurityException se) {// user.dir not accessible from applet
}
} }
// Set the document locator
if (m_contentHandler != null)
m_contentHandler.setDocumentLocator(m_locator);
try {
// Bug see Bugzilla 26741
m_locator.setSystemId(SecuritySupport.getSystemProperty("user.dir") + File.separator + "dummy.xsl");
}
catch (SecurityException se){// user.dir not accessible from applet
}
m_dh = new DOM2Helper(); m_dh = new DOM2Helper();
} }

View file

@ -17,9 +17,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/*
* $Id: $
*/
package com.sun.org.apache.xml.internal.serializer.dom3; package com.sun.org.apache.xml.internal.serializer.dom3;
@ -29,14 +26,11 @@ import com.sun.org.apache.xml.internal.serializer.OutputPropertiesFactory;
import com.sun.org.apache.xml.internal.serializer.SerializationHandler; import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
import com.sun.org.apache.xml.internal.serializer.utils.MsgKey; import com.sun.org.apache.xml.internal.serializer.utils.MsgKey;
import com.sun.org.apache.xml.internal.serializer.utils.Utils; import com.sun.org.apache.xml.internal.serializer.utils.Utils;
import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.io.Writer; import java.io.Writer;
import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.Enumeration; import java.util.Enumeration;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Properties; import java.util.Properties;
import org.w3c.dom.Attr; import org.w3c.dom.Attr;
@ -223,14 +217,6 @@ final class DOM3TreeWalker {
fDOMConfigProperties = fSerializer.getOutputFormat(); fDOMConfigProperties = fSerializer.getOutputFormat();
fSerializer.setDocumentLocator(fLocator); fSerializer.setDocumentLocator(fLocator);
initProperties(fDOMConfigProperties); initProperties(fDOMConfigProperties);
try {
// Bug see Bugzilla 26741
fLocator.setSystemId(
System.getProperty("user.dir") + File.separator + "dummy.xsl");
} catch (SecurityException se) { // user.dir not accessible from applet
}
} }
/** /**

View file

@ -1,13 +1,13 @@
/* /*
* reserved comment block * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT REMOVE OR ALTER!
*/ */
/* /*
* Copyright 1999-2004 The Apache Software Foundation. * Licensed to the Apache Software Foundation (ASF) under one or more
* * contributor license agreements. See the NOTICE file distributed with
* Licensed under the Apache License, Version 2.0 (the "License"); * this work for additional information regarding copyright ownership.
* you may not use this file except in compliance with the License. * The ASF licenses this file to You under the Apache License, Version 2.0
* You may obtain a copy of the License at * (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
@ -17,9 +17,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/*
* $Id: TreeWalker.java,v 1.2.4.1 2005/09/15 08:15:59 suresh_emailid Exp $
*/
package com.sun.org.apache.xml.internal.utils; package com.sun.org.apache.xml.internal.utils;
import com.sun.org.apache.xalan.internal.utils.SecuritySupport; import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
@ -81,7 +78,7 @@ public class TreeWalker
/** /**
* Constructor. * Constructor.
* @param contentHandler The implemention of the * @param contentHandler The implementation of the
* @param systemId System identifier for the document. * @param systemId System identifier for the document.
* contentHandler operation (toXMLString, digest, ...) * contentHandler operation (toXMLString, digest, ...)
*/ */
@ -89,53 +86,34 @@ public class TreeWalker
{ {
this.m_contentHandler = contentHandler; this.m_contentHandler = contentHandler;
m_contentHandler.setDocumentLocator(m_locator); m_contentHandler.setDocumentLocator(m_locator);
if (systemId != null) if (systemId != null) {
m_locator.setSystemId(systemId); m_locator.setSystemId(systemId);
else {
try {
// Bug see Bugzilla 26741
m_locator.setSystemId(SecuritySupport.getSystemProperty("user.dir") + File.separator + "dummy.xsl");
}
catch (SecurityException se) {// user.dir not accessible from applet
}
} }
m_dh = dh; m_dh = dh;
} }
/** /**
* Constructor. * Constructor.
* @param contentHandler The implemention of the * @param contentHandler The implementation of the
* contentHandler operation (toXMLString, digest, ...) * contentHandler operation (toXMLString, digest, ...)
*/ */
public TreeWalker(ContentHandler contentHandler, DOMHelper dh) public TreeWalker(ContentHandler contentHandler, DOMHelper dh)
{ {
this.m_contentHandler = contentHandler; this.m_contentHandler = contentHandler;
m_contentHandler.setDocumentLocator(m_locator); m_contentHandler.setDocumentLocator(m_locator);
try {
// Bug see Bugzilla 26741
m_locator.setSystemId(SecuritySupport.getSystemProperty("user.dir") + File.separator + "dummy.xsl");
}
catch (SecurityException se){// user.dir not accessible from applet
}
m_dh = dh; m_dh = dh;
} }
/** /**
* Constructor. * Constructor.
* @param contentHandler The implemention of the * @param contentHandler The implementation of the
* contentHandler operation (toXMLString, digest, ...) * contentHandler operation (toXMLString, digest, ...)
*/ */
public TreeWalker(ContentHandler contentHandler) public TreeWalker(ContentHandler contentHandler)
{ {
this.m_contentHandler = contentHandler; this.m_contentHandler = contentHandler;
if (m_contentHandler != null) if (m_contentHandler != null) {
m_contentHandler.setDocumentLocator(m_locator); m_contentHandler.setDocumentLocator(m_locator);
try {
// Bug see Bugzilla 26741
m_locator.setSystemId(SecuritySupport.getSystemProperty("user.dir") + File.separator + "dummy.xsl");
}
catch (SecurityException se){// user.dir not accessible from applet
} }
m_dh = new DOM2Helper(); m_dh = new DOM2Helper();
} }