org.bibalex.daf.installer
Class FileHandler

java.lang.Object
  extended by org.bibalex.daf.installer.FileHandler

public class FileHandler
extends java.lang.Object

Copyright (c) 2006-2007 by Bibliotheca Alexandrina This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Author:
mohammed.abuouda

Field Summary
private static java.io.FileWriter fstream
           
(package private) static java.lang.String logFile
           
private static java.io.BufferedWriter out
           
 
Constructor Summary
FileHandler()
           
 
Method Summary
static boolean deleteFile(java.lang.String parentPath, java.lang.String fileName)
           
static void logErro(java.lang.String error, boolean close)
           
private static byte[] ReadFile(java.lang.String strFile)
           
static boolean replace(java.lang.String fileParent, java.lang.String fileName, java.lang.String findString, java.lang.String replaceString)
           
static boolean runScript(java.lang.String fileParent, java.lang.String fileName, java.lang.String findString, DBConnection mysqlConn)
           
private static void WriteFile(java.lang.String strFile, byte[] pData)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logFile

static final java.lang.String logFile
See Also:
Constant Field Values

fstream

private static java.io.FileWriter fstream

out

private static java.io.BufferedWriter out
Constructor Detail

FileHandler

public FileHandler()
Method Detail

replace

public static boolean replace(java.lang.String fileParent,
                              java.lang.String fileName,
                              java.lang.String findString,
                              java.lang.String replaceString)

ReadFile

private static final byte[] ReadFile(java.lang.String strFile)
                              throws java.io.IOException
Throws:
java.io.IOException

WriteFile

private static final void WriteFile(java.lang.String strFile,
                                    byte[] pData)
                             throws java.io.IOException
Throws:
java.io.IOException

runScript

public static boolean runScript(java.lang.String fileParent,
                                java.lang.String fileName,
                                java.lang.String findString,
                                DBConnection mysqlConn)

deleteFile

public static boolean deleteFile(java.lang.String parentPath,
                                 java.lang.String fileName)

logErro

public static void logErro(java.lang.String error,
                           boolean close)