Bugs item #588314, was opened at 2002-07-30 00:13
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=588314&group_id=22866

Category: JBossServer
Group: v3.0 Rabbit Hole
Status: Open
Resolution: None
Priority: 5
Submitted By: Paul Austin (p_d_austin)
Assigned to: Nobody/Anonymous (nobody)
Summary: Space in Path in org.jboss.Main error

Initial Comment:
In the org.jboss.Main class boot method the server 
attempts to find the default jboss.home.dir value from 
the url the classes are loaded from. The problem is that 
the url has %20 characters in it to escape out spaces 
and the File class doesn't recognise these as escape 
characters. This causes the file class not to recognise 
the file as existing.

This could be overcome using the following code (not the 
most efficient way to do it but as it is only run once it's 
ok)

         String path = Main.class.getProtectionDomain
().getCodeSource().getLocation().getFile();
        StringBuffer filePath = new StringBuffer();
        StringTokenizer escapedSpaces = new 
StringTokenizer(path, "%20");
        while (escapedSpaces.hasMoreTokens()) {
            filePath.append(escapedSpaces.nextToken());
            if (escapedSpaces.hasMoreTokens()) {
                filePath.append(" ");
            }
        }
         File file = new File(filePath.toString()).getParentFile
().getParentFile();
         homeDir = file.getCanonicalPath();


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=588314&group_id=22866


-------------------------------------------------------
This sf.net email is sponsored by: Dice - The leading online job board
for high-tech professionals. Search and apply for tech jobs today!
http://seeker.dice.com/seeker.epl?rel_code=31
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to