File tree Expand file tree Collapse file tree 3 files changed +22
-8
lines changed
src/main/java/com/opentok Expand file tree Collapse file tree 3 files changed +22
-8
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ plugins {
5
5
id ' jacoco'
6
6
id ' signing'
7
7
id ' maven-publish'
8
- id ' io.github.gradle-nexus.publish-plugin' version ' 1.1 .0'
8
+ id ' io.github.gradle-nexus.publish-plugin' version ' 1.3 .0'
9
9
id " com.github.hierynomus.license" version " 0.16.1"
10
10
}
11
11
@@ -24,13 +24,17 @@ repositories {
24
24
dependencies {
25
25
testImplementation ' junit:junit:4.13.2'
26
26
testImplementation ' com.github.tomakehurst:wiremock-jre8:2.35.0'
27
+ testImplementation ' commons-fileupload:commons-fileupload:1.5'
28
+ testImplementation ' net.minidev:json-smart:2.4.11'
29
+ testImplementation ' com.google.guava:guava:32.0.1-jre'
30
+
27
31
implementation ' commons-lang:commons-lang:2.6'
28
- implementation ' commons-validator:commons-validator:1.7'
32
+ implementation ' commons-codec:commons-codec:1.16.0'
33
+ implementation ' io.netty:netty-codec-http:4.1.94.Final'
34
+ implementation ' io.netty:netty-handler:4.1.94.Final'
29
35
implementation ' org.asynchttpclient:async-http-client:2.12.3'
30
36
implementation ' com.fasterxml.jackson.core:jackson-databind:2.15.2'
31
- implementation ' commons-codec:commons-codec:1.15'
32
37
implementation ' org.bitbucket.b_c:jose4j:0.9.3'
33
- implementation ' io.netty:netty-handler:4.1.93.Final'
34
38
}
35
39
36
40
task sourcesJar (type : Jar ) {
Original file line number Diff line number Diff line change 1
1
# Mon Apr 05 14:22:26 EDT 2021
2
- distributionUrl =https\://services.gradle.org/distributions/gradle-7.4.2 -all.zip
2
+ distributionUrl =https\://services.gradle.org/distributions/gradle-8.1.1 -all.zip
3
3
distributionBase =GRADLE_USER_HOME
4
4
distributionPath =wrapper/dists
5
5
zipStorePath =wrapper/dists
Original file line number Diff line number Diff line change 8
8
package com .opentok ;
9
9
10
10
import com .opentok .exception .InvalidArgumentException ;
11
- import org .apache .commons .validator .routines .InetAddressValidator ;
12
11
12
+ import java .net .Inet4Address ;
13
+ import java .net .InetAddress ;
14
+ import java .net .UnknownHostException ;
13
15
import java .util .*;
14
16
15
17
@@ -52,12 +54,20 @@ public static class Builder {
52
54
* situate the session in its global network. If you do not set a location hint,
53
55
* the OpenTok servers will be based on the first client connecting to the session.
54
56
*
55
- * @param location The IP address to serve as the locaion hint.
57
+ * @param location The IP address to serve as the location hint.
56
58
*
57
59
* @return The SessionProperties.Builder object with the location hint setting.
58
60
*/
59
61
public Builder location (String location ) throws InvalidArgumentException {
60
- if (!InetAddressValidator .getInstance ().isValidInet4Address (location )) {
62
+ boolean valid ;
63
+ try {
64
+ InetAddress ip = InetAddress .getByName (location );
65
+ valid = ip instanceof Inet4Address && ip .getHostAddress ().equals (location );
66
+ }
67
+ catch (UnknownHostException ex ) {
68
+ valid = false ;
69
+ }
70
+ if (!valid ) {
61
71
throw new InvalidArgumentException ("Location must be a valid IPv4 address. location = " + location );
62
72
}
63
73
this .location = location ;
You can’t perform that action at this time.
0 commit comments