Thanks Dan,
No luck. I tried Using the one in Toolbox i get the same result IO Exception. I am attaching that code here. To handle this as a short term solution we delete all the files in the directory using a java service and schedule it for once in a week.
This is the code from ToolBox.
//Input Cursor
IDataHashCursor pipelineCursor = pipeline.getHashCursor();
//Declare Input and Output Variables
String executionParams = null;
String stdout = " ", exitValue = " ", stderr = " ";
Object executionException = new Object();
if ( pipelineCursor.first ( “executionParams” ) )
{
executionParams = (String)pipelineCursor.getValue();
}
//Try to execute the shell command
try
{
Process p;
//Execute the command
p = Runtime.getRuntime().exec(executionParams);
p.waitFor();
//Get exitValue
int exitvalue = p.exitValue();
exitValue = Integer.toString(exitvalue);
//Get the stdout and error streams of the process object
//Note: The input stream obtains data piped from the standard output stream
//of the process it represents.
InputStream inputStream = p.getInputStream();
InputStream errorStream = p.getErrorStream();
//Get stderr
BufferedReader errbfr = new BufferedReader( new InputStreamReader ( errorStream ) );
StringBuffer errstrbfr = new StringBuffer();
int b;
while ( ( b = (int) errbfr.read()) != -1 )
{
char c = (char) b;
errstrbfr.append(c);
}
stderr = errstrbfr.toString();
//Get stdout
BufferedReader outbfr = new BufferedReader ( new InputStreamReader (inputStream) );
StringBuffer outstrbfr = new StringBuffer();
int d;
while ( (d = (int) outbfr.read()) != -1)
{
char e = (char) d;
outstrbfr.append(e);
}
stdout = outstrbfr.toString();
}
catch (Exception e)
{
IDataHashCursor pipelineCursor_1 = pipeline.getHashCursor();
pipelineCursor_1.last();
pipelineCursor_1.insertAfter( “executionException”, e);
pipelineCursor_1.destroy();
}
IDataHashCursor pipelineCursor_1 = pipeline.getHashCursor();
pipelineCursor_1.last();
pipelineCursor_1.insertAfter ( “stdout”, stdout );
pipelineCursor_1.insertAfter ( “stderr”, stderr );
pipelineCursor_1.insertAfter ( “exitValue”, exitValue );
pipelineCursor_1.destroy();