How can i find the path of my file in my Java project file? -


i put file inside java project file , want read how can find path name java.

here put in c driver want find path writing name of file. there function it?

   fileinputstream fstream1 = new fileinputstream("c:/en-gb.dic"); 

if file inside jar file generated project (or in classpath used project, generally), under package com.foo.bar, can load using

someclassofyourproject.class.getresourceasstream("/com/foo/bar/en-gb.dic"); 

if it's not in classpath, , launch application (using java.exe) directory c:\baz, , file under c:\baz\boom\, can load using

new fileinputstream("boom/en-gb.dic"); 

Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -