Title:

Hi,

We are having a problem doing a find and replace in a Java 2 security policy file using Ant.  An extract of the target file is as follows:

grant codeBase "file:%WEBLOGIC_HOME%/-" {
  permission java.io.FilePermission "${/}usr${/}local${/}weblogic${/}-", "read,write,delete,execute";
  permission java.net.SocketPermission "localhost:1-9000", "connect,accept,listen,resolve";
  etc....
}

The bit we need to make dynamic is the "${/}usr${/}local${/}weblogic${/}-" and although we could do this by creating an entry in the file like "${/}TOKEN1${/}TOKEN2${/}TOKEN3${/}-" and doing three replace tasks for each token, this is undersirable.  The reason is that the install directory for any given machine will not be fixed, so there could be more or less elements in the directory path.  Is there a way in ant to dynamically construct a string from a path such that we could generate something like "${/}usr${/}local${/}weblogic${/}-"....???  Perhaps we need to write a custom task.

Also, is there a way to escape ${} within Ant so that it is not interpreted as a variable?

Many thanks

Zav

------------------------------------
Xavier Witdouck
Volbroker.com
Tel: +44 (0)20 7214 4957
Mob: +44 (0)777 568 5877
Email: [EMAIL PROTECTED]
------------------------------------


 

Reply via email to