Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

file to multipartfile in java

File file = new File("src/test/resources/input.txt");
FileInputStream input = new FileInputStream(file);
MultipartFile multipartFile = new MockMultipartFile("file",
            file.getName(), "text/plain", IOUtils.toByteArray(input));
Comment

PREVIOUS NEXT
Code Example
Java :: access each key and value in a hashmap java 
Java :: javafx set min window size 
Java :: count the number of words in a string java 
Java :: Captain Disillusion age 
Java :: null character in java 
Java :: ISO week date java 
Java :: print arraylist java 
Java :: how to add animation to nivation component android 
Java :: java swing stripes 
Java :: spring xml 
Java :: java max from 3 parameters 
Java :: decimals java 
Java :: checkindex java 
Java :: android java optional arguments 
Java :: how to stop timer in java 
Java :: datatypes in arduino 
Java :: print colored text java 
Java :: how to read a .json from web api java 
Java :: swing event enter key 
Java :: linked list sorting in java 
Java :: get file extension java 
Java :: print map in java 
Java :: How to create a union-find data structure, in Java? 
Java :: spring boot jpa in clause 
Java :: change color of jframe 
Java :: how to convert int array to integer list in java 
Java :: set char value to null java 
Java :: console printing in java 
Java :: what is an error in java 
Java :: turning a sentence to an array java 
ADD CONTENT
Topic
Content
Source link
Name
9+5 =