|
@@ -27,6 +27,7 @@ import com.dmdirc.logger.ErrorLevel;
|
27
|
27
|
import com.dmdirc.logger.Logger;
|
28
|
28
|
|
29
|
29
|
import java.io.IOException;
|
|
30
|
+import java.io.InputStream;
|
30
|
31
|
import java.nio.file.Files;
|
31
|
32
|
import java.nio.file.Path;
|
32
|
33
|
|
|
@@ -48,8 +49,8 @@ public class DefaultAliasInstaller implements Migrator {
|
48
|
49
|
|
49
|
50
|
@Override
|
50
|
51
|
public void migrate() {
|
51
|
|
- try {
|
52
|
|
- Files.copy(getClass().getResourceAsStream("defaults.yml"), target);
|
|
52
|
+ try (final InputStream stream = getClass().getResourceAsStream("defaults.yml")) {
|
|
53
|
+ Files.copy(stream, target);
|
53
|
54
|
} catch (IOException ex) {
|
54
|
55
|
Logger.appError(ErrorLevel.MEDIUM, "Unable to extract default aliases", ex);
|
55
|
56
|
}
|