aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Changing user using ant Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Changing user using ant" Watch "Changing user using ant" New topic
Author

Changing user using ant

Vinayak patil
Ranch Hand

Joined: Aug 30, 2005
Posts: 67
Hi,

Is there a way to change the user using ant?

I need it to change some permissions on a file. This is a deployable war file so I need to change the permissions every time it is deployed.

I was thinking of incorporating the command in the ant file itself

Thanks in advance,

Vinayak


"I can resist everything except temptation"
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16246
    
  21

The concept of "user" is very OS-dependent, so the answer depends on what OS you're using.


Customer surveys are for companies who didn't pay proper attention to begin with.
Vinayak patil
Ranch Hand

Joined: Aug 30, 2005
Posts: 67
Hi,

I am deploying the application on LINUX

-Vinayak
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16246
    
  21

A lot depends on what you're doing to deploy the WAR, but assuming that you're deploying it to the same machine Ant runs of and just copying it, you can use the ant "exec" task to execute the "chown" Linux command.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Changing user using ant