-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #496 from boudicca-events/abl/migrate-eventcollectors
migrate all eventcollectors
- Loading branch information
Showing
42 changed files
with
869 additions
and
644 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
boudicca.base/common-model/src/main/kotlin/base/boudicca/format/UrlUtils.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package base.boudicca.format | ||
|
||
import java.net.URI | ||
|
||
object UrlUtils { | ||
fun parse(string: String?): URI? { | ||
if (string.isNullOrEmpty()) { | ||
return null | ||
} | ||
val trimmed = string.trim() | ||
return try { | ||
URI.create(string) | ||
} catch (e: IllegalArgumentException) { | ||
val fixedUrl = tryFixUrl(trimmed) | ||
URI.create(fixedUrl) | ||
} | ||
} | ||
|
||
//invalid urls everywhere -.- | ||
private fun tryFixUrl(url: String): String { | ||
return url | ||
.replace("[", "%5B") | ||
.replace("]", "%5D") | ||
.replace(" ", "%20") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.