Is there any way to convert a File object to MultiPartFile? So that I can send that object to methods that accept the objects of MultiPartFile interface?
File myFile = new File("/path/to/the/file.txt")
MultiPartFile ....?
def (MultiPartFile file) {
def is = new BufferedInputStream(file.getInputStream())
//do something interesting with the stream
}
FileItembut that takes an actualFileto delegate to, then pass thisFileIteminstance to the constructor ofCommonsMultipartFilewhich implementsMultiPartFile- tim_yatesFile myFile. Should I just implementgetinputStream()andgetOutputStream()? - birdyartifact. You should be able to construct it withnew StoredFile( artifact: new File( '/path/to/file' ) )... Fingers crossed it works... - tim_yates