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 93282 - Provide API for creating config prop. files
Summary: Provide API for creating config prop. files
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Milan Kubec
URL:
Keywords: API, API_REVIEW_FAST
Depends on:
Blocks:
 
Reported: 2007-01-26 10:44 UTC by Milan Kubec
Modified: 2007-02-07 10:42 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
patch file (4.92 KB, patch)
2007-01-30 14:59 UTC, Milan Kubec
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Milan Kubec 2007-01-26 10:44:07 UTC
Friend API for creating run configuration property files for j2seproject is
needed. It will be used from other modules to create property files for shared
config and private config.

I propose following class:

package org.netbeans.modules.java.j2seproject.api;
public final class J2SEProjectConfigurations {
/**
 * Creates property files under nbproject/configs and 
 * nbproject/private/configs under the given j2seproject project.
 * Properties to be written are passed as sharedProps and privateProps.
 */
public static void createConfigurationFiles(Project prj, 
    String configName, Properties sharedProps, Properties privateProps) {}
Comment 1 Milan Kubec 2007-01-30 14:59:08 UTC
Created attachment 37830 [details]
patch file
Comment 2 Milan Kubec 2007-01-30 15:00:58 UTC
I've attached diff file with implementation. The friend API will be used from
javawebstart module. Please review. Thanks.
Comment 3 Milan Kubec 2007-02-05 14:48:51 UTC
If there are no objections I will integrate tomorrow.
Comment 4 Jaroslav Tulach 2007-02-05 15:52:23 UTC
I've just checked the diff. I see no test. Imho a test is a must for a 
sustainable API, I'd like to suggest you to write one. Except this testing 
thing, the commit is imho acceptable.
Comment 5 Jesse Glick 2007-02-05 17:37:40 UTC
FileObject jwsConfigFO = FileUtil.createData(prjDir, cfgFilePath);
  if (jwsConfigFO != null) {

I don't think FU.cD is allowed to return null.

I assume sharedProps is permitted to contain also special keys such as $label or
$target.<<ACTION>>?
Comment 6 Milan Kubec 2007-02-05 21:23:40 UTC
jtulach: I will provide a test.

jglick: 
Re. "I don't think FU.cD is allowed to return null." - You are right, javadoc
doesn't mention null as possible return value.

Re. "I assume sharedProps is permitted to contain also special keys such as
$label or $target.<<ACTION>>?" - I think that there is no such limitation on
Properties. Do you mean to mention it in javadoc? 
Comment 7 Jesse Glick 2007-02-05 23:04:07 UTC
For special keys in sharedProps - of course j.u.Properties does not care. I
meant that this API should document that these keys are permitted, even though
they have special meanings (are not intended to be evaluated as regular Ant
properties).
Comment 8 Milan Kubec 2007-02-07 10:42:54 UTC
Done.

RCS file:
/cvs/java/j2seproject/test/unit/src/org/netbeans/modules/java/j2seproject/api/J2SEProjectConfigurationsTest.java,v
done
Checking in
test/unit/src/org/netbeans/modules/java/j2seproject/api/J2SEProjectConfigurationsTest.java;
/cvs/java/j2seproject/test/unit/src/org/netbeans/modules/java/j2seproject/api/J2SEProjectConfigurationsTest.java,v
 <--  J2SEProjectConfigurationsTest.java
initial revision: 1.1
done
RCS file:
/cvs/java/j2seproject/src/org/netbeans/modules/java/j2seproject/api/J2SEProjectConfigurations.java,v
done
Checking in
src/org/netbeans/modules/java/j2seproject/api/J2SEProjectConfigurations.java;
/cvs/java/j2seproject/src/org/netbeans/modules/java/j2seproject/api/J2SEProjectConfigurations.java,v
 <--  J2SEProjectConfigurations.java
initial revision: 1.1
done