apache / apache/netbeans

Enhancement Request: Support for User-Specific Configuration in NetBeans Platform Application

Open
#6,707 2 comments 0 reactions 0 assignees View on GitHub
Contribution welcome kind:feature
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### Description

**Issue Description:**
I have a Maven- and NetBeans-Platform-based Java Desktop App Project. Currently, the application utilizes a configuration file located in the installation directory (`etc/.conf`) to set important Java runtime parameters using the `default_options` option. However, I would like to provide users with the ability to set additional Java runtime parameters, such as the scaling option `sun.java2d.uiScale`.

The challenge is that users might not have write access to the installation directory where the `etc/.conf` file is located. I've discovered that it's possible to place a similar configuration file in the NetBeans user directory (`/etc/.conf`), where users have write permissions.

My dilemma is that the default options specified in the default_options of the installation directory's` etc/.conf` file need to be retained for backward compatibility. Additionally, I'd like to append user-specific options from the <`NetBeans-User-Directory>/etc/.conf` file to the default_options.

I am uncertain about the best approach to achieve this, and **I am concerned that if I use the user directory configuration file, the NetBeans Platform might no longer consider the installation directory's configuration.**

**Proposed Solution:**
I propose enhancing the NetBeans Platform to support a mechanism for user-specific configuration that can work in conjunction with the installation directory's configuration.

1. **Support User Directory Configuration:**

- Allow the NetBeans Platform to recognize and use configuration files located in the NetBeans user directory (`/etc/.conf`).

- Ensure that user-specific configurations are appended to the default options defined in the installation directory's configuration.

2. **Preserve Backward Compatibility:**

- Retain the ability to use the installation directory's configuration (`etc/.conf`) for specifying default options.
- Ensure that existing installations with configuration in the installation directory continue to work as expected.

3. **Documentation:**

- Update documentation to clearly explain the new user-specific configuration mechanism and how it interacts with the installation directory's configuration.

**Epected Behavior:**
Upon implementing this enhancement, users should be able to set additional options in the <`NetBeans-User-Directory>/etc/.conf` file, and these options should be appended to the default_options specified in the installation directory's etc/.conf. The NetBeans Platform should seamlessly use both configurations for the application runtime

### Use case/motivation

_No response_

### Related issues

_No response_

### Are you willing to submit a pull request?

No

Contributor guide

Open the contributing guide

Research direction

Start by tracing how the installation etc/.conf file and the NetBeans user directory etc/.conf file are discovered and how default_options are combined. Confirm the current behavior when both files exist, then define and document the precedence and append behavior while preserving existing installation-directory configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
desktop
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.