Access resource / file packaged inside a jar or a located on classpath.
Two ways to access the file located inside jar or located on classpath.
- Use getResourceAsStream("filename") on ClassLoader, one can retrieve the class loader instance from class instance of any class or Thread.currentThread().getClassLoader(). When you try to load the file using class loader, file will be always searched inside root folder on classpath. e.g
Thread.currentThread().getClassLoader().getResourceAsStream("config.properties") and Thread.currentThread().getClassLoader().getResourceAsStream("/config.properties") either way class loader will try to search file from root folder which is on class path or from root folder inside jar. - User getResourceAsStream("filename") on Class instance of a class. One can retrieve the class instance using ClassName.class or this.getClass(). When you try to load the file using class, file search will depend on how do you specify the file name. When you specify file "config.properties" this.getClass().getResourceAsStream("config.properties"), file will be searched inside same package as that of given class on which you are calling getResourceAsStream(). When you specify file like "/config.properties" given file will be searched from root folder which is on class path or from root folder inside jar.
To access file form given path outside the class path, one need to make use of java.io.File .
File file = new File("filename with absolute path");
FileInputStream fStream = new FileInputStream(file);
شركة كشف تسربات المياه بالرياض
ReplyDeleteشركة تنظيف بالمدينة المنورة
شركة تنظيف مساجد بالرياض
شركة كشف تسربات المياه بالرياض
شركة تنظيف حشرات بالرياض
شركة كشف تسربات المياه شمال الرياض
كشف تسربات المياه شرق الرياض
شركة كشف تسربات المياه غرب الرياض
شركة كشف تسربات المياه جنوب الرياض
افضل شركة كشف تسربات المياه بالرياض دليل
اسعار كشف تسرب المياه
كشف تسربات المياه عماله فلبينيه
I have read your blog its very attractive and impressive. I like it your blog.
ReplyDeleteJava Training in Chennai Core Java Training in Chennai Core Java Training in Chennai
Java Online Training Java Online Training Core Java 8 Training in Chennai java 8 online training JavaEE Training in Chennai Java EE Training in Chennai
instagram takipçi satın al - instagram takipçi satın al - tiktok takipçi satın al - instagram takipçi satın al - instagram beğeni satın al - instagram takipçi satın al - instagram takipçi satın al - instagram takipçi satın al - instagram takipçi satın al - binance güvenilir mi - binance güvenilir mi - binance güvenilir mi - binance güvenilir mi - instagram beğeni satın al - instagram beğeni satın al - polen filtresi - google haritalara yer ekleme - btcturk güvenilir mi - binance hesap açma - kuşadası kiralık villa - tiktok izlenme satın al - instagram takipçi satın al - sms onay - paribu sahibi - binance sahibi - btcturk sahibi - paribu ne zaman kuruldu - binance ne zaman kuruldu - btcturk ne zaman kuruldu - youtube izlenme satın al - torrent oyun - google haritalara yer ekleme - altyapısız internet - bedava internet - no deposit bonus forex - erkek spor ayakkabı - webturkey.net - minecraft premium hesap - karfiltre.com - tiktok jeton hilesi - tiktok beğeni satın al - microsoft word indir - misli indir
ReplyDeletetakipçi satın al
ReplyDeletetakipçi satın al
takipçi satın al
takipçi satın al
takipçi satın al
takipçi satın al
takipçi satın al
takipçi satın al
takipçi satın al
takipçi satın al
takipçi satın al
takipçi satın al
takipçi satın al
takipçi satın al
takipçi satın al
takipçi satın al
takipçi satın al
takipçi satın al
takipçi satın al
takipçi satın al
takipçi satın al
instagram takipçi satın al
instagram takipçi satın al
takipçi satın al
takipçi satın al
instagram takipçi satın al
instagram takipçi satın al
instagram takipçi satın al
instagram takipçi satın al
takipçi satın al
instagram takipçi satın al
marsbahis
ReplyDeletebetboo
sultanbet
marsbahis
betboo
sultanbet
ucuz takipçi
ReplyDeleteucuz takipçi
tiktok izlenme satın al
binance güvenilir mi
okex güvenilir mi
paribu güvenilir mi
bitexen güvenilir mi
coinbase güvenilir mi
instagram takipçi satın al
instagram takipçi satın alz
Ahaa, its nice dialogue about this piece of writing at this place at this webpage,
ReplyDeleteI have read all that, so at this time me also commenting here.
havanese dogs for sale
havanese puppies for sale
teacup havanese puppy
chocolate havanese puppy for sale
teacup pomeranian for sale
doodle puppies
aussiedoodle puppies for sale
bernedoodle puppies for sale
goldendoodle puppies for sale
https://www.fluffyhavanese.com/
At this time I am going away to do my breakfast, afterward having my breakfast coming over again to read further news
ReplyDeleteragdoll cat for sale
ragdoll cats for sale
aussiedoodle for sale
bernedoodles for sale
havanese puppies for sale under $1,000
great dane puppies for sale
great dane puppy for sale
great dane puppies near me
great dane puppies for sale near me
https://thegorgeousdoodles.com/
seo fiyatları
ReplyDeletesaç ekimi
dedektör
instagram takipçi satın al
ankara evden eve nakliyat
fantezi iç giyim
sosyal medya yönetimi
mobil ödeme bozdurma
kripto para nasıl alınır
instagram beğeni satın al
ReplyDeleteyurtdışı kargo
seo fiyatları
saç ekimi
dedektör
fantazi iç giyim
sosyal medya yönetimi
farmasi üyelik
mobil ödeme bozdurma
tuzla beko klima servisi
ReplyDeletemaltepe vestel klima servisi
kadıköy vestel klima servisi
maltepe bosch klima servisi
kadıköy bosch klima servisi
maltepe arçelik klima servisi
kadıköy arçelik klima servisi
kartal samsung klima servisi
ümraniye samsung klima servisi
Good content. You write beautiful things.
ReplyDeletehacklink
vbet
hacklink
mrbahis
vbet
mrbahis
sportsbet
korsan taksi
taksi