ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manoj Sadangi <msada...@manh.com>
Subject RE: how to use java.io.File inside script
Date Tue, 20 May 2003 18:01:31 GMT
it works

thanks, 
manoj 



-----Original Message-----
From: Keith Hatton [mailto:khatton@axiomsystems.com]
Sent: Tuesday, May 20, 2003 12:26 PM
To: Ant Users List
Subject: RE: how to use java.io.File inside script


Hi Manoj,

The methods available are simply those of the respective Java APIs.

You probably want java.io.FileReader instead of File, and for the
FileWriter, you need write not writeLine. Just check the JavaDocs for the
classes you import into the script and call the methods exactly as you would
if you were writing Java code.

Hope this helps
Keith


-----Original Message-----
From: Manoj Sadangi [mailto:msadangi@manh.com]
Sent: 20 May 2003 16:28
To: 'Ant Users List'
Subject: how to use java.io.File inside script


I am trying to read from a file and checking for a particular string inside
a line .
if the string exist then writing the line to the output file.
<script language="javascript"> <![CDATA[
        importClass(java.io.File);      
        importClass(java.io.FileWriter);      
        in = new File("sample.txt");
        outFile=new FileWriter("write1.txt");

what are the methods available for io operation?
I tried readLine and writeLine -- it does not work.


thanks, 
manoj
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org

Mime
View raw message