Link to home
Start Free TrialLog in
Avatar of Lico_w
Lico_w

asked on

Apachi ANT Beginner Programming - Copying an entire directory

I am using an ant script to copy a number of files to a server and would like to take the entire directory rather than each file seperately. I tried specifying * or *.* at the end of the path but I get this error:

java.io.FileNotFoundException: D:\PVCS\Workfiles\releases\applications\myTNT\Property_Files\*.* (The filename, directory name, or volume label syntax is incorrect)

My XML snipet is below, please help


<target name="copytoserver">
      <input message="username: " addproperty="user"/>
      <input message="password: " addproperty="password">
        <handler classname="org.apache.tools.ant.input.SecureInputHandler" />
      </input>
  	  <scp trust="true" verbose="true" file="D:\PVCS\Workfiles\releases\applications\myTNT\war\myTNT-v5.11.1.3-20100929-1320.war" todir="${user}:${password}@gbaheweb0:/tmp"/>
  	  <scp trust="true" verbose="true" file="D:\PVCS\Workfiles\releases\applications\myTNT\Property_Files\*.*" todir="${user}:${password}@gbaheweb0:/tmp"/>
<!--  	  <scp trust="true" verbose="true" file="assima/${env.FOLDER}/${env.ZIPFILE}.zip" todir="${user}:${password}@gbahevpl17.ics.express.tnt:/communique/sunone/docs/expressnet/misc/assima"/>
--> 	</target>

Open in new window

Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Try using a fileset
SOLUTION
Avatar of Gurvinder Pal Singh
Gurvinder Pal Singh
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Lico_w
Lico_w

ASKER

Man, you two are smart! This has helped me soooo much, many thanks.
:-)