io.quarkus.dev.console.TempSystemProperties Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of quarkus-development-mode-spi Show documentation
Show all versions of quarkus-development-mode-spi Show documentation
SPI classes for Quarkus Development mode.
package io.quarkus.dev.console;
import java.util.HashMap;
import java.util.Map;
/**
* TODO: this is a hack, we should be able to pass config overrides into the bootstrap
*/
public class TempSystemProperties implements AutoCloseable {
final Map old = new HashMap<>();
public void set(String key, String value) {
old.put(key, System.getProperty(key));
System.setProperty(key, value);
}
@Override
public void close() {
for (Map.Entry e : old.entrySet()) {
if (e.getValue() == null) {
System.clearProperty(e.getKey());
} else {
System.setProperty(e.getKey(), e.getValue());
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy