package at.gv.egiz.moazs.util; import org.springframework.stereotype.Component; import java.io.File; @Component public class FileUtils { /** * If path is relative, resolve path as classpath resource. If path is absolute, * leave as-is. */ public String determinePath(String abstractPath) { if (new File(abstractPath).isAbsolute()) { return abstractPath; } else { //java.lang.Class needs relative resources to start with "/" return this.getClass().getResource("/" + abstractPath).getFile(); } } }