You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Edgar Poce <ed...@gmail.com> on 2008/06/02 23:14:23 UTC

[ftpserver] compilation problems

Hi

 I'm trying to embed ftpserver in a test case but I wasn't able to get
a working version.
 I tried to download ftpserver but the link is broken[1]. Then I
followed the build instructions[2] but I get the following exception
during compilation.

C:\projects\ftpserver\core\src\main\java\org\apache\ftpserver\usermanager\BaseUs
er.java:[46,0] org.apache.ftpserver.usermanager.BaseUser is not abstract and doe
s not override abstract method getAuthorities(java.lang.Class<? extends org.apac
he.ftpserver.ftplet.Authority>) in org.apache.ftpserver.ftplet.User

Any idea about how can I compile it or download the binaries?

thanks in advance,
edgar

[1] http://mina.apache.org/ftpserver-downloads.html
[2] http://mina.apache.org/building-ftpserver.html

Re: [ftpserver] compilation problems

Posted by Andy Thomson <a1...@gmail.com>.
Hi,

The authority error is an easy fix. In your file:

C:\projects\ftpserver\core\src\main\java\org\apache\ftpserver\usermanager\BaseUs
er.java

There is a method at the end of the class, change it to look like this:

                 These are the changes  ---> v  v
                                             v  v
                                             v  v

    public Authority[] getAuthorities(Class<? extends Authority> clazz) {
         List<Authority> selected = new ArrayList<Authority>();

         for (int i = 0; i < authorities.length; i++) {
             if (authorities[i].getClass().equals(clazz)) {
                 selected.add(authorities[i]);
             }
         }

         return selected.toArray(new Authority[0]);
    }

Just add the '? extends' in the parameter field.

Once that is done, try to rebuild, it should be okay.

Andy Thomson


Edgar Poce wrote:
> Hi
> 
>  I'm trying to embed ftpserver in a test case but I wasn't able to get
> a working version.
>  I tried to download ftpserver but the link is broken[1]. Then I
> followed the build instructions[2] but I get the following exception
> during compilation.
> 
> C:\projects\ftpserver\core\src\main\java\org\apache\ftpserver\usermanager\BaseUs
> er.java:[46,0] org.apache.ftpserver.usermanager.BaseUser is not abstract and doe
> s not override abstract method getAuthorities(java.lang.Class<? extends org.apac
> he.ftpserver.ftplet.Authority>) in org.apache.ftpserver.ftplet.User
> 
> Any idea about how can I compile it or download the binaries?
> 
> thanks in advance,
> edgar
> 
> [1] http://mina.apache.org/ftpserver-downloads.html
> [2] http://mina.apache.org/building-ftpserver.html
> 

Re: [ftpserver] compilation problems

Posted by Niklas Gustavsson <ni...@protocol7.com>.
My bad, I've now commited a fix to this issue. Thanks for reporting it!

/niklas

On Mon, Jun 2, 2008 at 11:14 PM, Edgar Poce <ed...@gmail.com> wrote:
> Hi
>
>  I'm trying to embed ftpserver in a test case but I wasn't able to get
> a working version.
>  I tried to download ftpserver but the link is broken[1]. Then I
> followed the build instructions[2] but I get the following exception
> during compilation.
>
> C:\projects\ftpserver\core\src\main\java\org\apache\ftpserver\usermanager\BaseUs
> er.java:[46,0] org.apache.ftpserver.usermanager.BaseUser is not abstract and doe
> s not override abstract method getAuthorities(java.lang.Class<? extends org.apac
> he.ftpserver.ftplet.Authority>) in org.apache.ftpserver.ftplet.User
>
> Any idea about how can I compile it or download the binaries?
>
> thanks in advance,
> edgar
>
> [1] http://mina.apache.org/ftpserver-downloads.html
> [2] http://mina.apache.org/building-ftpserver.html
>