Why is this MissingMethodException thrown in Eclipse?

View: New views
4 Messages — Rating Filter:   Alert me  

Why is this MissingMethodException thrown in Eclipse?

by geossscripting :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi!

The following line throws a groovy.lang.MissingMethodException :No signature of method: java.io.File.deleteDir() is applicable for argument types: () values: {}

new File(directory).deleteDir()

where directory is a java.lang.String instance. The thing is, this only happens in Eclipse. The same code tried in groovyconsole, or ran from the command line works just fine. --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

Re: Why is this MissingMethodException thrown in Eclipse?

by Guillaume Laforge-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Perhaps is should be delete()?
http://java.sun.com/j2se/1.4.2/docs/api/java/io/File.html#delete()

On Tue, Jun 30, 2009 at 16:20, Lex Williams<lyon2003@...> wrote:

>
> Hi!
>
> The following line throws a groovy.lang.MissingMethodException :No signature
> of method: java.io.File.deleteDir() is applicable for argument types: ()
> values: {}
>
> new File(directory).deleteDir()
>
> where directory is a java.lang.String instance. The thing is, this only
> happens in Eclipse. The same code tried in groovyconsole, or ran from the
> command line works just fine.
> --------------------------------------------------------------------- To
> unsubscribe from this list, please visit:
> http://xircles.codehaus.org/manage_email



--
Guillaume Laforge
Groovy Project Manager
Head of Groovy Development at SpringSource
http://www.springsource.com/g2one

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Parent Message unknown Re: Why is this MissingMethodException thrown in Eclipse?

by geossscripting :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

No, I wanted to use deleteDir so that I wouldn't have to implement the same functionality defined at http://groovy.codehaus.org/groovy-jdk/java/io/File.html#deleteDir()

---------[ Received Mail Content ]----------
> Subject : Re: [groovy-user] Why is this MissingMethodException thrown in Eclipse?
> Date : Tue, 30 Jun 2009 16:29:27 +0200
> From : Guillaume Laforge
> To : user@...
>
>Perhaps is should be delete()?
>http://java.sun.com/j2se/1.4.2/docs/api/java/io/File.html#delete()
>
>On Tue, Jun 30, 2009 at 16:20, Lex Williams wrote:
>>
>> Hi!
>>
>> The following line throws a groovy.lang.MissingMethodException :No signature
>> of method: java.io.File.deleteDir() is applicable for argument types: ()
>> values: {}
>>
>> new File(directory).deleteDir()
>>
>> where directory is a java.lang.String instance. The thing is, this only
>> happens in Eclipse. The same code tried in groovyconsole, or ran from the
>> command line works just fine.
>> --------------------------------------------------------------------- To
>> unsubscribe from this list, please visit:
>> http://xircles.codehaus.org/manage_email
>
>
>
>--
>Guillaume Laforge
>Groovy Project Manager
>Head of Groovy Development at SpringSource
>http://www.springsource.com/g2one
>
>---------------------------------------------------------------------
>To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
>
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

Re: Why is this MissingMethodException thrown in Eclipse?

by Jochen Theodorou :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Lex Williams schrieb:
> No, I wanted to use deleteDir so that I wouldn't have to implement the
> same functionality defined at
> http://groovy.codehaus.org/groovy-jdk/java/io/File.html#deleteDir()

if you use the normal plugin, then I am sure you use Groovy 1.5.x. This
method was added in the 1.6.x line only

bye blackdrag

--
Jochen "blackdrag" Theodorou
The Groovy Project Tech Lead (http://groovy.codehaus.org)
http://blackdragsview.blogspot.com/


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email