Coverage Report - com.buckosoft.fibs.BuckoFIBS.Version
 
Classes in this File Line Coverage Branch Coverage Complexity
Version
0%
0/11
0%
0/2
2
 
 1  
 /******************************************************************************
 2  
  * Version.java - Handle Versioning
 3  
  * $Id$
 4  
  * 
 5  
  * BuckoFIBS - Backgammon by BuckoSoft
 6  
  * Copyright© 2009,2010 - Dick Balaska - BuckoSoft, Corp.
 7  
  * 
 8  
  * $Log$
 9  
  * Revision 1.8  2011/05/10 16:08:20  dick
 10  
  * Fix the javadoc pointers to the source code.
 11  
  *
 12  
  * Revision 1.7  2011/05/06 23:15:00  dick
 13  
  * Bump to version 0.7c
 14  
  *
 15  
  * Revision 1.6  2011/01/01 22:23:54  dick
 16  
  * Version 0.7
 17  
  *
 18  
  * Revision 1.5  2010/09/06 04:37:14  dick
 19  
  * Bump to Version 0.6.
 20  
  *
 21  
  * Revision 1.4  2010/09/05 04:08:08  dick
 22  
  * Version has to be a instantiated class.
 23  
  *
 24  
  * Revision 1.3  2010/03/03 13:12:21  inim
 25  
  * Replaced (c) sign in comment mangled by CVS default encoding back to UTF-8
 26  
  *
 27  
  * Revision 1.2  2010/03/03 12:19:49  inim
 28  
  * Moved source to UTF8 encoding from CP1252 encoding. To this end all source files' (c) message was updated to "Copyright© 2009,2010 - Dick Balaska - BuckoSoft, Corp.". This replaces the (c) sign to UTF8, and adds the new year 2010.
 29  
  *
 30  
  * Revision 1.1  2010/02/04 05:57:53  inim
 31  
  * Mavenized project folder layout
 32  
  *
 33  
  * Revision 1.7  2010/01/23 06:29:02  dick
 34  
  * Version 0.5
 35  
  *
 36  
  * Revision 1.6  2009/03/12 15:27:34  dick
 37  
  * Javadoc.
 38  
  *
 39  
  * Revision 1.5  2009/03/04 19:07:43  dick
 40  
  * Version 0.4a
 41  
  *
 42  
  * Revision 1.4  2009/02/27 06:00:07  dick
 43  
  * Version 0.3.
 44  
  *
 45  
  * Revision 1.3  2009/02/16 06:54:56  dick
 46  
  * Playing with version 0.3a.
 47  
  *
 48  
  * Revision 1.2  2009/02/14 12:20:17  dick
 49  
  * The next version will be 0.2
 50  
  *
 51  
  * Revision 1.1  2009/02/12 08:21:07  dick
 52  
  * Version 0.1
 53  
  */
 54  
 
 55  
 /* 
 56  
  * This program is free software: you can redistribute it and/or modify
 57  
  * it under the terms of the GNU General Public License as published by
 58  
  * the Free Software Foundation, either version 3 of the License, or
 59  
  * (at your option) any later version.
 60  
  *
 61  
  * This program is distributed in the hope that it will be useful,
 62  
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 63  
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 64  
  * GNU General Public License for more details.
 65  
  *
 66  
  * You should have received a copy of the GNU General Public License
 67  
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 68  
  *
 69  
  * The Original Code is BuckoFIBS, <http://www.buckosoft.com/BuckoFIBS/>.
 70  
  * The Initial Developer of the Original Code is Dick Balaska and BuckoSoft, Corp.
 71  
  * 
 72  
  */
 73  
 package com.buckosoft.fibs.BuckoFIBS;
 74  
 
 75  
 import java.io.IOException;
 76  
 import java.io.InputStream;
 77  
 import java.util.Properties;
 78  
 
 79  
 /** Handle versioning.
 80  
  * @author Dick Balaska
 81  
  * @since 2009/02/12
 82  
  * @version $Revision$ <br> $Date$
 83  
  * @see <a href="http://cvs.buckosoft.com/Projects/BuckoFIBS/BuckoFIBS/src/main/java/com/buckosoft/fibs/BuckoFIBS/Version.java">cvs Version.java</a>
 84  
  */
 85  
 public class Version {
 86  0
         private        static String version = null;
 87  
 
 88  0
         private Version(){}
 89  
         
 90  
         /** The string that is our version number
 91  
          * @parameter expression="${version}"
 92  
          */
 93  
 
 94  
 //        public String getVersion() {
 95  
 //                return(version);
 96  
 //        }
 97  
         /** Return the jIBS version, as determined by the maven build.
 98  
          * @return The version
 99  
          */
 100  
         public static String getVersion() {
 101  0
                 if (version == null) {
 102  0
                         InputStream is = ClassLoader.getSystemResourceAsStream("Version.properties");
 103  0
                         Properties props = new Properties();
 104  
                         try {
 105  0
                                 props.load(is);
 106  0
                         } catch (IOException e) {
 107  0
                                 e.printStackTrace();
 108  0
                         }
 109  0
                         version = props.getProperty("version");
 110  
                 }
 111  0
                 return(version);
 112  
         }
 113  
 }