[JBoss-user] [HTTPD, Servlets & JSP] - Re: XML Parser cannot parse Files with spaces in their names

2004-08-05 Thread vc?!
Yes, even if i try 

File f = 
new File("C:\\jboss-3.2.4\\server\\default\\deploy\\cm.ear\\cm.war\\htm\\Rep\\Gland 
5.xml");
 boolean b = f.exists();
 System.out.println("EXISTS" + b);
 Document   oDocument = dBuilder.parse(f);

I still get a problem. In the above case b = true. But the Xerces parser I believe has 
a problem. 

2004-08-05 13:46:35,422 INFO  [STDOUT] EXISTStrue
2004-08-05 13:46:35,432 INFO  [STDOUT] java.io.FileNotFoundException: 
C:\jboss-3.2.4\server\default\deploy\cm.ear\cm.war\htm\Rep\Gland%205.xml
2004-08-05 13:46:35,432 INFO  [STDOUT]  at 
org.jboss.net.protocol.file.FileURLConnection.connect(FileURLConnection.java:71)
2004-08-05 13:46:35,432 INFO  [STDOUT]  at 
org.jboss.net.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:80)
2004-08-05 13:46:35,432 INFO  [STDOUT]  at 
org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
2004-08-05 13:46:35,432 INFO  [STDOUT]  at 
org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
2004-08-05 13:46:35,432 INFO  [STDOUT]  at 
org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
2004-08-05 13:46:35,432 INFO  [STDOUT]  at 
org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
2004-08-05 13:46:35,432 INFO  [STDOUT]  at 
org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
2004-08-05 13:46:35,442 INFO  [STDOUT]  at 
org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
2004-08-05 13:46:35,442 INFO  [STDOUT]  at 
org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
2004-08-05 13:46:35,442 INFO  [STDOUT]  at 
javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:161)


The problem goes away if i have a file without any spaces in it

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3844279#3844279

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3844279


---
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [HTTPD, Servlets & JSP] - XML Parser cannot parse Files with spaces in their names

2004-08-05 Thread vc?!
Here is my jsp code

<%@ page 
import="java.net.URLDecoder,org.w3c.dom.Document,java.io.*,javax.xml.parsers.DocumentBuilder,
 javax.xml.parsers.DocumentBuilderFactory" %>
<%

try {
  //create a factory instance
  DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();

 DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
 File f = new 
File(URLDecoder.decode("C:\\jboss-3.2.4\\server\\default\\deploy\\cm.ear\\cm.war\\html\\Rports\\Gland
 5.xml"));
 Document   oDocument = dBuilder.parse(f);
 }
 catch(Exception e) {
 e.printStackTrace();
 }

%>

The above code gives my FileNotFoundException. It does not like the space in the file 
name. If i rename my file and change the filename in the above code to Gland5.xml 
everything is fine. Same thing happens if I remove the decode call also. Can someone 
please help
Thanks

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3844258#3844258

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3844258


---
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [HTTPD, Servlets & JSP] - Re: Accessing files from Servlets or Classes

2004-07-13 Thread vc?!
The actual code which tries to load the properties file is:

   InputStream in = ClassLoader.getSystemResourceAsStream("dbpool.properties");
 Properties props = new Properties();
 props.load( new BufferedInputStream( in ) );
return props

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3841898#3841898

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3841898


---
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [HTTPD, Servlets & JSP] - Accessing files from Servlets or Classes

2004-07-13 Thread vc?!
I have the following code in one of my java files.

public class DBHelper {

static{
try {
Properties props = 
PropertyReader.getProps("\dbpool.properties");
conMgr = 
} catch(Exception e ) {
e.printStackTrace();
}
}
}

I get an exception saying that it could not locate the dbpool.properties file. I have 
placed this file in the myapp.war folder. So i think \dbpool.properties should get it. 

How do I access files like these from my utility classes like these. Note that this 
method most likely gets invoked from a jsp or servlet.

Thanks in advance



View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3841884#3841884

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3841884


---
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user