org.opensync.engine.util
Class FileHelper

java.lang.Object
  extended byorg.opensync.engine.util.FileHelper
All Implemented Interfaces:
java.io.Serializable

public class FileHelper
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Field Summary
(package private)  java.io.LineNumberReader bufferedReader
           
(package private)  int currentLineNumber
           
(package private)  boolean endOfFileReader
           
(package private)  java.io.FileReader fileReader
           
(package private)  boolean startOfFileWriter
           
(package private)  boolean startRead
           
 
Constructor Summary
FileHelper()
          Contruct a FileHelper, not needed, use static methods instead
 
Method Summary
 void clean()
           
static java.lang.String fileToString(java.lang.String path)
          Return the content of the file path as a String
 java.lang.String fileToString(java.lang.String path, long numberOfLines)
           
 void setStarting(boolean flag)
           
 void stringAppendToFile(java.lang.String str, java.lang.String path)
           
static void stringToFile(java.lang.String str, java.lang.String path)
          Write the String str in the file path
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentLineNumber

int currentLineNumber

endOfFileReader

boolean endOfFileReader

startRead

boolean startRead

startOfFileWriter

boolean startOfFileWriter

bufferedReader

java.io.LineNumberReader bufferedReader

fileReader

java.io.FileReader fileReader
Constructor Detail

FileHelper

public FileHelper()
Contruct a FileHelper, not needed, use static methods instead

Method Detail

clean

public void clean()

setStarting

public void setStarting(boolean flag)

fileToString

public static java.lang.String fileToString(java.lang.String path)
                                     throws java.io.IOException
Return the content of the file path as a String

Parameters:
path - the absolute path of the file
Throws:
java.io.IOException

fileToString

public java.lang.String fileToString(java.lang.String path,
                                     long numberOfLines)
                              throws java.io.IOException,
                                     OpenSyncException
Throws:
java.io.IOException
OpenSyncException

stringToFile

public static void stringToFile(java.lang.String str,
                                java.lang.String path)
                         throws java.io.IOException
Write the String str in the file path

Parameters:
str - the String to write
path - path the absolute path of the file
Throws:
java.io.IOException

stringAppendToFile

public void stringAppendToFile(java.lang.String str,
                               java.lang.String path)
                        throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2004 sourceforge. All Rights Reserved.