Есть файл в Resources connection.yaml:
YamlReader reader = null;
try {
URL resource = Client.class.getClassLoader().getResource("connection.yaml");
System.out.println("resource.toString() = " + resource.toString());
System.out.println("resource.getFile() = " + resource.getPath());
reader = new YamlReader(new FileReader(new File(resource.toURI())));
} catch (FileNotFoundException e) {
e.printStackTrace();
}
в результате
resource.toString() = file:/C:/Servers/Repository/Templates/out/production/resources/connection.yaml
resource.getFile() = /C:/Servers/Repository/Templates/out/production/resources/connection.yaml
как избавиться от "/"?