boolean fileExist;
try {
fileExist = file.exists();
} catch (Exception e) {
throw new CachePersistenceException("Unable to verify if " + file + " exists: " + e);
}
// Read the file if it exists
if (fileExist) {
ObjectInputStream oin = null;
try {
BufferedInputStream in = new BufferedInputStream(new FileInputStream(file));
oin = new ObjectInputStream(in);
readContent = oin.readObject();
} catch (Exception e) {
// We expect this exception to occur.
// This is when the item will be invalidated (written or deleted)
// during read.
// The cache has the logic to retry reading.
throw new CachePersistenceException("Unable to read '" + file.getAbsolutePath() + "' from the cache: " + e);
} finally {
// HHDE: no need to close in. Will be closed by oin
try {
oin.close();
} catch (Exception ex) {