Class IpRangeParser

java.lang.Object
com.nerjal.ip_range_parser.IpRangeParser

public class IpRangeParser extends Object
The IpRangeParser class provides utility methods for parsing IP range data from files, converting them into CIDR (Classless Inter-Domain Routing) notation, and serializing the result into JSON format. It supports both IPv4 and IPv6 address ranges. The parsed IP ranges are grouped and optimized for efficient representation and storage in CIDR notation.
  • Constructor Details

    • IpRangeParser

      public IpRangeParser()
  • Method Details

    • main

      public static void main(String[] args)
      Standalone launch method
      Parameters:
      args - launch args
    • parse

      public static void parse(File outputFile, File ipv4file, File ipv6file)
      Parses IPv4 and IPv6 data files and writes the resulting JSON data to the specified output file. The method processes the data from the two input files, transforms the IP ranges into CIDR notations, and outputs the structured data as a JSON object.
      Parameters:
      outputFile - the file to which the generated JSON data will be written.
      ipv4file - the file containing IPv4 data with IP ranges to be parsed.
      ipv6file - the file containing IPv6 data with IP ranges to be parsed.