[jsword-devel] Resource

Keith Ralston jsword-devel@bibletechnologieswg.org
Mon, 12 Aug 2002 01:22:36 -0500


Which separator used is a function a several things depending on how you are
accessing the URL: protocol, implementation and OS.  All my file: URLs have
a Windows separators on Win2k Server.

I'm now using XP, and it seems to work OK for me. Is it failing for you?
If your environment is properly configured, it works.  Remove the versions
directory(ies) and you should see that it looks in some interesting places.
Additionally, each place that checks for a File.directory, needs to handle
postpended File.separators regardless of OS.


-----Original Message-----
From: owner-jsword-devel@crosswire.org
[mailto:owner-jsword-devel@crosswire.org]On Behalf Of Joe Walker
Sent: Sunday, August 11, 2002 10:34 PM
To: jsword-devel@bibletechnologieswg.org
Subject: RE: [jsword-devel] Resource



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.
>