*/
public File saveSession()
{
- // TODO: a wait loop to ensure the file is written fully before returning?
- return getBinding() == null ? null : getBinding().saveSession();
+ if (getBinding() == null) { return null;}
+ File session = getBinding().saveSession();
+ long l = session.length();
+ int wait=50;
+ do {
+ try {
+ Thread.sleep(5);
+ } catch (InterruptedException e) {
+ }
+ long nextl = session.length();
+ if (nextl!=l)
+ {
+ wait = 50;
+ l=nextl;
+ }
+ } while (--wait>0);
+ return session;
}
/**