cometa.execute
Class ExecuteCombinationProcedure

java.lang.Object
  extended by cometa.execute.ExecuteCombinationProcedure

public class ExecuteCombinationProcedure
extends java.lang.Object

This class executes a combination procedure file, generated by the metadata combination phase.


Constructor Summary
ExecuteCombinationProcedure(java.lang.String combinationProcedure, boolean showReview)
          This method shows the procedure review window.
 
Method Summary
static java.io.File appendToFile(java.lang.String filename, java.lang.String content)
          This method appends a String to an existing file.
 void combineData()
          Given the procedure file, this method go through all the
 java.lang.String convertEntities(java.lang.String input)
          It convert the html entities (used to stored special characters in the XML database) to normal characters.
 java.lang.String executeCommand(java.lang.String command)
          This method is used to run a shell command in a UNIX environment.
 java.lang.String reverseString(java.lang.String inputString)
          This method reverses a given input string.
static java.io.File writeToFile(java.lang.String filename, java.lang.String content)
          This method writes a String to a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExecuteCombinationProcedure

public ExecuteCombinationProcedure(java.lang.String combinationProcedure,
                                   boolean showReview)
This method shows the procedure review window.

Parameters:
combinationProcedure - The string representing the path to the combination procedure file.
showReview -
True
if the combination procedure has to be displayed for editing before the execution. If
false
, the procedure is executed without review.
Method Detail

executeCommand

public java.lang.String executeCommand(java.lang.String command)
                                throws java.io.IOException
This method is used to run a shell command in a UNIX environment.

Parameters:
command - The command to execute.
Returns:
The output of the command.
Throws:
java.io.IOException - Throws an exception if something went wrong (usually, if the UNIX program could not be executed).

convertEntities

public java.lang.String convertEntities(java.lang.String input)
It convert the html entities (used to stored special characters in the XML database) to normal characters.

Parameters:
input - A string.
Returns:
The input string, where the entities have been substituted by the corresponding characters.

reverseString

public java.lang.String reverseString(java.lang.String inputString)
This method reverses a given input string.

Parameters:
inputString - The string to be reversed.
Returns:
A new string, that is the input string in the reverse order.

combineData

public void combineData()
Given the procedure file, this method go through all the
exec
tags and it executes the corresponding UNIX commands.


writeToFile

public static java.io.File writeToFile(java.lang.String filename,
                                       java.lang.String content)
This method writes a String to a file.

Parameters:
filename - The path and filename where the file has to be written.
content - The content to be written to the file.
Returns:
It returns the
File
corresponding to the created file, or
null
if something went wrong.

appendToFile

public static java.io.File appendToFile(java.lang.String filename,
                                        java.lang.String content)
This method appends a String to an existing file.

Parameters:
filename - The name of the file to which the content has to be appended.
content - The content to be appended to the file.
Returns:
It returns the
File
to which the content has been appended, or
null
if something went wrong.