planetj.helpers
Class FileHelper

java.lang.Object
  |
  +--planetj.helpers.FileHelper
Direct Known Subclasses:
CSVHelper, DOCHelper, FDFHelper, IIFHelper, MSAccessHelper, PDFHelper, QIFHelper, XMLHelper

public abstract class FileHelper
extends Object

Abstract class containing common functionality and providing required methods to subclasses. Creation date: (12/4/2001 10:45:23 PM)


Constructor Summary
FileHelper()
           
 
Method Summary
static com.ibm.as400.access.AS400 getAS400(FileDescriptor pFileDescriptor)
          Lazy Inits the AS400 object.
 char getFileSeparator()
          Returns the correct file.separator for this platform.
static FileDescriptor newFileDescriptor()
          This is the only way to get an instance of a new FileDescriptor Creation date: (1/21/2002 7:32:32 PM)
static FileDescriptor newFileDescriptor(FilePropertyGroup pProperties)
          This is the only way to get an instance of a new FileDescriptor Creation date: (1/21/2002 7:32:32 PM)
 String validateFileName(String pFileName)
          Validates a file name and throws a CMException if the name is invalid Creation date: (12/4/2001 11:05:18 PM)
 StringBuffer writeData(StringBuffer pData, FileDescriptor pFileDescriptor)
          This method will write the StringBuffer pData data to a file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileHelper

public FileHelper()
Method Detail

getAS400

public static com.ibm.as400.access.AS400 getAS400(FileDescriptor pFileDescriptor)
Lazy Inits the AS400 object. I think this can be done statically, unless we are trying write files to multiple system. Creation date: (4/23/2002 10:04:58 AM)


getFileSeparator

public char getFileSeparator()
Returns the correct file.separator for this platform. The file.separator while running on a windows platform is a backslash (\). The file.separator while running on an AS/400 platform is a forwardslash (/). Creation date: (4/19/2002 4:04:03 PM)

Returns:
char

newFileDescriptor

public static FileDescriptor newFileDescriptor()
This is the only way to get an instance of a new FileDescriptor Creation date: (1/21/2002 7:32:32 PM)

Returns:
new FileDescriptor()

newFileDescriptor

public static FileDescriptor newFileDescriptor(FilePropertyGroup pProperties)
This is the only way to get an instance of a new FileDescriptor Creation date: (1/21/2002 7:32:32 PM)

Returns:
new FileDescriptor()

validateFileName

public String validateFileName(String pFileName)
                        throws CMException
Validates a file name and throws a CMException if the name is invalid Creation date: (12/4/2001 11:05:18 PM)

CMException

writeData

public StringBuffer writeData(StringBuffer pData,
                              FileDescriptor pFileDescriptor)
                       throws CMException
This method will write the StringBuffer pData data to a file. If FileDescriptor.isAppendToFile then the file will be appended to, else a fresh file will be created.

Validation of the file name and data will also be check here and a CMException will be thrown if problems exist. Creation date: (1/21/2002 7:09:16 PM)

CMException