use of org.talend.utils.ProductVersion in project tdq-studio-se by Talend.
the class WorkspaceVersionHelper method getVesion.
/**
* DOC bZhou Comment method "getVesion".
*
* @param versionFile
* @return
*/
public static ProductVersion getVesion(IPath versionPath) {
File versionFile = versionPath == null ? null : versionPath.toFile();
ProductVersion pVersion = null;
try {
if (versionFile != null && versionFile.exists()) {
FileInputStream inStream = new FileInputStream(versionFile);
Properties pros = new Properties();
pros.load(inStream);
String version = pros.getProperty(VERSION);
if (version != null && !"".equals(version)) {
// $NON-NLS-1$
pVersion = ProductVersion.fromString(version);
}
inStream.close();
} else {
pVersion = new ProductVersion(0, 0, 0);
}
} catch (Exception e) {
log.error(e, e);
}
return pVersion;
}
Aggregations