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 - "IAE: URL must be a folder URL" when adding a nonexistent dir to Java Platform Manager
Summary: "IAE: URL must be a folder URL" when adding a nonexistent dir to Java Platfor...
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Platform (show other bugs)
Version: 4.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks: 41535
  Show dependency tree
 
Reported: 2004-09-08 20:41 UTC by Jesse Glick
Modified: 2004-09-09 18:54 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 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
placement.

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
j2seplatform/src/org/netbeans/modules/java/j2seplatform/libraries/J2SEVolumeCustomizer.java;
/cvs/java/j2seplatform/src/org/netbeans/modules/java/j2seplatform/libraries/J2SEVolumeCustomizer.java,v
 <--  J2SEVolumeCustomizer.java
new revision: 1.17; previous revision: 1.16
done
Checking in
j2seplatform/src/org/netbeans/modules/java/j2seplatform/libraries/VolumeContentModel.java;
/cvs/java/j2seplatform/src/org/netbeans/modules/java/j2seplatform/libraries/VolumeContentModel.java,v
 <--  VolumeContentModel.java
new revision: 1.5; previous revision: 1.4
done
Processing log script arguments...
More commits to come...
Checking in
j2seplatform/src/org/netbeans/modules/java/j2seplatform/platformdefinition/J2SEPlatformCustomizer.java;
/cvs/java/j2seplatform/src/org/netbeans/modules/java/j2seplatform/platformdefinition/J2SEPlatformCustomizer.java,v
 <--  J2SEPlatformCustomizer.java
new revision: 1.16; previous revision: 1.15
done
Comment 4 Jesse Glick 2004-09-09 18:54:34 UTC
Close enough I guess.