Reading Files From JAR - Maven Project

ClassLoader loader = getClass().getClassLoader();
in = loader.getResourceAsStream("templates/"+templateType.getValue()+".xml");


where the template is stored in a maven project as in

Src--> main--> resources-->templates-->template.xml

Comments

Popular posts from this blog

'jasypt.encryptor.password' or one of ['jasypt.encryptor.privateKeyString', 'jasypt.encryptor.privateKeyLocation'] must be provided for Password-based or Asymmetric encryption

Couldn't store job: Unable to serialize JobDataMap for insertion into database because the value of property 'jobLauncher' is not serializable

Installing OpenCv 3.0 and Javacv on Raspberry Pi