Version: 2.5.2 Update
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user