how to give a path to getFile service?

hi all,

I have multiple ISs on a single box and I am trying to use getFile service to read a file from the packages directory. Everytime I have to enter the path manually when ever I change the IS instance. Is there any service available or any other way to read the path of the file from different instances of IS and give it as an input to the getFile service.

Thanks a lot in advance.

Thanks,
Ramesh.

The PSUtilities package has a service called PSUtilites.properties:getSystemProperty (pass in user.dir as propertyName parameter) which will retrieve the IS directory. From there you can concat the paths to the targeted package directory to build the full path to be used by getFile. This way, you don’t have to type in the paths manually, but let your code build the paths for you. It should work for any IS instance because it gets the appropriate IS directory for that particular IS instance.

Hope this helps,
YLO

thanks a lot YLO.

If the path and the filename are always the same except that the IntegrationServer home changes, then you can use a relative path.

For example, instead of using the path C:/Program Files/webMethods6/IntegrationServer/packages/MyPackage/myfile.txt, you can simply use packages/MyPackage/myfile.txt.

  • Percio

The pub.utils:getSystemProperty built-in service was added to WmPublic with one of the Fixes to IS 6.5. Pretty sure it will be part of IS 6.5 SP2.

Mark

Hi,

Reviving an old thread. We’re running both DEV and QA on the same machine but with two seperate VMs.

For some reason, when I call pub.utils:getServerProperty from dev using “user.dir”, it returns the QA path, which is really weird to me. We have different start scripts and user environments so this should not happen.

Anyone with ideas? Is there a way to change the “user.dir” for the DEV instance?

Thanks.
FT

Hi,

how to give the path to getFile service in Unix ,
eg. The file is in the location /dir1/dir2/abc.txt .

Did you try that path? If dir1 is a directory at the root, then the absolute path you’ve specified should work just fine.