Commit 8ae7ae53 authored by Robert Smith's avatar Robert Smith

VIVE Key-Value Pair Item no longer locks files

Fixed a bug in the VIBE Key-Value Pair Item where the reader for
imported files was not being closed, which prevented all other
processes, including ICE itself, from editing the file.
Signed-off-by: Robert Smith's avatarRobert Smith <smithrw@ornl.gov>
parent bfd48444
......@@ -323,7 +323,6 @@ public class VibeKVPair extends Item implements IReader, IWriter {
logger.info("VibeKVPair Message: Loading"
+ inputFile.getFullPath().toOSString());
form = read(inputFile);
form.setName(getName());
form.setDescription(getDescription());
form.setId(getId());
form.setItemID(getId());
......@@ -434,7 +433,7 @@ public class VibeKVPair extends Item implements IReader, IWriter {
try {
reader = new BufferedReader(
new InputStreamReader(ifile.getContents()));
// Read the FileInputStream and append to a StringBuffer
StringBuffer buffer = new StringBuffer();
int fileByte;
......@@ -451,6 +450,10 @@ public class VibeKVPair extends Item implements IReader, IWriter {
// Add a dummy EOF line so that the last line of the file is
// read in correctly
lines.add("EOF");
//Close the reader
reader.close();
} catch (FileNotFoundException e) {
logger.error("VibeKVPair Message: "
+ "Error! Could not find file for loading.");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment