Anyone assist me how to write a java services to transfer a file from one location to another…FTP or normal…I tried the below code…
// pipeline
IDataCursor pipelineCursor = pipeline.getCursor();
String sFile = IDataUtil.getString( pipelineCursor, “SourceFile” );
String dFile = IDataUtil.getString( pipelineCursor, “DestinationFile” );
pipelineCursor.destroy();
try
{
FileReader fin = new FileReader(sFile);
FileWriter fout=new FileWriter(dFile,true);
int c;
while((c=fin.read()) != -1)
{
fout.write(c);
}
System.out.println(“File Copied…”);
fin.close();
fout.close();
}
catch(FileNotFoundException fnf)
{
System.out.println(“File not found”);
}
IDataCursor pipelineCursor_1 = pipeline.getCursor();
IDataUtil.put(pipelineCursor_1, “msg”, “Welcome” );
pipelineCursor_1.destroy();
It shows unreported exception error…