[java] Check if file is already open