|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.taleo.integration.client.customstep.velocity.FileTool
com.taleo.integration.client.customstep.velocity.CsvImportFileTool
public class CsvImportFileTool
Class to expose a CSV import results file properties and content into Velocity templates.
Constructor Summary | |
---|---|
CsvImportFileTool(java.io.File file,
boolean headerPresent,
char csvDelimiter,
char csvQuoteCharacter,
java.lang.String encoding)
Constructor with the import results file, CSV header indicator, CSV delimiter, quotation character and encoding. |
|
CsvImportFileTool(java.io.File file,
boolean headerPresent,
char csvDelimiter,
char csvQuoteCharacter,
java.lang.String encoding,
java.io.File targetFile)
Constructor with the import results file, CSV header indicator, CSV delimiter, quotation character, encoding and the target file. |
Method Summary | |
---|---|
java.lang.String |
content()
Return the file content. |
int |
createCount()
Return the create count. |
int |
deleteCount()
Return the delete count. |
java.lang.String |
errorContent()
Return the error content. |
java.lang.String |
errorContent(java.lang.String excludePattern)
Return the error content, excluding the ones where the given regex pattern is found at least once. |
int |
errorCount()
Return the error count. |
int |
errorCount(java.lang.String excludePattern)
Return the error count, excluding the ones where the given regex pattern is found at least once. |
java.lang.String |
headerRow()
Return the CSV header row if present. |
java.util.Date |
lastModified()
Return the file last modified date. |
int |
lineCount()
Return the line count including the header row if present. |
java.lang.String |
name()
Return the file name including the extension. |
java.lang.String |
path()
Return the file absolute path. |
int |
recordCount()
Return the record count excluding the header row if present. |
long |
size()
Return the file size. |
int |
successCount()
Return the success count. |
int |
updateCount()
Return the update count. |
Methods inherited from class com.taleo.integration.client.customstep.velocity.FileTool |
---|
content, content, lastModified, lineCount, size |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CsvImportFileTool(java.io.File file, boolean headerPresent, char csvDelimiter, char csvQuoteCharacter, java.lang.String encoding)
file
- The export file.headerPresent
- Indicates if the CSV header is present in the file.csvDelimiter
- The CSV delimiter.csvQuoteCharacter
- The CSV quote character.encoding
- The encoding.public CsvImportFileTool(java.io.File file, boolean headerPresent, char csvDelimiter, char csvQuoteCharacter, java.lang.String encoding, java.io.File targetFile)
If specified, the targetFile is used to provide the file name and path in place of the file itself which is used for the contents. This is useful when the tool is used in the process of writing the target file and the name/path must be written within.
file
- The export file.headerPresent
- Indicates if the CSV header is present in the file.csvDelimiter
- The CSV delimiter.csvQuoteCharacter
- The CSV quote character.encoding
- The encoding.targetFile
- The target file.Method Detail |
---|
public java.lang.String name()
public java.lang.String path()
public java.util.Date lastModified()
public long size()
public java.lang.String content() throws java.io.IOException
java.io.IOException
public int lineCount() throws java.io.IOException
java.io.IOException
InvalidCSVFileFormat
public int recordCount() throws java.io.IOException
java.io.IOException
InvalidCSVFileFormat
public int successCount() throws java.io.IOException
java.io.IOException
public int createCount() throws java.io.IOException
java.io.IOException
public int updateCount() throws java.io.IOException
java.io.IOException
public int deleteCount() throws java.io.IOException
java.io.IOException
public java.lang.String headerRow()
public int errorCount() throws java.io.IOException
java.io.IOException
public int errorCount(java.lang.String excludePattern) throws java.io.IOException
Please make sure to follow regex syntax, taking into consideration that some characters may need to be escaped. Also, multiple exclusions can be separated with the | character meaning OR in regex.
excludePattern
- The regex exclude pattern.
java.io.IOException
Pattern
public java.lang.String errorContent() throws java.io.IOException
java.io.IOException
public java.lang.String errorContent(java.lang.String excludePattern) throws java.io.IOException
Please make sure to follow regex syntax, taking into consideration that some characters may need to be escaped. Also, multiple exclusions can be separated with the | character meaning OR in regex.
excludePattern
- The regex exclude pattern.
java.io.IOException
Pattern
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |