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 270078 - FileUtil.findFreeFolder not working with directories that contain "." dots in name.
Summary: FileUtil.findFreeFolder not working with directories that contain "." dots in...
Status: NEW
Alias: None
Product: platform
Classification: Unclassified
Component: Filesystems (show other bugs)
Version: 8.2
Hardware: PC Windows 10 x64
: P3 normal (vote)
Assignee: Jaroslav Havlin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-15 17:47 UTC by sonnenhohl
Modified: 2017-03-15 17:47 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sonnenhohl 2017-03-15 17:47:26 UTC
The function FileUtil.findFreeFolder is used to find a folder available in the dir with a specific name, but if the folder exist it adds _1, _2 and so on. 

Debugging the Netbeans source code i found out that this function uses another function named FileUtil.checkFreeName the problem is on that function, in the code the FileObjects are using the function getName() and getExt(), and comparing getName() with the name passed  by parameter, the exception occurs because the name passed by parameter contains dots like:

Folder name: "Software Project version v1.21.a12"

This problem is very easy to reproduce just create a folder with the name above and use the function findFreeFolder, but the problem actually is in the function used by this one wich is checkFreeName.