Issue #2906 added close to BUFR parser
close netcdf file to solve NFS clean issue Former-commit-id:abb14c67e7
[formerly5beb3be2e8
] [formerlyabb14c67e7
[formerly5beb3be2e8
] [formerlya1e416da97
[formerly 9675e997369e39455aacadcd72d0d8476f6c7ffc]]] Former-commit-id:a1e416da97
Former-commit-id:9f1856a6f0
[formerlya2c0ba7f0b
] Former-commit-id:f03c6cdcf9
This commit is contained in:
parent
938e39a0fc
commit
3c8a573a48
2 changed files with 22 additions and 2 deletions
|
@ -58,6 +58,7 @@ import com.raytheon.uf.common.status.UFStatus;
|
||||||
* Mar 26, 2014 2905 bclement fixed types, added scale/offset
|
* Mar 26, 2014 2905 bclement fixed types, added scale/offset
|
||||||
* Apr 01, 2014 2905 bclement moved splitter functionality to separate utility
|
* Apr 01, 2014 2905 bclement moved splitter functionality to separate utility
|
||||||
* added scanForStructField()
|
* added scanForStructField()
|
||||||
|
* Apr 29, 2014 2906 bclement added close()
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -827,4 +828,13 @@ public class BufrParser {
|
||||||
return structStack.size();
|
return structStack.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Release resources associated with BUFR file.
|
||||||
|
*
|
||||||
|
* @throws IOException
|
||||||
|
*/
|
||||||
|
public void close() throws IOException {
|
||||||
|
this.ncfile.close();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,8 @@ import com.raytheon.uf.edex.plugin.bufrobs.category.CategoryKey;
|
||||||
*
|
*
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Apr 1, 2014 2906 bclement Initial creation
|
* Apr 01, 2014 2906 bclement Initial creation
|
||||||
|
* Apr 29, 2014 2906 bclement close parser when finished
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -69,9 +70,10 @@ public class BufrObsProcessor {
|
||||||
*/
|
*/
|
||||||
public PluginDataObject[] process(File bufrFile)
|
public PluginDataObject[] process(File bufrFile)
|
||||||
throws BufrObsDecodeException {
|
throws BufrObsDecodeException {
|
||||||
|
BufrParser parser = null;
|
||||||
PluginDataObject[] rval;
|
PluginDataObject[] rval;
|
||||||
try {
|
try {
|
||||||
BufrParser parser = new BufrParser(bufrFile);
|
parser = new BufrParser(bufrFile);
|
||||||
CategoryKey key = getBufrCategory(parser);
|
CategoryKey key = getBufrCategory(parser);
|
||||||
AbstractBufrSfcObsDecoder decoder = getDecoder(key);
|
AbstractBufrSfcObsDecoder decoder = getDecoder(key);
|
||||||
if (decoder == null) {
|
if (decoder == null) {
|
||||||
|
@ -86,6 +88,14 @@ public class BufrObsProcessor {
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new BufrObsDecodeException("Unable to read BUFR file: "
|
throw new BufrObsDecodeException("Unable to read BUFR file: "
|
||||||
+ bufrFile, e);
|
+ bufrFile, e);
|
||||||
|
} finally {
|
||||||
|
if (parser != null)
|
||||||
|
try {
|
||||||
|
parser.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new BufrObsDecodeException(
|
||||||
|
"Unable to close parser for file: " + bufrFile, e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return rval;
|
return rval;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue