Version: 2.5.2 Update

This commit is contained in:
ᴋᴇʏ
2023-10-19 22:43:29 +08:00
committed by GitHub
parent 953b966961
commit 0602346249

View File

@@ -1,8 +1,9 @@
package burp.rule.utils;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Map;
import burp.BurpExtender;
import org.yaml.snakeyaml.DumperOptions;
import org.yaml.snakeyaml.Yaml;
import java.io.FileInputStream;
@@ -25,13 +26,11 @@ public class YamlTool {
public static Map<String, Object> loadYaml(String filePath) {
try {
InputStream inputStream = new FileInputStream(filePath);
Yaml yaml = newStandardYaml();
return yaml.load(inputStream);
} catch (FileNotFoundException e) {
InputStream inputStream = Files.newInputStream(Paths.get(filePath));
return newStandardYaml().load(inputStream);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
}