Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4034654
Votes 1
Synopsis File method to query case sensitivity
Category java:classes_io
Reported Against 1.1.1 , 1.1.6 , 1.2beta2 , 1.2beta3 , merlin-beta
Release Fixed
State 6-Fix Understood, request for enhancement
Priority: 4-Low
Related Bugs 4032488 , 4412820 , 5046336 , 4313887
Submit Date 26-FEB-1997
Description
In order to support reasonable file permissions in hotjava, it is useful
to know if the file system naming is case sensitive, as our comparisons 
must be consistant with that.  The Win NT file dialog aggravates this problem
(but certainly isn't the only issue) because it 'automatically' generates 
file and path names in 'mixed' case.
Work Around
I am working around this by looking at the separator character, (fortunately,
all OS's (that I know of) that use back slashes) are also case insensitive.
Evaluation
To support this properly requires an API change.  We should consider this for
the extended file support that is being planned for a future release.
--   xxxxx@xxxxx   3/6/1997
Comments
  
  Include a link with my name & email   

Submitted On 22-OCT-1997
eostrom
This bug, bug 4046914, and bug 4012377 are all
facets of the same problem:  There's no good way
to deal with case sensitivity in an appropriate
way across platforms.  A boolean that indicated
whether files were case sensitive on the current
file system seems necessary, but most applications
wouldn't need it if File.equals() worked correctly
and File.getCanonicalPath() used a consistent
case strategy on case-insensitive platforms.


Submitted On 12-APR-2008
msundman
"In progress" for over a decade. That's not "progress" by any stretch of the imagination.


Submitted On 13-APR-2008
alan.bateman
It would be great if developers requesting this method could post comments to explain how they may use this. I ask because knowing if a file system preserves case or if searching is case sensitive or not is usually not sufficient to implement comparators or predict the name of a file before it is created. For example, on NTFS the tables for matching of Unicode characters are created when the volume is formatted are not accessible to user applications.  Some file systems implement Unicode normalization. In summary, this isn't always simple and methods that test if a file system is case sensitive or not will normally not be sufficient.


Submitted On 06-JUL-2008
We have a Java application that makes backup by comparing two folders (source and target), deleting everything on target that's not on source, and copying everything from source to target that's newer on source, or not-existing on target. It works like a dream (for many years). However, when we copy a file "Test" when "test" already exists, we need to know if we need to delete "test" first. For NTFS/FAT/FAT32 we need to delete "test", whereas on other filing systems we must keep it. Therefore, a simple case-sensitivity check is sufficient. We assume the OS will do any necessary character translations.



PLEASE NOTE: JDK6 is formerly known as Project Mustang