/** * Validates that the client instance format version is compatible with the instance * format version installed on a Fiji instance. * Returns true if they are compatible, false otherwise. * "Compatible" versions have the same major version digit (e.g., <tt>system-1.1</tt> * and <tt>system-1.0</tt> are compatible; <tt>system-2.5</tt> and <tt>system-1.0</tt> are not). * * <p>Older instances (installed with FijiSchema 1.0.0-rc3 and prior) will use an instance * format version of <tt>fiji-1.0</tt>. This is treated as an alias for <tt>system-1.0</tt>. * No other versions associated with the <tt>"fiji"</tt> protocol are supported.</p> * * @param systemTable An open FijiSystemTable. * @throws IOException on I/O error reading the Fiji version from the system. * @return true if the installed instance format * version is compatible with this client, false otherwise. */ private static boolean isFijiVersionCompatible(FijiSystemTable systemTable) throws IOException { final ProtocolVersion clientVersion = VersionInfo.getClientDataVersion(); final ProtocolVersion clusterVersion = VersionInfo.getClusterDataVersion(systemTable); return areInstanceVersionsCompatible(clientVersion, clusterVersion); }
/** * Validates that the client instance format version is compatible with the instance * format version installed on a Fiji instance. * Returns true if they are compatible, false otherwise. * "Compatible" versions have the same major version digit (e.g., <tt>system-1.1</tt> * and <tt>system-1.0</tt> are compatible; <tt>system-2.5</tt> and <tt>system-1.0</tt> are not). * * <p>Older instances (installed with FijiSchema 1.0.0-rc3 and prior) will use an instance * format version of <tt>fiji-1.0</tt>. This is treated as an alias for <tt>system-1.0</tt>. * No other versions associated with the <tt>"fiji"</tt> protocol are supported.</p> * * @param fiji An open fiji instance. * @throws IOException on I/O error reading the Fiji version from the system. * @return true if the installed instance format * version is compatible with this client, false otherwise. */ public static boolean isFijiVersionCompatible(Fiji fiji) throws IOException { final ProtocolVersion clientVersion = VersionInfo.getClientDataVersion(); final ProtocolVersion clusterVersion = VersionInfo.getClusterDataVersion(fiji); return areInstanceVersionsCompatible(clientVersion, clusterVersion); }