just switch to 1.5r3 and looks like it works. Thanks. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, February 18, 2005 11:46 AM To: Ant Users List Subject: RE: handy way to check if a dir is empty or not
It looks like the error I was getting when I had the most recent version of Rhino installed. Which version are you using? I could only get it to work using bsf-2.3_rc1 and rhino-1.5r3 --Alex Buccino "Michael Wang (IT)" <[EMAIL PROTECTED]> 02/18/2005 11:19 AM Please respond to "Ant Users List" To: "Ant Users List" <user@ant.apache.org> cc: Subject: RE: handy way to check if a dir is empty or not Thanks, I got the following error java.lang.NoSuchMethodError: org.mozilla.javascript.Context: method getDebuggableEngine()Lorg/mozilla/javascript/debug/DebuggableEngine; not found I put bsf.jar and js.jar in $ANT_HOME/lib. Do I need to specifically put them into $CLASSPATH? Thanks. MW -----Original Message----- From: Ivan Ivanov [mailto:[EMAIL PROTECTED] Sent: Friday, February 18, 2005 9:45 AM To: Ant Users List Subject: RE: handy way to check if a dir is empty or not Yes, you need. Check http://ant.apache.org/manual/install.html#librarydependencies for more information. HTH Ivan --- "Michael Wang (IT)" <[EMAIL PROTECTED]> wrote: > thank much. do I need to include some external jar > to run js script? thanks. > > -----Original Message----- > From: Ivan Ivanov > [mailto:[EMAIL PROTECTED] > Sent: Friday, February 18, 2005 9:41 AM > To: Ant Users List > Subject: RE: handy way to check if a dir is empty or > not > > > > --- "Michael Wang (IT)" <[EMAIL PROTECTED]> > wrote: > > > thanks for the reply, howover, is this ANT script? > > No, this is not an Ant script but this snippet can > be > used in a <scriptdef>: > <project> > <scriptdef name="isEmpty" language="javascript"> > <attribute name="dir"/> > <attribute name="property"/> > <![CDATA[ > importPackage(java.io); > file = new File(attributes.get("dir")); > if(file.isDirectory() && > (file.list()).length == 0) { > > project.setNewProperty(attributes.get("property"), > "true"); > } > ]]> > </scriptdef> > <mkdir dir="empty"/> > <mkdir dir="notempty"/> > <touch file="notempty/file.txt"/> > <isEmpty dir="empty" property="empty.empty"/> > <echo>$${empty.empty} = ${empty.empty}</echo> > <isEmpty dir="notempty" > property="notempty.empty"/> > <echo>$${notempty.empty} = > ${notempty.empty}</echo> > </project> > > HTH Ivan > > > > -----Original Message----- > > From: Mark Benussi > [mailto:[EMAIL PROTECTED] > > Sent: Friday, February 18, 2005 9:28 AM > > To: user@ant.apache.org > > Subject: RE: handy way to check if a dir is empty > or > > not > > > > > > if(file.isDirectory() && (file.list()).length == > 0) > > { > > // Directory is empty > > } > > > > ----Original Message Follows---- > > From: "Michael Wang (IT)" > > <[EMAIL PROTECTED]> > > Reply-To: "Ant Users List" <user@ant.apache.org> > > To: "Ant Users List" <user@ant.apache.org> > > Subject: handy way to check if a dir is empty or > not > > Date: Fri, 18 Feb 2005 09:17:28 -0500 > > > > is there a handy way to do this? thanks. > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > > > > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam > protection around > http://mail.yahoo.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]