andyLib v0.9.1

it.andynaz.utils
Class UtilsProgram

java.lang.Object
  extended by it.andynaz.utils.UtilsProgram

public class UtilsProgram
extends Object

Useful method to manage a program that uses the andyLib project.

Version:
2013/12/18
Author:
andynaz

Field Summary
private static Properties versionData
          Keeps informations about the program versions.
 
Constructor Summary
private UtilsProgram()
           
 
Method Summary
static String getBuildDate()
          Returns the build date of the project.
static String getVersion()
          Returns the version of the project.
private static void loadVersionData()
          Reads the version data from the file.
static void printHeader()
          Print a program header.
static void printHelp()
          Print a program help.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

versionData

private static Properties versionData
Keeps informations about the program versions.

Constructor Detail

UtilsProgram

private UtilsProgram()
Method Detail

printHeader

public static void printHeader()
Print a program header. The header is read from a header.txt file in the package it/andynaz/resources (it has to be stored somewhere in the classpath).

To be printed "well" on most terminal, each line should have a maximum length of 80 characters.


printHelp

public static void printHelp()
                      throws Exception
Print a program help. The header is read from a help.txt file in the package it/andynaz/resources (it has to be stored somewhere in the classpath).

To be printed "well" on most terminal, each line should have a maximum length of 80 characters.

Throws:
Exception

loadVersionData

private static void loadVersionData()
                             throws IOException
Reads the version data from the file. The version data are loaded in an inner properties object; the loading is done only once on the first call of either getVersion or getBuildDate.

Throws:
IOException - if the version data could not be read

getVersion

public static String getVersion()
                         throws IOException
Returns the version of the project.

Returns:
the version of the project
Throws:
IOException - if the version data could not be read

getBuildDate

public static String getBuildDate()
                           throws IOException
Returns the build date of the project.

Returns:
the build date of the project
Throws:
IOException - if the version data could not be read

andyLib v0.9.1

© 2013 andynaz - http://andynaz.altervista.org