Skip to content

Commit

Permalink
Update CommonUtil.java
Browse files Browse the repository at this point in the history
  • Loading branch information
G3G4X5X6 committed Nov 22, 2024
1 parent c84db16 commit 4144009
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.awt.datatransfer.Transferable;
import java.awt.event.ActionEvent;
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.text.SimpleDateFormat;
Expand Down Expand Up @@ -105,7 +106,7 @@ public static String getNucleiConfigFile(Map<String, Object> config) {
if (!Files.exists(Path.of(savePath))) Files.createDirectories(new File(savePath).getParentFile().toPath());

Yaml yaml = new Yaml(new SafeConstructor(new LoaderOptions()));
yaml.dump(config, new FileWriter(savePath));
yaml.dump(config, new FileWriter(savePath, StandardCharsets.UTF_8));
return new File(savePath).getCanonicalPath();
}

Expand Down Expand Up @@ -175,7 +176,7 @@ public static void saveGroupToYaml(LinkedHashMap<String, Object> groupMap) {
Files.createFile(Path.of(NucleiConfig.getConfigPath() + "/groupby.yaml"));
if (groupMap != null) {
Yaml yaml = new Yaml();
yaml.dump(groupMap, new FileWriter(String.valueOf(Path.of(NucleiConfig.getConfigPath() + "/groupby.yaml"))));
yaml.dump(groupMap, new FileWriter(String.valueOf(Path.of(NucleiConfig.getConfigPath() + "/groupby.yaml")), StandardCharsets.UTF_8));
}
}

Expand Down

0 comments on commit 4144009

Please sign in to comment.