Skip to main content
deleted 25 characters in body
Source Link
Raghu
  • 1.4k
  • 2
  • 25
  • 37

getResourceAsStream will locate the files relative to the "root" of the classpath

initFile - File Location:

init file can also be packed as a part of war with a relative location.

Properties props = new Properties(); InputStream uin = this.getClass().getResourceAsStream(initFile); InputStreamReader isr = new InputStreamReader(uin); BufferedReader in = new BufferedReader(new InputStreamReader(uin)); props.load(uin); 

getResourceAsStream will locate the files relative to the "root" of the classpath

initFile - File Location:

init file can be packed as a part of war with a relative location.

Properties props = new Properties(); InputStream uin = this.getClass().getResourceAsStream(initFile); InputStreamReader isr = new InputStreamReader(uin); BufferedReader in = new BufferedReader(new InputStreamReader(uin)); props.load(uin); 

getResourceAsStream will locate the files relative to the "root" of the classpath

initFile - File Location:

init file can also be packed as a part of war.

Properties props = new Properties(); InputStream uin = this.getClass().getResourceAsStream(initFile); InputStreamReader isr = new InputStreamReader(uin); BufferedReader in = new BufferedReader(new InputStreamReader(uin)); props.load(uin); 
Source Link
Raghu
  • 1.4k
  • 2
  • 25
  • 37

getResourceAsStream will locate the files relative to the "root" of the classpath

initFile - File Location:

init file can be packed as a part of war with a relative location.

Properties props = new Properties(); InputStream uin = this.getClass().getResourceAsStream(initFile); InputStreamReader isr = new InputStreamReader(uin); BufferedReader in = new BufferedReader(new InputStreamReader(uin)); props.load(uin);