JDK-7022730 : Make standard system paths and variables available via API
  • Type: Enhancement
  • Component: other-libs
  • Sub-Component: other
  • Affected Version: 7
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2011-02-26
  • Updated: 2012-07-22
Description
A DESCRIPTION OF THE REQUEST :
It would be helpful to have standard system paths/variables available from a standardized API, e.g. for Windows:
%APPDATA%
%UserProfile%
%AllUsersProfile%
%SystemDrive%
%HOMEPATH%
%TEMP%
%USERNAME%
etc.
for cache requirement:
%UserProfile%\Locale Settings\Application Data
A reasonable location for such an API could be java.nio.file.FileSystem


JUSTIFICATION :
I ask this, because there is a problem to save a Java application's data to system's application data location.
The question came up because of this bug:
http://netbeans.org/bugzilla/show_bug.cgi?id=57798
Without using Windows API, NetBeans installer isn't able to determine the system's application data standard location.


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Return system variables as String.
Additionally return system paths as java.nio.file.Path


CUSTOMER SUBMITTED WORKAROUND :
Get the values via the JNI interface directly from the OS API.