I am using a configuration file into my software, i have the file in the correct root(non local) src/main/java/pdf/factory/fop.xconf
. After compile the code, locally it looked for the file into fopBaseUri=C:\Users\user\Documents\software\local\target\data\bin\content\sftw.web-0.0.0-SNAPSHOT.war\WEB-INF\classes\pdf\fopfactorybasedir\fop.xconf
I didn't have that path, just had C:\Users\user\Documents\software\local\target\data\bin
so i've created the rest of the path, and it worked like it should..
however, when i deployed, it didn't work, maybe becuase the path don't exist after compile, and it wipes it all when mvn install.
how can i force it to look into the path, or force the file to be the one i use ( non local into src/... )
heres my code:
@ApplicationScoped
public class FopFactoryService {
private static final String ROOT_PATH = "/pdf/fopfactorybasedir/fop.xconf";
private final FopFactory fopFactory;
private final FOUserAgent foUserAgent;
private final TransformerFactory transformerFactory;
public FopFactoryService() throws URISyntaxException, IOException, SAXException {
final URI uri = FopFactoryService.class.getResource(ROOT_PATH).toURI();
final File f = new File(uri.getPath());
LOG.info("fopBaseUri={}", f);
fopFactory = FopFactory.newInstance(f);
foUserAgent = fopFactory.newFOUserAgent();
transformerFactory = TransformerFactory.newInstance();
}
what am i missing?