Commit ef7a91c7 authored by azara's avatar azara
Browse files

fix current year value (2015 to 2016)

parent 0bb8ef37
......@@ -5,14 +5,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2.0 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.bonitasoft.studio.common;
......@@ -20,64 +18,59 @@ import org.osgi.framework.Version;
/**
* @author Romain Bioteau
*
*/
public class ProductVersion {
//OEM Variable to be use for redirect urls
public static final String REDIRECT_URL_PRODUCT_ID = "bos";
//OEM Variable to be use for redirect urls
public static final String REDIRECT_URL_PRODUCT_ID = "bos";
public static final String VERSION_6_0_0_ALPHA = "6.0.0-Alpha";
public static final String CURRENT_VERSION = "7.1.5";
public static final String CURRENT_YEAR = "2015";
public static final String CURRENT_YEAR = "2016";
public static boolean sameVersion(final String version){
public static boolean sameVersion(final String version) {
return CURRENT_VERSION.equals(version);
}
public static boolean sameMinorVersion(final String version){
if(version == null){
return false ;
public static boolean sameMinorVersion(final String version) {
if (version == null) {
return false;
}
final String minor = CURRENT_VERSION.substring(0, CURRENT_VERSION.lastIndexOf(".")) ;
final String minor = CURRENT_VERSION.substring(0, CURRENT_VERSION.lastIndexOf("."));
final String[] split = version.split("\\.");
String testedVersion = version ;
if(split.length > 2){
testedVersion = split[0] + "." + split[1] ;
String testedVersion = version;
if (split.length > 2) {
testedVersion = split[0] + "." + split[1];
}
return minor.equals(testedVersion) ;
return minor.equals(testedVersion);
}
public static boolean canBeMigrated(final String version) {
if(version == null){
return false;
}
Version current = new Version("0.0.0");
try{
current = Version.parseVersion(version);
}catch(final IllegalArgumentException e){
}
final Version productVersion = new Version(CURRENT_VERSION);
return current.compareTo(productVersion) < 0;
}
public static boolean canBeImported(final String version) {
if(version == null){
return true;
}
Version current = new Version("0.0.0");
try{
current = Version.parseVersion(version);
}catch(final IllegalArgumentException e){
public static boolean canBeMigrated(final String version) {
if (version == null) {
return false;
}
Version current = new Version("0.0.0");
try {
current = Version.parseVersion(version);
} catch (final IllegalArgumentException e) {
}
final Version productVersion = new Version(CURRENT_VERSION);
return current.compareTo(productVersion) <= 0;
}
}
final Version productVersion = new Version(CURRENT_VERSION);
return current.compareTo(productVersion) < 0;
}
public static boolean canBeImported(final String version) {
if (version == null) {
return true;
}
Version current = new Version("0.0.0");
try {
current = Version.parseVersion(version);
} catch (final IllegalArgumentException e) {
}
final Version productVersion = new Version(CURRENT_VERSION);
return current.compareTo(productVersion) <= 0;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment