Package one.tranic.t.base.parse.network
Class NetworkParser
java.lang.Object
one.tranic.t.base.parse.network.NetworkParser
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisNatRange(InetAddress address) Helper method to detect extended NAT internal ranges.static booleanisPrivateIp(String address) Checks if a given IP address in String format is a private IP address.static booleanisPrivateIp(InetAddress address) Checks if an InetAddress is a private IP address.static InputStreamRetrieves an InputStream for a specified resource file by its filename.
-
Constructor Details
-
NetworkParser
public NetworkParser()
-
-
Method Details
-
isPrivateIp
Checks if an InetAddress is a private IP address.- Parameters:
address- the InetAddress to check- Returns:
- true if the address is a private IP, false otherwise
-
isPrivateIp
Checks if a given IP address in String format is a private IP address.- Parameters:
address- the IP address as a String to check- Returns:
- true if the address is a private IP, false otherwise
- Throws:
UnknownHostException- if the string cannot be parsed as an IP address
-
isNatRange
Helper method to detect extended NAT internal ranges.- Parameters:
address- the InetAddress to check- Returns:
- true if part of NAT internal ranges, false otherwise
-
resource
Retrieves an InputStream for a specified resource file by its filename.- Parameters:
filename- the name of the resource file to be loaded- Returns:
- an InputStream for the resource file, or null if the resource cannot be found or accessed
-