aspose file tools*
The moose likes Java in General and the fly likes Web application - access remote server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Web application - access remote server" Watch "Web application - access remote server" New topic
Author

Web application - access remote server

Matthew Hersee
Greenhorn

Joined: Dec 19, 2006
Posts: 9
Hi,

I am running a local (localhost) web application that needs to access a VSS installation on a remote machine via a DOS command line on my local machine.

I have written the java (Runtime.exec etc) to run the DOS command. But evidently I get an "access is denied" error when the command line tries to access the remotely installed VSS ini file.

My question is this - how can i work out what user my java web app is running as? Or is there a way of making the webapp impersonate my user rights for this connection?

if i can find this out then i can get my IT department to give this user rights to access the remote machine.

Thanks in advance

Matt
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11525
    
100

Hi Matthew,

It sounds like you have solved your problem in your other posts, but just to provide an answer to this one ...

Typing "SET" at the command prompt will provide you with all the environmental variables that the current environment knows about.

So all you need do is run the set command through your call to Runtime.exec within Tomcat, and you should be able to see the user that Tomcat is currently running as.

Regards, Andrew


The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Web application - access remote server