Added UrlEncoder library
This commit is contained in:
parent
7f7fd43b8d
commit
b20783a18e
4 changed files with 12 additions and 14 deletions
2
.idea/kotlinc.xml
generated
2
.idea/kotlinc.xml
generated
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="KotlinJpsPluginSettings">
|
<component name="KotlinJpsPluginSettings">
|
||||||
<option name="version" value="1.7.22" />
|
<option name="version" value="1.8.0" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
11
build.gradle
11
build.gradle
|
@ -5,8 +5,8 @@ plugins {
|
||||||
id 'io.gitlab.arturbosch.detekt' version '1.22.0'
|
id 'io.gitlab.arturbosch.detekt' version '1.22.0'
|
||||||
id 'java'
|
id 'java'
|
||||||
id 'net.thauvin.erik.gradle.semver' version '1.0.4'
|
id 'net.thauvin.erik.gradle.semver' version '1.0.4'
|
||||||
id 'org.jetbrains.kotlin.jvm' version '1.7.22'
|
id 'org.jetbrains.kotlin.jvm' version '1.8.0'
|
||||||
id 'org.jetbrains.kotlin.kapt' version '1.7.22'
|
id 'org.jetbrains.kotlin.kapt' version '1.8.0'
|
||||||
id 'org.jetbrains.kotlinx.kover' version '0.6.1'
|
id 'org.jetbrains.kotlinx.kover' version '0.6.1'
|
||||||
id 'org.sonarqube' version '3.5.0.2730'
|
id 'org.sonarqube' version '3.5.0.2730'
|
||||||
id 'pmd'
|
id 'pmd'
|
||||||
|
@ -45,7 +45,7 @@ dependencies {
|
||||||
compileOnly(semverProcessor)
|
compileOnly(semverProcessor)
|
||||||
|
|
||||||
// PircBotX
|
// PircBotX
|
||||||
implementation 'com.github.pircbotx:pircbotx:-SNAPSHOT'
|
implementation 'com.github.pircbotx:pircbotx:master-SNAPSHOT'
|
||||||
// implementation fileTree(dir: 'lib', include: '*.jar')
|
// implementation fileTree(dir: 'lib', include: '*.jar')
|
||||||
|
|
||||||
// Commons (mostly for PircBotX)
|
// Commons (mostly for PircBotX)
|
||||||
|
@ -65,7 +65,7 @@ dependencies {
|
||||||
implementation 'org.jetbrains.kotlinx:kotlinx-cli:0.3.5'
|
implementation 'org.jetbrains.kotlinx:kotlinx-cli:0.3.5'
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
implementation 'org.slf4j:slf4j-api:2.0.5'
|
implementation 'org.slf4j:slf4j-api:2.0.6'
|
||||||
implementation "org.apache.logging.log4j:log4j-api:$versions.log4j"
|
implementation "org.apache.logging.log4j:log4j-api:$versions.log4j"
|
||||||
implementation "org.apache.logging.log4j:log4j-core:$versions.log4j"
|
implementation "org.apache.logging.log4j:log4j-core:$versions.log4j"
|
||||||
implementation "org.apache.logging.log4j:log4j-slf4j2-impl:$versions.log4j"
|
implementation "org.apache.logging.log4j:log4j-slf4j2-impl:$versions.log4j"
|
||||||
|
@ -82,11 +82,12 @@ dependencies {
|
||||||
implementation 'net.thauvin.erik:cryptoprice:1.0.0'
|
implementation 'net.thauvin.erik:cryptoprice:1.0.0'
|
||||||
implementation 'net.thauvin.erik:jokeapi:0.9-SNAPSHOT'
|
implementation 'net.thauvin.erik:jokeapi:0.9-SNAPSHOT'
|
||||||
implementation 'net.thauvin.erik:pinboard-poster:1.0.3'
|
implementation 'net.thauvin.erik:pinboard-poster:1.0.3'
|
||||||
|
implementation 'net.thauvin.erik:urlencoder:1.0.0'
|
||||||
|
|
||||||
testImplementation 'com.willowtreeapps.assertk:assertk-jvm:0.25'
|
testImplementation 'com.willowtreeapps.assertk:assertk-jvm:0.25'
|
||||||
// testImplementation 'org.mockito.kotlin:mockito-kotlin:4.0.0'
|
// testImplementation 'org.mockito.kotlin:mockito-kotlin:4.0.0'
|
||||||
// testImplementation "org.mockito:mockito-core:4.0.0"
|
// testImplementation "org.mockito:mockito-core:4.0.0"
|
||||||
testImplementation 'org.testng:testng:7.6.1'
|
testImplementation 'org.testng:testng:7.7.1'
|
||||||
}
|
}
|
||||||
|
|
||||||
test {
|
test {
|
||||||
|
|
|
@ -33,6 +33,7 @@ package net.thauvin.erik.mobibot
|
||||||
|
|
||||||
import net.thauvin.erik.mobibot.msg.Message
|
import net.thauvin.erik.mobibot.msg.Message
|
||||||
import net.thauvin.erik.mobibot.msg.Message.Companion.DEFAULT_COLOR
|
import net.thauvin.erik.mobibot.msg.Message.Companion.DEFAULT_COLOR
|
||||||
|
import net.thauvin.erik.urlencoder.UrlEncoder
|
||||||
import org.jsoup.Jsoup
|
import org.jsoup.Jsoup
|
||||||
import org.pircbotx.Colors
|
import org.pircbotx.Colors
|
||||||
import org.pircbotx.PircBotX
|
import org.pircbotx.PircBotX
|
||||||
|
@ -46,7 +47,6 @@ import java.io.ObjectInputStream
|
||||||
import java.io.ObjectOutputStream
|
import java.io.ObjectOutputStream
|
||||||
import java.net.HttpURLConnection
|
import java.net.HttpURLConnection
|
||||||
import java.net.URL
|
import java.net.URL
|
||||||
import java.net.URLEncoder
|
|
||||||
import java.nio.charset.StandardCharsets
|
import java.nio.charset.StandardCharsets
|
||||||
import java.nio.file.Files
|
import java.nio.file.Files
|
||||||
import java.nio.file.Paths
|
import java.nio.file.Paths
|
||||||
|
@ -152,10 +152,7 @@ object Utils {
|
||||||
* URL encodes the given string.
|
* URL encodes the given string.
|
||||||
*/
|
*/
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun String.encodeUrl(): String = URLEncoder.encode(this, StandardCharsets.UTF_8)
|
fun String.encodeUrl(): String = UrlEncoder.encode(this)
|
||||||
.replace("+", "%20")
|
|
||||||
.replace("*", "%2A")
|
|
||||||
.replace("%7E", "~")
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a property as an int.
|
* Returns a property as an int.
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
#Generated by the Semver Plugin for Gradle
|
#Generated by the Semver Plugin for Gradle
|
||||||
#Tue Dec 13 01:22:17 PST 2022
|
#Fri Dec 30 11:11:04 PST 2022
|
||||||
version.buildmeta=876
|
version.buildmeta=936
|
||||||
version.major=0
|
version.major=0
|
||||||
version.minor=8
|
version.minor=8
|
||||||
version.patch=0
|
version.patch=0
|
||||||
version.prerelease=rc
|
version.prerelease=rc
|
||||||
version.project=mobibot
|
version.project=mobibot
|
||||||
version.semver=0.8.0-rc+876
|
version.semver=0.8.0-rc+936
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue