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 48726

Summary: "IAE: URL must be a folder URL" when adding a nonexistent dir to Java Platform Manager
Product: java Reporter: Jesse Glick <jglick>
Component: PlatformAssignee: Tomas Zezula <tzezula>
Severity: blocker    
Priority: P3    
Version: 4.x   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 41535    

Description Jesse Glick 2004-09-08 20:41:57 UTC
040908 custom. Open platform manager. For default
platform, click Sources, then Add Folder/JAR. Type
in some nonexistent dir name, e.g. by just using
the file chooser wrong (e.g. double-clicking a
folder rather than single-clicking before
selecting Add). Exception is thrown.

1. Someone forgot to add '/' to the folder URL.

2. Probably the file chooser dialog should not let
you select the Add button to begin with unless you
have entered a valid, existing JAR or folder.
Check whether file.isDirectory() || (file.isFile()
&& FileUtil.isArchiveFile(file.toURI().toURL())).
Otherwise disable the Add button.
Comment 1 Tomas Zezula 2004-09-09 14:39:35 UTC
The  2nd point is not too easy. To be correct there is no nice way how
to force JFileChooser to do this. Ugly ways are
Container.getComponents () ore use the JFileChooser as Component and
create dialog with custom buttons. This causes problems with button

Comment 2 Tomas Zezula 2004-09-09 15:35:34 UTC
I've talked about the JFileChooser with Radek, and he already solved
this. He does the following:
If the file does not exist and 2 last name components are the same he
removes the last one from file name.
Should I do the same?
Comment 3 Tomas Zezula 2004-09-09 17:32:20 UTC
Checking in
new revision: 1.17; previous revision: 1.16
Checking in
new revision: 1.5; previous revision: 1.4
Processing log script arguments...
More commits to come...
Checking in
new revision: 1.16; previous revision: 1.15
Comment 4 Jesse Glick 2004-09-09 18:54:34 UTC
Close enough I guess.