Source Code Cross Referenced for Version.java in  » Database-ORM » MMBase » org » mmbase » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database ORM » MMBase » org.mmbase 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:
003:        This software is OSI Certified Open Source Software.
004:        OSI Certified is a certification mark of the Open Source Initiative.
005:
006:        The license (Mozilla version 1.0) can be read at the MMBase site.
007:        See http://www.MMBase.org/license
008:
009:         */
010:        package org.mmbase;
011:
012:        import java.io.*;
013:
014:        /**
015:         * MMBase version reporter. The only goal of this class is providing the current version of
016:         * MMBase. The function 'get' will return it as one String.
017:         *
018:         * @author Daniel Ockeloen
019:         * @author Michiel Meeuwissen
020:         * @version $Id: Version.java,v 1.42 2008/02/16 22:13:53 nklasens Exp $
021:         */
022:        public class Version {
023:
024:            /**
025:             * Get Version Control tag
026:             * @return version Control tag
027:             * @since MMBase-1.9
028:             */
029:            public static String getTag() {
030:                String cvsTag = "$Name:  $";
031:                return cvsTag.substring(6, cvsTag.length() - 1).trim();
032:            }
033:
034:            /**
035:             * Returns the 'name' part of the MMBase version. This will normally be 'MMBase'.
036:             * @return Name part of version
037:             * @since MMBase-1.6
038:             */
039:            public static String getName() {
040:                return "MMBase";
041:            }
042:
043:            /**
044:             * Returns the major version number of this MMBase.
045:             * @return major version number
046:             * @since MMBase-1.6
047:             */
048:            public static int getMajor() {
049:                return 1;
050:            }
051:
052:            /**
053:             * Returns the minor version number of this MMBase.
054:             * @return minor version number
055:             * @since MMBase-1.6
056:             */
057:            public static int getMinor() {
058:                return 9;
059:            }
060:
061:            /**
062:             * Returns the patch level number of this MMBase.
063:             * @return patch level number
064:             * @since MMBase-1.6
065:             */
066:            public static int getPatchLevel() {
067:                return 0;
068:            }
069:
070:            /**
071:             * Returns the build date of this MMBase. During the build, the
072:             * value of this is stored in builddate.properties.
073:             * @return build date of this MMBase
074:             *
075:             * @since MMBase-1.6
076:             */
077:            public static String getBuildDate() {
078:                String resource = "";
079:                InputStream builddate = Version.class
080:                        .getResourceAsStream("builddate.properties");
081:                if (builddate != null) {
082:                    try {
083:                        BufferedReader buffer = new BufferedReader(
084:                                new InputStreamReader(builddate));
085:                        resource = buffer.readLine();
086:                        buffer.close();
087:                    } catch (IOException e) {
088:                        // error
089:                        resource = "" + e;
090:                    }
091:                }
092:                return resource;
093:            }
094:
095:            /**
096:             * Returns the version number of this MMBase.
097:             * @return version number
098:             * @since MMBase-1.6
099:             */
100:            public static String getNumber() {
101:                return getMajor() + "." + getMinor() + "." + getPatchLevel()
102:                        + (isRelease() ? "-" + getReleaseStatus() + " " : ".")
103:                        + getBuildDate();
104:            }
105:
106:            /**
107:             * Returns if this is a release version of MMBase. If this is false this MMBase is only a CVS snapshot.
108:             * @return is a release version
109:             * @since MMBase-1.6
110:             */
111:            public static boolean isRelease() {
112:                return false;
113:            };
114:
115:            /**
116:             * A String describing the status of this release. Like 'final' or 'rc3'.
117:             * @return status of this release
118:             * @since MMBase-1.7
119:             */
120:            public static String getReleaseStatus() {
121:                return "";
122:            };
123:
124:            /**
125:             * Returns the version of this MMBase.
126:             * @return version of this MMBase
127:             * @since MMBase-1.6
128:             */
129:            public static String get() {
130:                String tag = getTag();
131:                if (tag.startsWith("MMBase")) {
132:                    return tag + " " + getBuildDate();
133:                } else {
134:                    return getName() + " " + getNumber();
135:                }
136:            }
137:
138:            /**
139:             * Prints the version of this mmbase on stdout.
140:             * can be usefull on command line:
141:             * <code>java -jar mmbase.jar<code>
142:             * 
143:             * @param args command line args
144:             */
145:            public static void main(String args[]) {
146:                System.out.println(get());
147:            }
148:
149:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.