Presupunem un director cu calea: src/test/resources/fileprocessor/source
1. ClassLoader:
final String SOURCE_PATH = "fileprocessor/source";
sourceFolder = new File(this.getClass().getClassLoader().getResource(SOURCE_PATH).getFile());
2. Obtinerea caii relativ la proiect:
private static final String SOURCE_PATH = "./target/test-classes/fileprocessor/source";
sourceFolder = new File(SOURCE_PATH);
P.S. Nu folosim pe Bamboo file.getAbsolutePath() !!!
Niciun comentariu:
Trimiteți un comentariu