Hi EveryBody I am reading a file which consist of space in its name. The location of the file is C:/Documents and Settings/venkatesh/XMLtest/ListPageDisplayPropertiesMapping.xml
The exception that i am getting is attached at the end of this message for reference. Simplest thing that can be done is i can change the directory name so that there are no spaces. However this file path is take dynamically. That is this application can run on both unix and windows. Hence the application when compiled, the executables are placed at user's home directory.
Is there a way by which i can encode the file path such that whitespaces are taken care.
Thanks for the help
[2004-11-05 13:06:31 ] <main> com.webobjects.foundation.NSForwardException for java.net.MalformedURLException: unknown protocol: c at java.net.URL.<init>(URL.java:586) at java.net.URL.<init>(URL.java:476) at java.net.URL.<init>(URL.java:425) at org.apache.xerces.impl.XMLEntityManager.startEntity(XMLEntityManager.java:807) at org.apache.xerces.impl.XMLEntityManager.startDocumentEntity(XMLEntityManager.java:753) at org.apache.xerces.impl.XMLDocumentScannerImpl.setInputSource(XMLDocumentScannerImpl.java:260) at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:499) at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:581) at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152) at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1114) at com.webobjects.appserver.xml._private._MappingModel.mappingModelWithXMLFile(_MappingModel.java:405) at com.webobjects.appserver.xml._private._WOXMLMappingDecoder.<init>(_WOXMLMappingDecoder.java:121)
The URL classes (why aren't you just opening the file directly with "new File(name)"?) might attempt to detect a filename when there's no protocol specified (the "file://"), and if so perhaps spaces make it think it's not a file.
If you really need to know, open up the code in java.net.URL and friends and find out.