net.sweetohm.ant.xml
Class SplitTask

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by net.sweetohm.ant.util.FileTask
              extended by net.sweetohm.ant.xml.SplitTask
All Implemented Interfaces:
java.lang.Cloneable

public class SplitTask
extends FileTask

Split a file using dedicated processing instructions.

Version:
1.0
Author:
Michel CASABIANCA

Field Summary
(package private)  java.util.Vector files
          The list of files to process
(package private)  java.lang.String pattern
          Processing instruction to search
(package private)  java.lang.String pi
          Processing instruction to search for
(package private)  boolean verbose
          Verbosity flag
 
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
 
Constructor Summary
SplitTask()
          Empty constructor (needed for reflexion).
 
Method Summary
(package private)  void cutFile(java.lang.String string, java.io.File file)
          Cut a file into parts delimited with the PI
 void execute()
          The method to launch the program as an Ant task.
(package private)  void processFile(java.io.File file)
          Process a single file
 void setPattern(java.lang.String pattern)
          Pattern setter.
 
Methods inherited from class net.sweetohm.ant.util.FileTask
addFileset, getFiles, setDir, setFile
 
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pattern

java.lang.String pattern
Processing instruction to search


pi

java.lang.String pi
Processing instruction to search for


verbose

boolean verbose
Verbosity flag


files

java.util.Vector files
The list of files to process

Constructor Detail

SplitTask

public SplitTask()
Empty constructor (needed for reflexion).

Method Detail

setPattern

public void setPattern(java.lang.String pattern)
Pattern setter.

Parameters:
pattern - The pattern to search.

execute

public void execute()
The method to launch the program as an Ant task.

Overrides:
execute in class org.apache.tools.ant.Task

processFile

void processFile(java.io.File file)
           throws java.io.IOException
Process a single file

Parameters:
file - The file to process
Throws:
java.io.IOException

cutFile

void cutFile(java.lang.String string,
             java.io.File file)
       throws java.io.IOException
Cut a file into parts delimited with the PI

Parameters:
string - The content of the file
file - The file to cut
Throws:
java.io.IOException