File tree Expand file tree Collapse file tree 1 file changed +20
-13
lines changed Expand file tree Collapse file tree 1 file changed +20
-13
lines changed Original file line number Diff line number Diff line change @@ -577,18 +577,25 @@ static public boolean deleteFile(File file) throws IOException {
577
577
578
578
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
579
579
580
+ /**
581
+ * These methods were refactored to use the Preferences system instead of
582
+ * actual environment variables, since modifying environment variables at runtime
583
+ * proved problematic. This approach provides similar functionality
584
+ * while being compatible with various platforms and execution environments.
585
+ *
586
+ * This abstraction maintains a consistent API for environment-like variable storage
587
+ * while implementing it differently under the hood to work around runtime limitations.
588
+ */
580
589
581
- // static public void setenv(String variable, String value) {
582
- // inst.setenv(variable, value);
583
- // }
584
- //
585
- //
586
- // static public String getenv(String variable) {
587
- // return inst.getenv(variable);
588
- // }
589
- //
590
- //
591
- // static public int unsetenv(String variable) {
592
- // return inst.unsetenv(variable);
593
- // }
590
+ static public void setenv (String variable , String value ) {
591
+ Preferences .set (variable , value );
592
+ }
593
+
594
+ static public String getenv (String variable ) {
595
+ return Preferences .get (variable );
596
+ }
597
+
598
+ static public int unsetenv (String variable ) {
599
+ throw new RuntimeException ("unsetenv() not yet implemented" );
600
+ }
594
601
}
You can’t perform that action at this time.
0 commit comments