I am working with Spring WebClient and need to download list of files from API.
class Document {
private String content;
private String fileName;
}
Following is the structure of single document and I need to fetch list of documents. So now the problem is size. if document size is large than 2 mb application throws exception.
So I want to use file system to solve this. Currently i am using following piece of code to get all docs.
public Documents getDoc() {
WebClient webClient = webClientCreator.createWebClient();
return webClient
.get()
.uri(getTestURI())
.header(HttpHeaders.ACCEPT, Constants.ACCEPT_TYPE)
.retrieve()
.bodyToMono(Documents.class)
.block();
}
How can I use file system to write file temporally there.