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 253154 - New Folder/Empty file panel: appending path to FileUtil.getFileDisplayName() is incorrect
Summary: New Folder/Empty file panel: appending path to FileUtil.getFileDisplayName() ...
Status: RESOLVED INCOMPLETE
Alias: None
Product: projects
Classification: Unclassified
Component: Generic Projects UI (show other bugs)
Version: 8.2
Hardware: All All
: P3 normal (vote)
Assignee: Tomas Stupka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-24 11:33 UTC by Vladimir Kvashin
Modified: 2016-07-04 13:05 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
The proposed fix (4.62 KB, patch)
2015-06-24 12:49 UTC, Vladimir Kvashin
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Kvashin 2015-06-24 11:33:46 UTC
In SimpleTargetChooserPanelGUI, field "Created File" (or "Created Folder") is filled via appending file relative path to what is returned by FileUtil.getFileDisplayName().

If the file system is not file-based, FileUtil.getFileDisplayName() returns string like "/home/user/folder in user@host".
And it's FileUtil.getFileDisplayName() who formats it this way 
("{0} in {1}").

So if I want to create a file "my_file" in folder "my_folder", this field shows "/home/user/folder in user@host/my_folder/my_file" -
which is definitely incorrect
Comment 1 Vladimir Kvashin 2015-06-24 12:04:26 UTC
For remote file system, I would propose the following notation:

user@host:/home/user/folder/my_folder/my_file
or 
user@host:22:/home/user/folder/my_folder/my_file

Such notation is used in standard Unix utilities like scp.

The question is whether to fix it just in SimpleTargetChooserPanelGUI
or to introduce a new method in FileUtil like

public static String getFileDisplayName(FileObject baseFo, String relativePath)
Comment 2 Vladimir Kvashin 2015-06-24 12:29:01 UTC
Another reasonable approach would be to keep "${path} in ${filesystem}" format, but just to append the relative path to the base file object path. I'll provide a fix that does this shortly.
Comment 3 Vladimir Kvashin 2015-06-24 12:49:21 UTC
Created attachment 154376 [details]
The proposed fix
Comment 4 Vladimir Kvashin 2015-06-24 12:50:53 UTC
The fix I attached needs the fix to the issue 248653 to be applied first (since it changes the same file and, moreover, uses field introduced in the previous patch)
Comment 5 Vladimir Kvashin 2015-06-29 11:42:17 UTC
The issue 248653 this one depends on is fixed now.
Could you please have a look at the proposed fix?
If you agree, I'll integrate it.
Comment 6 Tomas Stupka 2015-07-22 12:49:02 UTC
thanks, feel free to integrate
Comment 7 Tomas Stupka 2016-07-04 13:05:36 UTC
was this fixed?
has it to be fixed?