1   /*
2    * $Id: InMemoryIpRestrictor.java 7976 2007-08-21 14:26:13Z dirk.olmes $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.providers.ftp.server;
12  
13  import java.net.InetAddress;
14  
15  import org.apache.ftpserver.ftplet.Component;
16  import org.apache.ftpserver.ftplet.Configuration;
17  import org.apache.ftpserver.interfaces.IpRestrictor;
18  
19  
20  /**
21   * This class is needed to avoid creating unnesessary configuration files while running ftp transport tests.
22   */
23  
24  public class InMemoryIpRestrictor implements IpRestrictor, Component
25  {
26  
27      /**
28       * Configure the IP restrictor.
29       *
30       * @param config ignored
31       */
32      public void configure(Configuration config)
33      {
34      }
35  
36      /**
37       * Has the permission?
38       *
39       * @param address ignored
40       * @return true
41       */
42      public boolean hasPermission(InetAddress address)
43      {
44          return true;
45      }
46  
47      /**
48       * Get permission array.
49       *
50       * @return empty array
51       */
52      public Object[][] getPermissions()
53      {
54          return new Object[0][2];
55      }
56  
57      /**
58       * Set permission array.
59       *
60       * @param permissions ignored
61       */
62      public void setPermissions(Object[][] permissions)
63      {
64      }
65  
66      /**
67       * Release all the resources
68       */
69      public void dispose()
70      {
71      }
72  }