0

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 ?

Fab83i
  • 85
  • 7

1 Answers1

1

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 underlying RandomAccessFile. You could use a temp file as the location, e.g. java.io.File.createTempFile().

  • Thank you, but it seems that the method `NetcdfFileWriter.createNew(Version version, String location)` does not take File as parameter. How can I do ? – Fab83i Jul 13 '22 at 07:03