fr.paris.lutece.plugins.form.utils
Class FileUtils

java.lang.Object
  extended by fr.paris.lutece.plugins.form.utils.FileUtils

public final class FileUtils
extends java.lang.Object

FileUtils


Method Summary
static java.lang.String buildFileName(java.lang.String strFileName, java.lang.String strFormatExtension)
          Build the file name
static void createFile(java.lang.String strFolderPath, java.lang.String strFileName, java.lang.String strFileOutPut, java.lang.String strEncoding)
          Create a file
static void deleteFile(java.lang.String strFolderPath, java.lang.String strFileName)
          Delete a file
static java.lang.String readLastLine(java.lang.String strFile)
          Read the last line from the given file
static void writeToFile(java.lang.String strContent, java.lang.String strFile)
          Write to the given file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createFile

public static void createFile(java.lang.String strFolderPath,
                              java.lang.String strFileName,
                              java.lang.String strFileOutPut,
                              java.lang.String strEncoding)
                       throws java.io.IOException
Create a file

Parameters:
strFolderPath - the folder path
strFileName - the file name
strFileOutPut - the file output
strEncoding - the encoding
Throws:
java.io.IOException - exception if there is an error during the deletion

deleteFile

public static void deleteFile(java.lang.String strFolderPath,
                              java.lang.String strFileName)
                       throws java.io.IOException
Delete a file

Parameters:
strFolderPath - the folder path
strFileName - the file name
Throws:
java.io.IOException - exception if there is an error during the deletion

buildFileName

public static java.lang.String buildFileName(java.lang.String strFileName,
                                             java.lang.String strFormatExtension)
Build the file name

Parameters:
form - the form
strFormatExtension - the format extension
Returns:
the file name

readLastLine

public static java.lang.String readLastLine(java.lang.String strFile)
Read the last line from the given file

Parameters:
strFile - the file absolute path (ex : /home/filetopath/file.txt)
Returns:
the last line, an empty string if the file does not exists

writeToFile

public static void writeToFile(java.lang.String strContent,
                               java.lang.String strFile)
Write to the given file

Parameters:
strContent - the content to write
strFile - the file


Copyright © 2012 Mairie de Paris. All Rights Reserved.