svn-gvsig-desktop / trunk / applications / appgvSIG / src / com / iver / cit / gvsig / Version.java @ 32892
History | View | Annotate | Download (1.43 KB)
1 | 6436 | jmvivo | package com.iver.cit.gvsig; |
---|---|---|---|
2 | |||
3 | 8183 | jmvivo | 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 | 6436 | jmvivo | public class Version { |
10 | 25433 | jmvivo | public final static int MAJOR_VERSION_NUMBER = 1; |
11 | 32892 | nbrodin | public final static int MINOR_VERSION_NUMBER = 10; |
12 | 6436 | jmvivo | public final static int RELEASE_NUMBER = 0; |
13 | |||
14 | 19347 | jmvivo | private static String BUILD = null; |
15 | |||
16 | 6436 | jmvivo | public static String format() { |
17 | 19347 | jmvivo | |
18 | 6436 | jmvivo | 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 | 19347 | jmvivo | |
25 | 8183 | jmvivo | public static String longFormat() { |
26 | 19347 | jmvivo | |
27 | 8183 | jmvivo | 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 | 19347 | jmvivo | |
51 | 8183 | jmvivo | } |
52 | return BUILD;
|
||
53 | } |
||
54 | 6436 | jmvivo | } |