我有一个如下所示的小代码片段,如您所见,它有一个用于检查服务器版本的硬编码值。现在我的意图是,如果服务器版本是 11.3.0 或更高版本,那么应该输入 if,但我无法想出办法,Integer.parseInt我猜我不会工作,因为我解析 int 而不是 float。
String serverVersion = DatamodelVersion.getInstance().getVersion();
if(serverVersion.equalsIgnoreCase("11.3.0"))
{
    outstr = new FileOutputStream(confFile);
    prop.setProperty("NTFSDriver", "11.3.0/x86/tntfs.ko");
    prop.setProperty("NTFSDriver_x64", "11.3.0/x86_64/tntfs.ko");
    prop.store(outstr, "");
    update = true;
    System.out.println("Updated the tuxera conf file successfully");
    logger.logDebugAlways("Updated the tuxera conf file successfully");
}