State state = getSessionState(id, path, file);
switch (state) {
case INIT:
if (create == false) {
delete = true;
throw new SessionException(id, Reason.NOT_EXIST);
} else {
createSession(path, file);
}
break;
case CREATED:
if (create) {
throw new SessionException(id, Reason.ALREADY_EXIST);
}
break;
case INVALID:
if (force == false) {
WGLOG.error("W01001",
id,
path);
throw new SessionException(id, Reason.BROKEN);
}
break;
default:
throw new AssertionError(MessageFormat.format(
"Invalid state: {2} (id={0}, path={1})",