com.taleo.integration.client.customstep.velocity
Class FileTool

java.lang.Object
  extended by com.taleo.integration.client.customstep.velocity.FileTool
Direct Known Subclasses:
CsvExportFileTool, CsvImportFileTool, XmlExportFileTool

public class FileTool
extends java.lang.Object

Class to expose file properties and content into Velocity templates.

Author:
Romain Guay - Taleo Corporation

Constructor Summary
FileTool()
           
 
Method Summary
 java.lang.String content(java.lang.String filename)
          Return the file content.
 java.lang.String content(java.lang.String filename, java.lang.String encoding)
          Return the file content.
 java.util.Date lastModified(java.lang.String filename)
          Return the file last modified date.
 int lineCount(java.lang.String filename)
          Return the line count.
 long size(java.lang.String filename)
          Return the file size.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileTool

public FileTool()
Method Detail

lastModified

public java.util.Date lastModified(java.lang.String filename)
Return the file last modified date.

Parameters:
filename - The filename.
Returns:
The file last modified date.

size

public long size(java.lang.String filename)
Return the file size.

Parameters:
filename - The filename.
Returns:
The file size in bytes.

content

public java.lang.String content(java.lang.String filename)
                         throws java.io.IOException
Return the file content.

Parameters:
filename - The filename.
Returns:
The file content.
Throws:
java.io.IOException

content

public java.lang.String content(java.lang.String filename,
                                java.lang.String encoding)
                         throws java.io.IOException
Return the file content.

Parameters:
filename - The filename.
encoding - The encoding of the file.
Returns:
Throws:
java.io.IOException

lineCount

public int lineCount(java.lang.String filename)
              throws java.io.IOException
Return the line count.

Parameters:
filename - The filename.
Returns:
The line count.
Throws:
java.io.IOException