This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 41547

Summary: normalize all created java.io.File
Product: obsolete Reporter: David Konecny <dkonecny>
Component: vcscoreAssignee: Martin Entlicher <mentlicher>
Status: RESOLVED FIXED    
Severity: blocker    
Priority: P1    
Version: 4.x   
Hardware: All   
OS: All   
Issue Type: TASK Exception Reporter:
Bug Depends on:    
Bug Blocks: 41448    

Description David Konecny 2004-03-31 15:06:46 UTC
Please check your code and whenever you are
creating instance of java.io.File from a String
entered by user or from some other external source
you have to normalize it, i.e. call
FileUtil.normalizeFile() method. Otherwise lot of
nasty problems will appear. 

For example I know that creating new VCS profile I
can enter whatever path to CVSROOT field and it is
used as is. The java.io.File created from this
path must be normalized! Otherwise conversions to
URL/FileObject and vice versa can randomely fail,
finding File.getPath on MasterFS might fail
because case does not match (Windows are case
insensitive,  but our Filesystem API *is* case
sensitive), user can (theoreticaly) enter old
Windows 8.3 filenames (C:\PROGRA~1\....) which
again in some cases might work, but in most not.
It is hard to track these problems becasuse at
first glance everything seems to be OK. The
normalizeFile() method will take care about
normalizing filename.

Thanx. I wanted to do that myself, but was not
able to find the right place for the conversion in
your source code.
Comment 1 Martin Entlicher 2004-03-31 15:16:47 UTC
O.K., I'll look at it...
Comment 2 Martin Entlicher 2004-04-16 12:55:41 UTC
Fixed in vcscore and vcsgeneric modules:

/cvs/vcscore/src/org/netbeans/modules/vcscore/VcsFileSystem.java,v 
<--  VcsFileSystem.java
new revision: 1.256; previous revision: 1.255

/cvs/vcscore/src/org/netbeans/modules/vcscore/registry/VcsFSProvider.java,v
 <--  VcsFSProvider.java
new revision: 1.4; previous revision: 1.3

/cvs/vcsgeneric/src/org/netbeans/modules/vcs/advanced/recognizer/CommandLineFSRecognizer.java,v
 <--  CommandLineFSRecognizer.java
new revision: 1.7; previous revision: 1.6

/cvs/vcsgeneric/src/org/netbeans/modules/vcs/advanced/CommandLineVcsFileSystem.java,v
 <--  CommandLineVcsFileSystem.java
new revision: 1.141; previous revision: 1.140