org.am.snitch.utilities
Class Utilities

java.lang.Object
  extended by org.am.snitch.utilities.Utilities

public final class Utilities
extends Object

Utilities class serving all other classes.

Version:
1.0
Author:
Axel Maroudas

Method Summary
static void centralize(JDialog myDialog)
          Centralize a JDialog in the user screen.
static void createPropertiesFileStructure()
          Create the necessary file structure that will hold the applications config files.
static String formatDate(Date date, String outFormat)
          Format a Date.
static String formatDate(String dateStr, String informat, String outFormat)
          Format a String representation of a Date.
static List<String> getComboBoxData(JComboBox jComboBox)
          Retrieve a Vector of Strings from a JComboBox data.
static String getDayFromDate(Date date)
          Retrieve the Date name from a date.
static String[] loadExistingCVSRoots()
          Read to an array the CVS Roots.
static Properties parseCVSRoot(String cvsroot)
          Creates Properties representing the CVS Root.
static List<String> readFileLines(String filename)
          Read the contents of a file into a Vector of Strings.
static void writeFile(String file, List<String> fileLines)
          Write tho the file system a configuration file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

parseCVSRoot

public static Properties parseCVSRoot(String cvsroot)
Creates Properties representing the CVS Root.

Parameters:
cvsroot - The String representation of a CVS Root
Returns:
The cvs properties

centralize

public static void centralize(JDialog myDialog)
Centralize a JDialog in the user screen.

Parameters:
myDialog - The component to be centralized

formatDate

public static String formatDate(String dateStr,
                                String informat,
                                String outFormat)
Format a String representation of a Date.

Parameters:
dateStr - The String representation of the Date to be formated
informat - The input format with which the date came
outFormat - The format to which the input date should be formated
Returns:
The formated input date

formatDate

public static String formatDate(Date date,
                                String outFormat)
Format a Date.

Parameters:
date - The Date to be formated
outFormat - The format to which the input date should be formated
Returns:
The formated input date

readFileLines

public static List<String> readFileLines(String filename)
Read the contents of a file into a Vector of Strings.

Parameters:
filename - The complete filename of the file to be read
Returns:
A List of Strings holding the lines of the input file

createPropertiesFileStructure

public static void createPropertiesFileStructure()
Create the necessary file structure that will hold the applications config files.


writeFile

public static void writeFile(String file,
                             List<String> fileLines)
Write tho the file system a configuration file.

Parameters:
file - The complete filename of the file to be read
fileLines - The lines of the file to be written

getComboBoxData

public static List<String> getComboBoxData(JComboBox jComboBox)
Retrieve a Vector of Strings from a JComboBox data.

Parameters:
jComboBox - The component from which data will be read
Returns:
The Vector of Strings from the input component

loadExistingCVSRoots

public static String[] loadExistingCVSRoots()
Read to an array the CVS Roots.

Returns:
The CVS Roots of the configuration file

getDayFromDate

public static String getDayFromDate(Date date)
Retrieve the Date name from a date.

Parameters:
date - The date
Returns:
The date name


Copyright © 2008 Axel Maroudas All Rights Reserved.