[jsword-devel] Resource

Joe Walker jsword-devel@bibletechnologieswg.org
Mon, 12 Aug 2002 04:33:30 +0100


Hi,

I *think* it is right to use "/" because we're not necessarily talking about
something on the file system. Since base is a URL, it could exist on a
web-server (where / is correct). For most practically cases however the file
is on the file system where the URL library should convert to the correct
separator.
I'm now using XP, and it seems to work OK for me. Is it failing for you?

Joe.

> -----Original Message-----
> From: owner-jsword-devel@crosswire.org
> [mailto:owner-jsword-devel@crosswire.org]On Behalf Of Keith Ralston
> Sent: 11 August 2002 23:52
> To: jsword-devel@bibletechnologieswg.org
> Subject: RE: [jsword-devel] Resource
>
>
> In Resource:
>
> 426        //Not a directory
> 427        String file = base.getFile();
> 428        //If the URL end with a "/", truncate it.
> 429        if (file.endsWith("/"))
> 430            file = file.substring(0, file.length()-1);
> 431        int lastslash = file.lastIndexOf("/");
> 432        if (lastslash == -1)  // No "/" in the String
> 433            file = ".";
> 434        else
> 435            file = file.substring(0, lastslash);
>
> (I added the comments.)
>
> On line 433, the URL is set to "."  Is this to set the base to the current
> directory in Unix?  When I am running the application in Windows, the test
> for "/" fails.  This seems to be the main hang up for me.
>