Examples of Inet4Network


Examples of org.apache.james.dnsservice.library.inetnetwork.model.Inet4Network

            } else if (netspec.indexOf('.', iSlash) == -1) {
                netspec = normalizeV4FromCIDR(netspec);
            }
        }

        return new Inet4Network(dnsService.getByName(netspec.substring(0, netspec.indexOf('/'))), dnsService.getByName(netspec.substring(netspec.indexOf('/') + 1)));
    }
View Full Code Here

Examples of org.apache.james.util.inetnetwork.model.Inet4Network

            else if (netspec.indexOf('.', iSlash) == -1) {
                netspec = normalizeV4FromCIDR(netspec);
            }
        }

        return new Inet4Network(
                dnsService.getByName(netspec.substring(0, netspec.indexOf('/'))),
                dnsService.getByName(netspec.substring(netspec.indexOf('/') + 1)));
    }
View Full Code Here

Examples of org.apache.james.util.inetnetwork.model.Inet4Network

    public void testInet4Network() throws UnknownHostException {

        // Test with null parameter.
        address = InetAddress.getByAddress(getBytesFromAddress("127.0.0.1"));
        try {
            network4 = new Inet4Network(address, null);
            assertTrue(false);
        } catch (NullPointerException e) {
            assertTrue(true);
        }

        // Test IP V4.
        address = InetAddress.getByAddress(getBytesFromAddress("127.0.0.1"));
        subnetmask4 = InetAddress.getByAddress(getBytesFromAddress("255.255.255.0"));
        network4 = new Inet4Network(address, subnetmask4);
        assertEquals("127.0.0.0/255.255.255.0", network4.toString());

    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.