IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#TechXchangePresenter
 View Only
  • 1.  Read and Create Subdirectories in the File System

    Posted Fri August 14, 2015 12:18 PM

    I would like to copy a directory tree from one location to another.

    But, pub.file:listFiles

    “The pub.file:listFiles service does not list subdirectories or recursively list subdirectory
    contents.”

    I can maybe get around reading subdirectories.

    But, I also need to create a subdirectory at a network location and then put some stuff into that directory.

    Any idea on how to create a subdirectory in the file system?


    #Integration-Server-and-ESB
    #webMethods-General
    #webMethods


  • 2.  RE: Read and Create Subdirectories in the File System

    Posted Fri August 14, 2015 01:01 PM

    I’m trying to now workaround it by using an “executeOSCommand” to do a mkdir on a mapped drive.

    But, … yuck. Got to be a better way, no?


    #Integration-Server-and-ESB
    #webMethods-General
    #webMethods


  • 3.  RE: Read and Create Subdirectories in the File System

    Posted Fri August 14, 2015 07:39 PM

    You can develop your own file-related java services.


    #Integration-Server-and-ESB
    #webMethods-General
    #webMethods


  • 4.  RE: Read and Create Subdirectories in the File System

    Posted Sat August 15, 2015 04:31 AM

    What is your webMethods version? from v8.2 and above you have executeOSCommand service as part of WmPublic.

    executeOSCommand is also available in PS utils.


    #Integration-Server-and-ESB
    #webMethods-General
    #webMethods


  • 5.  RE: Read and Create Subdirectories in the File System

    Posted Mon August 17, 2015 03:25 PM

    you can write a wrapper service using in built services.

    that won’t be a very clean solution as you have to do lot of repeated dir and lot of string manuplation to get folder names etc.

    As wang suggested, i also think writing your own custom solution will make more sense and give you more control.


    #webMethods
    #Integration-Server-and-ESB
    #webMethods-General


  • 6.  RE: Read and Create Subdirectories in the File System

    Posted Tue September 29, 2015 11:21 AM

    I personally avoid, and recommend against, executeOSCommand whenever possible. Like others on this thread, I too suggest writing your own Java service. However, you don’t have to do it from scratch. There are well known libraries that do exactly what you want. E.g. Apache Commons: FileUtils (Apache Commons IO 2.11.0 API)

    Percio


    #webMethods-General
    #Integration-Server-and-ESB
    #webMethods