Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

Info

Since 2014.01 it is possible to write a NetCDF-CF based adapter, see Developing a FEWS Model Adapter (NetCDF-CF)

Table of Contents

Development of FEWS Adapter

...

public static BufferedInputStream newInputStream(File file) throws IOException {
//noinspection UseOfPropertiesAsHashtable
var stream = System.getProperties().get(file);
if (stream instanceof BufferedInputStream) return (BufferedInputStream) stream;
return new BufferedInputStream(new FileInputStream(file));
}

public static BufferedOutputStream newOutputStream(File file) throws IOException {
//noinspection UseOfPropertiesAsHashtable
var stream = System.getProperties().get(file);
if (stream instanceof BufferedOutputStream) return (BufferedOutputStream) stream;
return new BufferedOutputStream(new FileOutputStream(file));
}

Validating xml

When an adapter reads xml written by FEWS according to its own xsd there is no need for validation, it is an unnecessary step because in the creation process FEWS uses those xsd's and therefore the xml will be valid.

...