commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Cooper <mfncoo...@gmail.com>
Subject Re: [io] Exact meaning of getPath, esp. on UNIX?
Date Sun, 28 Nov 2004 17:31:22 GMT
On Sun, 28 Nov 2004 08:04:12 -0800, Dakota Jack <dakota.jack@gmail.com> wrote:
> I hope you don't mind someone chiming in at what is probably "this
> late date" but I feel compelled to ask why we would want a
> FilenameUtils separate from a FileUtils?  The reason I am compelled at
> this time is the statement below that "these [file]name manipulations
> have to be independed of File objects I reckon".  Does that strike
> anyone else as really "off"?  How could filename manipulations be
> independent of File objects?  If File is not important, why not just
> NameUtils?  Maybe there is something I am not getting here?

IMO, Stephen is right. Suppose a Windows user is uploading a file to a
server that's running on Linux, and the browser being used sends the
full path name to the server. I would like to be able to manipulate
that Windows path on a Linux system, without having to create a File
instance, and without having to trust that the Linux implementation of
File handles Windows paths correctly (which, in some cases, I have
seen evidence that it does not).

--
Martin Cooper


> Jack
> 
> On Sun, 28 Nov 2004 14:22:02 -0000, Stephen Colebourne
> 
> 
> <scolebourne@btopenworld.com> wrote:
> > I think its best to change it. After all calling getPath() returns a path,
> > but calling getPath() on that result doesn't return the same path, but the
> > parent.
> >
> > If I add a getParent() method, that can cover the existing case of this
> > method.
> >
> > And these name manipulations have to be independent of File objects I
> > reckon.
> >
> > Stephen
> >
> >
> >
> > ----- Original Message -----
> > From: "matthew.hawthorne" <matth@apache.org>
> > To: "Jakarta Commons Developers List" <commons-dev@jakarta.apache.org>
> > Sent: Saturday, November 27, 2004 7:07 PM
> > Subject: Re: [io] Exact meaning of getPath, esp. on UNIX?
> >
> > > Stephen Colebourne wrote:
> > > > getPath is currently coded so that:
> > > >   "/a/b/c.txt"  --> "/a/b"
> > > > this is of course correct.
> > > >
> > > > However, it is also coded to do:
> > > >   "/a/b/c"  --> "/a/b"
> > > > which seems a little odd (for me with a windows background). ie. the
> > method
> > > > treats 'c' as a file not a folder.
> > >
> > > This method seems to behave the same as the 'dirname' command in Unix.
> > > It returns the directory containing the item, whether the item is a file
> > > or a folder.
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> >
> >
> 
> 
> --
> 
> "You can't wake a person who is pretending to be asleep."
> 
> ~Native Proverb~
> 
> "Each man is good in His sight. It is not necessary for eagles to be crows."
> 
> ~Hunkesni (Sitting Bull), Hunkpapa Sioux~
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message