Move a file from one folder to another folder

Dear All.,
can anyone knows how to read a file from a perticular folder in Unix system. Folder

name is hard-coded but not file name. once we read it from that folder we have to delete

that File in that folder and we have to store the content of the file in Data Base (Oracle)

and this file has to be moved to another folder.
can anyone give technically steps to write a flow service for this.
thanks&Regard’s
kartheek

Madhav,

If you are using IS6.0 and above versions then try this scenario,

Configure a filepolling port that will poll the specified folder and it will grab those files and process it to a FlowService as a InputStream object (ffdata)and flow service logic will be
ffdata(serviceinput)
streamTobytes
bytesToString (file content)and then persist the content in the DB as per your requrirement.

So once this process successfully completes then the filepolling port can move this file to another folder that you have mentioned in the Archive folder (filepolling port settings).

If the flowservice done with errors then the file will be moved to Error directory that you have mentioned in the Error folder (filepolling port settings)

If IS4.6 then write javaservices to readFile that does polling files,moveFile or use PSUtilities package services that will provide the listofFiles in the specified folder and using pub.file:getFile service read the files onebyone and persist the content in DB and use moveFile javaservice that moves to another folder.

HTH,

hi rmg.,
Thank u .im using IS6.0 and almost i done in the same way. in a flowservice i called a Java Service which does the file transmission and passes the required Data to Pipe.
Regard’s
Kartheek

hi friends, i was going through he above post as my requirement is also same where i have to move a file from one folder on harddisk to another.

i read about this moveFile java service but am not bale to find it , i am using wM6.5 , so is this a ready made Java Service provided by wM or is this some one we have to code .
thanks

Basically moveFile is not a standard builtin service,get the PSUtilities package from Advantage.webmethods.com,these packages/services created by WM professional services which helps users in the webMethods community.

Get this package and either copy the service to your local folder or invoke from the same package and make sure you deploy the same package to diff environments if your company agrees.

HTH,
RMG

Hi all,

I just tried one service.
This is very simple.

  1. Get the list of all the file names
  2. Loop over the filenames
  3. Concat the filepath and the file name
  4. Give this concatenated path to move file.

Meanwhile these services have been made available in WmPublic.
Remember to configure fileAccessControl.cnf in WmPublic/config accordingly and reload WmPublic afterwards.