commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Schalk Neethling <sch...@volume4.com>
Subject Re: [fileUpload] Question about file name
Date Sat, 11 Jun 2005 16:36:55 GMT
I will definitely try this out, thank you.

Dakota Jack wrote:

>Yup:
>
>Frank,
>
>If the File class does not normalize the string used to create the
>File, then there is a bug.  There seems to be a bug in one version of
>Linux and that has been reported to Sun.  The constructor for File is
>as follows:
>
>
>   public File(String pathname) {
>       if (pathname == null) {
>           throw new NullPointerException();
>       }
>       this.path = fs.normalize(pathname);
>       this.prefixLength = fs.prefixLength(this.path);
>   }
>
>Notice that an object fs is called to normalize the pathname.  The
>object fs is created as a static field in all File classes as follows:
>
>
>   static private FileSystem fs = FileSystem.getFileSystem();
>
>The FileSystem class is an abstract class that has to be implemented,
>of course, for the os on which it exists.  So, the basis for the class
>is a JNI method:
>
>   public static native FileSystem getFileSystem();
>
>Sun did not go to all this trouble without expecting the actual
>separators to be normalized to whatever system a file is created on,
>so that no matter what your path happens to be in creating a File
>object, file.getName() should return the name without a file
>separator.  Is this helpful?
>
>On 6/9/05, Mihael Knezevic <m.knezevic@porta.de> wrote:
>  
>
>>this whole discussion is old. it can be found in the archives. the
>>implementation of the jvm on linux FROM SUN is faulty on this one. cause when
>>use use a filename like /tmp/mydir/myfile.txt and make a file object of it on
>>a windows system and get the name you would get the name myfile.txt though
>>the file separator on windows is a backslash, thats ok. but on linux you
>>won't get the name from a windows path. i send a bug report to sun. there was
>>some misunderstanding and then Dakota Jack <dakota.jack (at) gmail.com> send
>>also a bug report to sun. perhaps it is in the bug list by now.
>>
>>and yes the ie sends the full path. call it a bug or a feature.
>>
>>just replacing the backslash with a slash won't solve every case but most
>>cases.
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>
>>
>>    
>>
>
>
>  
>

-- 
Kind Regards
Schalk Neethling
Web Developer.Designer.Programmer.President
Volume4.Business.Solution.Developers
emotionalize.conceptualize.visualize.realize
Landlines
Tel: +27125468436
Fax: +27125468436
Web
email:schalk@volume4.com
Global: www.volume4.com
Messenger
Yahoo!: v_olume4
AOL: v0lume4
MSN: volume4_@hotmail.com

We support OpenSource
Get Firefox!- The browser reloaded - http://www.mozilla.org/products/firefox/
 
This message contains information that is considered to be sensitive or confidential and may
not be forwarded or disclosed to any other party without the permission of the sender. If
you received this message in error, please notify me immediately so that I can correct and
delete the original email. Thank you.



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


Mime
View raw message