svn-gvsig-desktop / trunk / applications / appgvSIG / src / com / iver / cit / gvsig / Version.java @ 33235
History | View | Annotate | Download (1.43 KB)
1 |
package com.iver.cit.gvsig; |
---|---|
2 |
|
3 |
import java.io.BufferedReader; |
4 |
import java.io.FileReader; |
5 |
import java.util.StringTokenizer; |
6 |
|
7 |
import com.iver.cit.gvsig.gui.panels.FPanelAbout; |
8 |
|
9 |
public class Version { |
10 |
public final static int MAJOR_VERSION_NUMBER = 1; |
11 |
public final static int MINOR_VERSION_NUMBER = 10; |
12 |
public final static int RELEASE_NUMBER = 0; |
13 |
|
14 |
private static String BUILD = null; |
15 |
|
16 |
public static String format() { |
17 |
|
18 |
if (RELEASE_NUMBER < 1) { |
19 |
return MAJOR_VERSION_NUMBER +"."+MINOR_VERSION_NUMBER; |
20 |
} else {
|
21 |
return MAJOR_VERSION_NUMBER +"."+MINOR_VERSION_NUMBER+"."+RELEASE_NUMBER; |
22 |
} |
23 |
} |
24 |
|
25 |
public static String longFormat() { |
26 |
|
27 |
if (RELEASE_NUMBER < 1) { |
28 |
return MAJOR_VERSION_NUMBER +"."+MINOR_VERSION_NUMBER + "(Build " + getBuild() + ")"; |
29 |
} else {
|
30 |
return MAJOR_VERSION_NUMBER +"."+MINOR_VERSION_NUMBER+"."+RELEASE_NUMBER + "(Build " + getBuild() + ")"; |
31 |
} |
32 |
} |
33 |
public static String getBuild() { |
34 |
if (BUILD == null) { |
35 |
try {
|
36 |
// Leemos el n? de build
|
37 |
BufferedReader fich = new BufferedReader( |
38 |
new FileReader(FPanelAbout.class.getResource("/build.number").getFile())); |
39 |
fich.readLine(); |
40 |
fich.readLine(); |
41 |
String strVer = fich.readLine();
|
42 |
StringTokenizer strTokenizer = new StringTokenizer(strVer); |
43 |
String strToken = strTokenizer.nextToken("="); |
44 |
strToken = strTokenizer.nextToken(); |
45 |
BUILD = strToken; |
46 |
fich.close(); |
47 |
} catch (Exception e) { |
48 |
e.printStackTrace(); |
49 |
} |
50 |
|
51 |
} |
52 |
return BUILD;
|
53 |
} |
54 |
} |