Very true.  Though, we use logging profusely throughout our application
which, albeit, indirectly, writes stuff to the disk (most certainly using
File objects) - I guess we must be draconian.  :-)

-Adam
 
PS-

I just peeked at File.getName(), It does the same thing:

--- SNIP ---

    public String getName() {
        
      int index = path.lastIndexOf(separatorChar);
        if (index < prefixLength) return path.substring(prefixLength);
        return path.substring(index + 1);
    }

--- SNIP ---

-----Original Message-----
From: Monkeyden [mailto:[EMAIL PROTECTED] 
Sent: Monday, 31 July 2006 12:13
To: Struts Users Mailing List
Subject: Re: Question regarding getRequestURI()

One could say that operating on File objects, directly, infringes on the
concept of a "container", depending on how draconian you are.

On 7/31/06, Adam Gordon <[EMAIL PROTECTED]> wrote:
>
> The File object also gives it to you and you don't have to mess with
> substrings and the "/" character.  I believe it's File.getName() - it
> returns everything after the last "/" character.  Of course, you do have
> to
> construct a new File object so I've no idea if it's more or less efficient
> than what Monkeyden suggested.
>
> -Adam

Reply via email to