android: Cleanup classes
- Use final modifer wherever possible - Use try-with-resources for input/output streams Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
committed by
Jason A. Donenfeld
parent
4986d92f3d
commit
4671f59c67
@@ -106,7 +106,7 @@ public final class WgQuickBackend implements Backend {
|
||||
private void setStateInternal(final Tunnel tunnel, final Config config, final State state)
|
||||
throws Exception {
|
||||
final File tempFile = new File(localTemporaryDir, tunnel.getName() + ".conf");
|
||||
try (FileOutputStream stream = new FileOutputStream(tempFile, false)) {
|
||||
try (final FileOutputStream stream = new FileOutputStream(tempFile, false)) {
|
||||
stream.write(config.toString().getBytes(StandardCharsets.UTF_8));
|
||||
}
|
||||
final String command = String.format("wg-quick %s '%s'",
|
||||
|
||||
Reference in New Issue
Block a user