1 /* 2 * $Id:InMemoryIpRestrictor.java 7261 2007-06-27 02:23:03Z aperepel $ 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.transport.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 // nothing to do 35 } 36 37 /** 38 * Has the permission? 39 * 40 * @param address ignored 41 * @return true 42 */ 43 public boolean hasPermission(InetAddress address) 44 { 45 return true; 46 } 47 48 /** 49 * Get permission array. 50 * 51 * @return empty array 52 */ 53 public Object[][] getPermissions() 54 { 55 return new Object[0][2]; 56 } 57 58 /** 59 * Set permission array. 60 * 61 * @param permissions ignored 62 */ 63 public void setPermissions(Object[][] permissions) 64 { 65 // nothing to do 66 } 67 68 /** 69 * Release all the resources 70 */ 71 public void dispose() 72 { 73 // nothing to do 74 } 75 }