try {
final Exchange ex = setupExchange();
if (ex.getKey().getEncodedSize() == 0)
return "";
ex.fetch();
final Value value = ex.getValue();
if (value.getEncodedSize() > 50000) {
return "Too long to display: " + value.getEncodedSize();
} else {
return value.toString();
}
} catch (final PersistitException de) {
return de.toString();
}
}