cancel
Showing results for 
Search instead for 
Did you mean: 

How to get Server Path

Former Member
0 Kudos

Hi All

I need to get full Application server path on which the application is deployed

for eg <b>/usr/sap/RIU/JC20/2ee/cluster/server0</b>

Actually i need to extract the cluster information like <b>RIU</b> in this case.

How can i do so ? Which Webdynpro APIs can be used.

Please help

Regards

Sonal Mangla

Message was edited by:

Sonal Mangla

null

Accepted Solutions (0)

Answers (1)

Answers (1)

vijayakhanna_raman
Active Contributor
0 Kudos

Hi,

You can get the application url like this.

String deployableObjectName = wdComponentAPI.getDeployableObjectPart().getDeployableObjectName();	
String part = wdComponentAPI.getApplication().getDeployableObjectPart().getName();
	
try {			
WDDeployableObjectPart deployableObjectPart =WDDeployableObject.getDeployableObjectPart( deployableObjectName, part,WDDeployableObjectPartType.APPLICATION);	
String applicationURL1 = WDURLGenerator.getAbsoluteWebResourceURL(deployableObjectPart) ;
wdComponentAPI.getMessageManager().reportSuccess("urlToTargetApp"+applicationURL1);
} catch (WDURLException e) 
{			
	wdComponentAPI.getMessageManager().reportException("Exception:"+e,true);	
				} 
catch (WDDeploymentException ex) 
	{
						wdComponentAPI.getMessageManager().reportException("Exception:"+ex,true);		}

Also check this thread for getting the server name

https://forums.sdn.sap.com/click.jspa?searchID=2783356&messageID=329724

Regards,

Vijai

Former Member
0 Kudos

Hi Vijai

This is not we want.. This way i got the URL of the application.

I need the server path. have already mentioned the eg also.

I meant to say server directory path where the files are strored.

Hope you got the requirement.

Anyways thanks for the effort.

Regards

Sonal

Former Member
0 Kudos

Hi,

Look at the <i>WDSystemLandscape.getCurrentJ2EEClusterName()</i> method. Also look at the <i>WDSystemLandscape</i> class.

Regards,

Satyajit.

Former Member
0 Kudos

Hi Satyajit

Very Very thanks for your answer. It helped me finding the cluster name.

But is it possible to get the full path. I mean in case i need server node also.

I have rewarded you the points.

Regards

Sonal Mangla

null

Former Member
0 Kudos

Hi,

I don't think it's possible to retrieve the full server path from the <i>WDSystemLandscape</i> class, but if you add the SLD jars (sldclient.jar) to your project, you can use the <i>SystemExplorer</i> class. It has a method called <i>getJ2EEClusterSID</i>. This might be what you want (I'm not too sure though).

Regards,

Satyajit.