try {
FileList fileList = dragContent.getFileList();
if (fileList.getLength() == 1) {
File file = fileList.get(0);
JSONSerializer jsonSerializer = new JSONSerializer();
FileInputStream fileInputStream = null;
try {
try {
fileInputStream = new FileInputStream(file);
setValue(jsonSerializer.readObject(fileInputStream));
} finally {
if (fileInputStream != null) {
fileInputStream.close();
}
}
} catch (IOException exception) {
Prompt.prompt(exception.getMessage(), window);
} catch (SerializationException exception) {
String message = "Serialization exception at line "
+ jsonSerializer.getLineNumber() + " in " + file + ": "
+ "\"" + exception.getMessage() + "\"";
Prompt.prompt(message, window);
}
window.setTitle(WINDOW_TITLE + " - " + file.getName());