uk.org.ogsadai.client.toolkit.activity.files
Class FileInsert

java.lang.Object
  |
  +--uk.org.ogsadai.client.toolkit.activity.RequestComponent
        |
        +--uk.org.ogsadai.client.toolkit.activity.Activity
              |
              +--uk.org.ogsadai.client.toolkit.activity.files.FileWriting
                    |
                    +--uk.org.ogsadai.client.toolkit.activity.files.FileInsert

public class FileInsert
extends FileWriting

A file writing activity which inserts text to the a particular offset of the entire file or of each line.

A FileInsert activity is semantically equivalent to a FileReplace activity with a length of zero.

If the constructor with a text parameter is not used, it is expected that the setInput method will be called in order to register that the input will be taken from another activity's output. If the constructor with a text parameter is used, any input registered via setInput is ignored.

Author:
The OGSA-DAI Project Team

Field Summary
 
Fields inherited from class uk.org.ogsadai.client.toolkit.activity.files.FileWriting
APPEND, BOF, DELETE, EOF, INSERT, mAction, mFilename, mLength, mMatch, mOffset, mPerLine, mRegexp, mText, NONE_SPECIFIED, PER_FILE, PER_LINE, REPLACE, TO_EOF
 
Constructor Summary
FileInsert(java.lang.String filename, int offset, boolean perLine)
          Insert text obtaine from another activity into a specific position within an entire file or within each line of a file.
FileInsert(java.lang.String filename, int offset, boolean perLine, java.lang.String text)
          Insert particular text into a specific position within an entire file or within each line of a file.
 
Methods inherited from class uk.org.ogsadai.client.toolkit.activity.files.FileWriting
actionToString, generateXML, getFilename, getLength, getMatch, getOffset, getRegexp, getText, isPerLine, lengthToString, offsetToString, setFilename, setInput, setLength, setMatch, setOffset, setPerLine, setRegexp, setText, validateParams
 
Methods inherited from class uk.org.ogsadai.client.toolkit.activity.Activity
addInput, addOutput, addOutputs, getDataResourceID, getDataServiceStub, getInputParameters, getOutputParameters, getOutputs, replaceSpecialCharacters, setDataResourceID, setDataServiceStub, setInput
 
Methods inherited from class uk.org.ogsadai.client.toolkit.activity.RequestComponent
getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileInsert

public FileInsert(java.lang.String filename,
                  int offset,
                  boolean perLine,
                  java.lang.String text)
Insert particular text into a specific position within an entire file or within each line of a file.

Parameters:
filename - the file to insert text into
offset - the non-negative offset of start of the range of bytes, or FileWriting.BOF, or FileWriting.EOF
perLine - true treats the offset as an offset from the start of the line;
false treats the offset as an offset from the start of the file
text - the text to insert
Throws:
java.lang.IllegalArgumentException - if the filename is null or the offset is outside its valid bounds

FileInsert

public FileInsert(java.lang.String filename,
                  int offset,
                  boolean perLine)
Insert text obtaine from another activity into a specific position within an entire file or within each line of a file.

Parameters:
filename - the file to insert text into
offset - the non-negative offset of start of the range of bytes, or FileWriting.BOF, or FileWriting.EOF
perLine - true treats the offset as an offset from the start of the line;
false treats the offset as an offset from the start of the file
Throws:
java.lang.IllegalArgumentException - if the filename is null or the offset is outside its valid bounds