fr.paris.lutece.maven.utils.file
Class LuteceFileUtils

java.lang.Object
  extended by fr.paris.lutece.maven.utils.file.LuteceFileUtils

public final class LuteceFileUtils
extends java.lang.Object

FileUtils


Method Summary
static void createFile(java.lang.String strFolderPath, java.lang.String strFileName, java.lang.String strFileOutPut)
          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)
                       throws java.io.IOException
Create a file.

Parameters:
strFolderPath - the folder path
strFileName - the file name
strFileOutPut - the file output
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

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 © 2006-2013 Mairie de Paris. All Rights Reserved.