Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 125426 - FileObject.getPath() incompatible with NB 6.0 version
FileObject.getPath() incompatible with NB 6.0 version
Product: platform
Classification: Unclassified
Component: Filesystems
PC Windows XP
: P2 (vote)
: 6.x
Assigned To: rmatous
Depends on:
  Show dependency treegraph
Reported: 2008-01-16 19:58 UTC by _ gordonp
Modified: 2008-12-22 10:44 UTC (History)
0 users

See Also:
Issue Type: DEFECT


Note You need to log in before you can comment on or make changes to this bug.
Description _ gordonp 2008-01-16 19:58:44 UTC
In NB 6.0, the drive designator was returned as part of the path. In the current trunk, this is
no longer the case. This caused a serious regression in the gdb module (IZ 125319 - breakpoints
do not work on Windows).
Comment 1 rmatous 2008-01-16 21:57:35 UTC
Yes, was changed. Part of the changes from Jan 08 . See changes (especially One drive == one instance of filesystem on

The path is relative path to the filesystem root. Root represents drive now, so the path doesn't contain drive. I didn't
expect someone could rely on it especially if javadoc for this method was restrictive enough (like "Do not use this
method to find a file path on disk!"). 
Comment 2 rmatous 2008-01-18 19:24:48 UTC
The original (6.0) impl. for getPath looked like this:
<code>return (isRoot()) ? "" : getFile().getAbsolutePath().replace("\\", '/');</code>

#125319 seems to be already fixed like that:
path = FileUtil.toFile(fo).getAbsolutePath();
if (Utilities.isWindows()) {
   path = path.replace("\\", "/"); // NOI18N

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo