webMethods

 View Only
Expand all | Collapse all

Deleting subfolders in webmethods MFT

  • 1.  Deleting subfolders in webmethods MFT

    Posted Mon May 20, 2024 10:34 AM

    Hi All,

    I have a subfolder containing *.tab files and wanted to delete the entire folder along with files which delete action in file operations is not supporting. Is there any way to delete subfolders in webMethods mft instead of doing it manually.


    #Service-Designer
    #Managed-File-Transfer
    #webMethods-io-B2B
    #webMethods-io-Integration
    #Integration-Server-and-ESB
    #B2B-Integration
    #webMethods
    #webMethods-cloud


  • 2.  RE: Deleting subfolders in webmethods MFT

    Posted Tue May 21, 2024 04:41 AM

    Hi Deepalakshmi,

    you can try to get the list of the content of the folder and delete it in a loop.
    After that, when the folder is empty, you can delete the folder itself.
    Do so recursively beginning with the subfolder, which do not have further subfolders.

    Outline:

    - List content of the current folder
    - Loop over list
    -- Is folder?
    --- Yes: Invoke this service for the subfolder
    --- No: Delete file
    - Delete folder (should now be empty)
    

    You can check the size (=length of the content list) before the loop and just loop over it, when the it is >0.
    When it is 0 you can delete the empty folder directly.

    Regards,
    Holger


    #webMethods-io-Integration
    #Service-Designer
    #webMethods
    #webMethods-io-B2B
    #Integration-Server-and-ESB
    #B2B-Integration
    #Managed-File-Transfer
    #webMethods-cloud


  • 3.  RE: Deleting subfolders in webmethods MFT

    Posted Wed May 22, 2024 09:19 AM

    Hello Holger,

    Thanks for responding back. Adding few more points to the thread,

    Zipped folders contain tab files. I am unzipping the zipped file contents in scheduled event, renaming and moving only the tab file to target. After the tab files are moved to destination, is there any ways to delete these folders which remains empty and undeleted in our local file path



    #webMethods-io-Integration
    #Integration-Server-and-ESB
    #webMethods-io-B2B
    #Service-Designer
    #B2B-Integration
    #Managed-File-Transfer
    #webMethods
    #webMethods-cloud