Last active
August 29, 2015 14:18
-
-
Save LetItRock/088d5203c535e6466792 to your computer and use it in GitHub Desktop.
Read file from classpath
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
BufferedReader reader = new BufferedReader(new InputStreamReader(this.getClass().getClassLoader().getResourceAsStream("META-INF\\teamdev.licenses"))); | |
System.out.println("------------------------------------"); | |
System.out.println("Text from file: "); | |
String string = null; | |
while ((string = reader.readLine()) != null) { | |
System.out.println(string); | |
} | |
System.out.println("------------------------------------"); | |
} catch (Exception e) { | |
e.printStackTrace(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment