I am trying to convert a product into netcdf object. i am using unidata library.
What i want to do is return a netcdf object into xml response.
In fact, I create NetcdfFileWriter
with method
createNew()
. But a location is mandatory. I do not want to save the file somewhere because what i want is return it into xml response.
My method is now returning NetcdfFile
created with the method above. But i still have a file on my disk that i do not want.
Have you an idea ?
It is not possible to create a
NetcdfFile
object in memory with the netCDF-Java library, because there's no in-memory implementation of the underlyingRandomAccessFile
. You could use a temp file as the location, e.g.java.io.File.createTempFile()
.