@Override
public void doStore(String id, SessionData data, long lastSaveTime) throws Exception
{
File file = null;
if (_storeDir != null)
{
delete(id);
String filename = getIdWithContextAndExpiry(data);
String idWithContext = getIdWithContext(id);
file = new File(_storeDir, filename);
try(FileOutputStream fos = new FileOutputStream(file,false))
{
save(fos, id, data);
_sessionFileMap.put(idWithContext, filename);
}
catch (Exception e)
{
if (file != null)
file.delete();
throw new UnwriteableSessionDataException(id, _context,e);
}
}
}