Krishnan,
The only I have done is using Java services. I am attaching the code for copyFile and you can write the move and delete based on that.
Thanks
Chris
IDataCursor idcPipeline = pipeline.getCursor();
String strFilename = “”;
String strSourceDirectory = null;
String strTargetDirectory = null;
if (idcPipeline.first(“filename”))
{
strFilename = (String)idcPipeline.getValue();
}
else
{
throw new ServiceException(“Copy Failed: Filename is null!”);
}
if (idcPipeline.first(“sourceDirectory”))
{
strSourceDirectory = (String)idcPipeline.getValue();
}
if (idcPipeline.first(“targetDirectory”))
{
strTargetDirectory = (String)idcPipeline.getValue();
}
if (strSourceDirectory != strTargetDirectory)
{
FileReader frSourceFile = null;
FileWriter fwTargetFile = null;
File sourceFile = null;
File targetFile = null;
try
{
sourceFile = new File(strSourceDirectory, strFilename);
targetFile = new File(strTargetDirectory, strFilename);
if (!sourceFile.exists() || sourceFile.isDirectory())
{
throw new ServiceException("MOVE ERROR: Source file not found (" + sourceFile.getAbsolutePath() + ")");
}
frSourceFile = new FileReader(sourceFile);
fwTargetFile = new FileWriter(targetFile);
int c;
while ((c = frSourceFile.read()) != -1)
{
fwTargetFile.write(c);
}
idcPipeline.insertAfter(“message”, "Copied: " + sourceFile.getAbsolutePath() + " to " + strTargetDirectory);
}
catch (Exception e)
{
throw new ServiceException(e.getMessage());
}
finally
{
try
{
frSourceFile.close();
fwTargetFile.close();
}
catch (Exception e)
{
}
sourceFile = null;
targetFile = null;
}
}
idcPipeline.destroy();
#Flow-and-Java-services#webMethods#Integration-Server-and-ESB