/** * Validates that the client instance format version is compatible with the instance * format version installed on a Fiji instance. * Throws IncompatibleFijiVersionException if not. * * This method may be useful if a Fiji is not fully constructed, but the FijiSystemTable exists, * such as during construction of a Fiji. This method should only be used by framework-level * applications, since FijiSystemTable is a framework-level class. * * <p>For the definition of compatibility used in this method, see {@link * #isFijiVersionCompatible}</p> * * @param systemTable An open FijiSystemTable. * @throws IOException on I/O error reading the data version from the cluster, * or throws IncompatibleFijiVersionException if the installed instance format version * is incompatible with the version supported by the client. */ public static void validateVersion(FijiSystemTable systemTable) throws IOException { if (isFijiVersionCompatible(systemTable)) { return; // valid. } else { final ProtocolVersion clientVersion = VersionInfo.getClientDataVersion(); final ProtocolVersion clusterVersion = VersionInfo.getClusterDataVersion(systemTable); throw new IncompatibleFijiVersionException(String.format( "Data format of Fiji instance (%s) cannot operate with client (%s)", clusterVersion, clientVersion)); } }