Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

load a file from classpath spring boot

	public void testResourceFile() throws IOException {
		File resource = new ClassPathResource("test.json").getFile();
		String text = new String(Files.readAllBytes(resource.toPath()));
	}
Comment

PREVIOUS NEXT
Code Example
Java :: java coding problems 
Java :: gravity in java 
Java :: java int length 
Java :: java is number 
Java :: how to hide label in bottom menu android studio 
Java :: list in java 
Java :: check if jcheckbox is checked java 
Java :: java.lang.NullPointerException: Cannot invoke "java.lang.CharSequence.length()" because "this.text" is null 
Java :: converter int array para string java 
Java :: java toast 
Java :: java days between two dates 
Java :: what is the difference between sc.nextLine() and sc.next() in java 
Java :: create jframe java 
Java :: java ModelMapper class 
Java :: java date time 
Java :: how to count lines from txt java 
Java :: get logged-in user in Spring Security 
Java :: convert datetime to custom format in java 8 
Java :: java get random char from alphabet 
Java :: how to read a string after an integer in java 
Java :: java outer class 
Java :: how to set spinner value in android 
Java :: kill all java processes linux 
Java :: java rps 
Java :: autowire and qualifier 
Java :: Java String to ByteBuffer conversion 
Java :: collections.reverseorder() in java 
Java :: how to convert string to boolean in java 
Java :: Java List Sort Using sort() method 
Java :: java docstring javadoc 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =