This discussion is archived
1 Reply Latest reply: Nov 6, 2012 5:45 AM by gimbal2 RSS

Need info regarding DeliveryRequest class.

945243 Newbie
Currently Being Moderated
Hi,

In my program I have used DeliveryManager and DeliveryRequest class to upload a file in server by SFTP.
My query is , will file get append to the server or it will replace the file in server.
see below for my code.

//create DeliveryManager instance for FTP
DeliveryManager dm = new DeliveryManager();
log.writeln("create delivery manager instance",1);
DeliveryRequest req = dm.createRequest(DeliveryManager.TYPE_SFTP);
log.writeln("create request",1);
req.addProperty(DeliveryPropertyDefinitions.SFTP_AUTH_TYPE,
DeliveryPropertyDefinitions.SFTP_AUTH_TYPE_PASSWORD);
req.addProperty(DeliveryPropertyDefinitions.SFTP_HOST,HostName);
req.addProperty(DeliveryPropertyDefinitions.SFTP_USERNAME,UserName);
req.addProperty(DeliveryPropertyDefinitions.SFTP_PASSWORD,Password);
req.addProperty(DeliveryPropertyDefinitions.SFTP_REMOTE_DIRECTORY,OutputDirectory);
req.addProperty(DeliveryPropertyDefinitions.SFTP_REMOTE_FILENAME,FileName);
req.setDocument(InputDirectory+FileName);
log.writeln("Submited The FTP request For FileName:"+FileName+" HostName:"+HostName+" ........",1);
DeliveryResponse dr=req.submit(); //File transfer FTP request
req.close();
log.writeln("Successfully FTPed..",1);

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points