lib.jGroupware.utils
Class TextFile

java.lang.Object
  extended bylib.jGroupware.utils.TextFile

public class TextFile
extends java.lang.Object

Class to handle all jGroupware library text-file work

Author:
Gareth Webber

Constructor Summary
TextFile()
          Constructor for the TextFile object
 
Method Summary
 java.util.ArrayList matchInString(java.lang.String pattern, java.lang.String source)
          Searchs a string for results based on a regular expression Will match patten exactly once but return a array of matched terms
 java.util.ArrayList matchMultipleInString(java.lang.String pattern, java.lang.String source)
          Searchs a string for results based on a regular expression Will match patten exactly many times and will return one matched item per RegEx
 java.lang.String removeCarriageReturns(java.lang.String source)
          Removes carriage returns from a string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextFile

public TextFile()
Constructor for the TextFile object

Method Detail

matchInString

public java.util.ArrayList matchInString(java.lang.String pattern,
                                         java.lang.String source)
                                  throws NoResultsFromSearchException
Searchs a string for results based on a regular expression Will match patten exactly once but return a array of matched terms

Parameters:
pattern - String containing RegEx
source - String to search
Returns:
Array of string results
Throws:
NoResultsFromSearchException - Thown if an invalid RegEx is used or no resuls found

matchMultipleInString

public java.util.ArrayList matchMultipleInString(java.lang.String pattern,
                                                 java.lang.String source)
                                          throws NoResultsFromSearchException
Searchs a string for results based on a regular expression Will match patten exactly many times and will return one matched item per RegEx

Parameters:
pattern - String containing RegEx
source - String to search
Returns:
Array of string results
Throws:
NoResultsFromSearchException - Thown if an invalid RegEx is used or no resuls found

removeCarriageReturns

public java.lang.String removeCarriageReturns(java.lang.String source)
                                       throws NoResultsFromSearchException
Removes carriage returns from a string

Parameters:
source - Source string
Returns:
String with carriage returns removed.
Throws:
NoResultsFromSearchException - Description of the Exception