don't dream your life, live your dreams !
// retrieve classLoader from this current class: ClassLoader classLoader = this.getClass().class.getClassLoader(); // now get "myfile.txt" inputstream: if(classLoader!=null) { InputStream inputstream = classLoader.getResourceAsStream("myfile.txt"); } else { logger.error("classLoader is null !"); } |
Copyright © 2024 My linux world - by Marc RABAHI
Design by Marc RABAHI and encelades.
admin