diff --git a/build.gradle.kts b/build.gradle.kts index 42cdc30..360c0fd 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -16,7 +16,7 @@ * ProjectName mingli-utils * ModuleName mingli-utils * CurrentFile build.gradle.kts - * LastUpdate 2026-02-08 03:14:06 + * LastUpdate 2026-03-10 09:16:54 * UpdateUser MingLiPro */ @@ -30,12 +30,15 @@ plugins { `java-library` `maven-publish` kotlin("jvm") version "2.2.20" - id("org.jetbrains.dokka") version "2.0.0" kotlin("kapt") version "2.2.20" + id("org.jetbrains.dokka") version "2.1.0" + id("org.jetbrains.dokka-javadoc") version "2.1.0" } val GROUPSID = project.properties["GROUPSID"] as String val VERSIONS = project.properties["VERSIONS"] as String val ARTIFACTID = project.properties["ARTIFACTID"] as String +val JDKVERSIONS = (project.properties["JDKVERSIONS"] as String).toInt() + group = GROUPSID version = VERSIONS @@ -46,50 +49,34 @@ base { val buildDir: java.nio.file.Path = File("build").toPath() -sourceSets { - main { - java { - srcDirs("src/main/java") - } - kotlin { - srcDirs("src/main/kotlin") - } - resources { - srcDirs("src/main/resources") - } - } -} - -tasks.test { - useJUnitPlatform() -} - java { + toolchain.languageVersion.set(JavaLanguageVersion.of(17)) withSourcesJar() - toolchain.languageVersion.set(JavaLanguageVersion.of(8)) } - +kotlin { + jvmToolchain(JDKVERSIONS) +} dependencies { implementation("org.slf4j:slf4j-api:2.0.17") - implementation("com.mingliqiye.utils.jna:WinKernel32Api:1.0.1") implementation(kotlin("reflect")) - compileOnly("org.mindrot:jbcrypt:0.4") - compileOnly("com.squareup.okhttp3:okhttp:5.3.2") compileOnly("com.fasterxml.jackson.core:jackson-databind:2.21.0") compileOnly("com.fasterxml.jackson.module:jackson-module-kotlin:2.21.0") - compileOnly("org.springframework.boot:spring-boot-starter-web:2.7.18") + compileOnly("org.springframework:spring-context:5.3.0") + compileOnly("org.springframework.boot:spring-boot-autoconfigure:2.7.16") + compileOnly("tools.jackson.core:jackson-databind:3.1.0") + compileOnly(fileTree("libs")) compileOnly("com.google.code.gson:gson:2.13.2") compileOnly("org.mybatis:mybatis:3.5.19") compileOnly("io.netty:netty-all:4.1.130.Final") compileOnly("com.baomidou:mybatis-plus-core:3.5.15") compileOnly("net.java.dev.jna:jna:5.17.0") + compileOnly("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.8") compileOnly("com.baomidou:mybatis-plus-extension:3.5.15") - testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.1") - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.1") -// testImplementation("com.squareup.okhttp3:okhttp:5.3.2") + testImplementation("org.junit.jupiter:junit-jupiter:5.7.1") + testRuntimeOnly("org.junit.platform:junit-platform-launcher") testImplementation("com.mingliqiye.logger:logger-log4j2:1.0.5") testImplementation("com.google.code.gson:gson:2.13.2") testImplementation("com.fasterxml.jackson.core:jackson-databind:2.21.0") @@ -97,14 +84,20 @@ dependencies { } -tasks.withType { +tasks.withType().configureEach { options.encoding = "UTF-8" } +tasks.named("test") { + useJUnitPlatform() +} + tasks.withType().configureEach { - jvmArgs = listOf( - "-Dfile.encoding=UTF-8", "-Dsun.stdout.encoding=UTF-8", "-Dsun.stderr.encoding=UTF-8" + jvmArgs?.addAll( + listOf( + "-Dfile.encoding=UTF-8", "-Dsun.stdout.encoding=UTF-8", "-Dsun.stderr.encoding=UTF-8" + ) ) } @@ -149,24 +142,16 @@ tasks.withType { } val isJdk8Build = project.findProperty("buildForJdk8") == "true" - - -repositories { - maven { - url = uri("https://maven.aliyun.com/repository/public/") - } - mavenCentral() -} tasks.register("javaDocJar") { group = "build" - archiveClassifier.set("javadoc") - dependsOn("dokkaJavadoc") + archiveClassifier.set("javadoc-dec") + dependsOn("dokkaGeneratePublicationJavadoc") from(buildDir.resolve("dokka/javadoc")) } tasks.register("kotlinDocJar") { group = "build" - archiveClassifier.set("kotlindoc") - dependsOn("dokkaHtml") + archiveClassifier.set("javadoc") + dependsOn("dokkaGeneratePublicationHtml") from(buildDir.resolve("dokka/html")) } publishing { @@ -175,18 +160,12 @@ publishing { name = "MavenRepositoryRaw" url = uri("C:/data/git/maven-repository-raw") } - maven { - name = "OSSRepository" - url = uri("C:/data/git/maven-repository-raw-utils") - } } publications { create("mavenJava") { from(components["java"]) - artifact(tasks.named("javaDocJar")) artifact(tasks.named("kotlinDocJar")) artifactId = ARTIFACTID - java.toolchain.languageVersion.set(JavaLanguageVersion.of(8)) pom { name = "mingli-utils" url = "https://mingli-utils.mingliqiye.com" @@ -222,8 +201,6 @@ tasks.build { } - - tasks.processResources { duplicatesStrategy = DuplicatesStrategy.EXCLUDE outputs.upToDateWhen { false } @@ -239,3 +216,11 @@ tasks.processResources { ) } } + +signing { + val secretKeyRingFile = System.getenv("SIGNING_SECRET_KEY_RING_FILE") + val keyId = System.getenv("SIGNING_KEY_ID") + project.ext.set("signing.secretKeyRingFile", secretKeyRingFile) + project.ext.set("signing.keyId", keyId) + project.ext.set("signing.password", "") +} diff --git a/gradle.properties b/gradle.properties index 2a0aab4..006c4ef 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,13 +16,10 @@ # ProjectName mingli-utils # ModuleName mingli-utils # CurrentFile gradle.properties -# LastUpdate 2026-02-08 03:15:06 +# LastUpdate 2026-03-11 08:46:05 # UpdateUser MingLiPro # -JDKVERSIONS=1.8 +JDKVERSIONS=17 GROUPSID=com.mingliqiye.utils ARTIFACTID=mingli-utils -VERSIONS=4.6.4 -signing.keyId=B22AA93B -signing.password= -signing.secretKeyRingFile=secret.gpg +VERSIONS=5.0.8 diff --git a/jdk8/build.gradle.kts b/jdk8/build.gradle.kts deleted file mode 100644 index 4a603b0..0000000 --- a/jdk8/build.gradle.kts +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright 2025 mingliqiye - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ProjectName mingli-utils - * ModuleName mingli-utils.jdk8 - * CurrentFile build.gradle.kts - * LastUpdate 2025-09-21 15:39:12 - * UpdateUser MingLiPro - */ - -plugins { - id("java-library") - id("maven-publish") - signing -} -val GROUPSID = project.properties["GROUPSID"] as String -val VERSIONS = project.properties["VERSIONS"] as String -val ARTIFACTID = project.properties["ARTIFACTID"] as String -version = VERSIONS -group = GROUPSID - -base.archivesName.set(ARTIFACTID) - - - -publishing { - repositories { - maven { - name = "MavenRepositoryRaw" - url = uri("C:/data/git/maven-repository-raw") - } - maven { - name = "OSSRepository" - url = uri("C:/data/git/maven-repository-raw-utils") - } - } - publications { - create("mavenJava") { - from(components["java"]) - artifactId = "$ARTIFACTID-win-jdk8" - java.toolchain.languageVersion.set(JavaLanguageVersion.of(8)) - pom { - name = "mingli-utils-win-jdk8" - url = "https://mingli-utils.mingliqiye.com" - description = "A Java/kotlin Utils" - licenses { - license { - name = "The Apache License, Version 2.0" - url = "http://www.apache.org/licenses/LICENSE-2.0.txt" - } - } - developers { - developer { - id = "minglipro" - name = "mingli" - email = "minglipro@163.com" - } - } - scm { - connection = "scm:git:https://git.mingliqiye.com/minglipro/mingli-utils.git" - developerConnection = "scm:git:https://git.mingliqiye.com:minglipro/mingli-utils.git" - url = "https://git.mingliqiye.com/minglipro/mingli-utils" - } - } - } - } - signing { - sign(publishing.publications) - } -} - -java.toolchain.languageVersion.set(JavaLanguageVersion.of(8)) - -dependencies { - api(rootProject) - implementation("com.mingliqiye.utils.jna:WinKernel32Platform:1.0.1") -} diff --git a/jdk8/gradle.properties b/jdk8/gradle.properties deleted file mode 100644 index bd802ce..0000000 --- a/jdk8/gradle.properties +++ /dev/null @@ -1,23 +0,0 @@ -# -# Copyright 2025 mingliqiye -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# ProjectName mingli-utils -# ModuleName mingli-utils.jdk8 -# CurrentFile gradle.properties -# LastUpdate 2025-09-16 12:14:37 -# UpdateUser MingLiPro -# - -signing.secretKeyRingFile=../secret.gpg diff --git a/libs/spring-boot-jackson-4.1.0-M2.jar b/libs/spring-boot-jackson-4.1.0-M2.jar new file mode 100644 index 0000000..d6af5f3 Binary files /dev/null and b/libs/spring-boot-jackson-4.1.0-M2.jar differ diff --git a/settings.gradle.kts b/settings.gradle.kts index 5c2ad46..d13a582 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -16,10 +16,21 @@ * ProjectName mingli-utils * ModuleName mingli-utils * CurrentFile settings.gradle.kts - * LastUpdate 2026-02-07 17:00:59 + * LastUpdate 2026-02-26 10:52:01 * UpdateUser MingLiPro */ -include("jdk8") +plugins { + id("com.gradleup.nmcp.settings").version("1.4.4") +} + val ARTIFACTID: String by settings.extra rootProject.name = ARTIFACTID + +nmcpSettings { + centralPortal { + username = System.getenv("sonatype.username") + password = System.getenv("sonatype.password") + publishingType = "AUTOMATIC" + } +} diff --git a/src/main/kotlin/com/mingliqiye/utils/annotation/TestAnnotation.kt b/src/main/java/com/mingliqiye/utils/json/Jackson3ApiJavaHelper.java similarity index 61% rename from src/main/kotlin/com/mingliqiye/utils/annotation/TestAnnotation.kt rename to src/main/java/com/mingliqiye/utils/json/Jackson3ApiJavaHelper.java index 75cfb13..ebb260f 100644 --- a/src/main/kotlin/com/mingliqiye/utils/annotation/TestAnnotation.kt +++ b/src/main/java/com/mingliqiye/utils/json/Jackson3ApiJavaHelper.java @@ -15,17 +15,18 @@ * * ProjectName mingli-utils * ModuleName mingli-utils.main - * CurrentFile TestAnnotation.kt - * LastUpdate 2026-02-07 08:44:25 + * CurrentFile Jackson3ApiJavaHelper.java + * LastUpdate 2026-02-26 12:02:13 * UpdateUser MingLiPro */ -package com.mingliqiye.utils.annotation +package com.mingliqiye.utils.json; -@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY) -@Retention(AnnotationRetention.SOURCE) -annotation class TestAnnotation(val value: String = "test") +import tools.jackson.databind.ObjectMapper; +import tools.jackson.databind.cfg.MapperBuilder; -@Target(AnnotationTarget.FIELD) -@Retention(AnnotationRetention.SOURCE) -annotation class TestFieldAnnotation(val required: Boolean = true) +public class Jackson3ApiJavaHelper { + static MapperBuilder rebuild(ObjectMapper objectMapper) { + return objectMapper.rebuild(); + } +} diff --git a/src/main/java/com/mingliqiye/utils/main/Main.java b/src/main/java/com/mingliqiye/utils/main/Main.java new file mode 100644 index 0000000..4b5a611 --- /dev/null +++ b/src/main/java/com/mingliqiye/utils/main/Main.java @@ -0,0 +1,120 @@ +/* + * Copyright 2026 mingliqiye + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ProjectName mingli-utils + * ModuleName mingli-utils.main + * CurrentFile Main.java + * LastUpdate 2026-02-26 15:04:49 + * UpdateUser MingLiPro + */ + +package com.mingliqiye.utils.main; + +import java.io.IOException; +import java.io.InputStream; +import java.lang.management.ManagementFactory; +import java.net.InetAddress; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; + +public class Main { + public final static String BANNER = + "| $$\\ $$\\ $$\\ $$\\ $$\\ $$$$$$$$\\ $$$$$$\\ \n" + + "| $$$\\ $$$ |$$ | $$ | $$ |\\__$$ __|$$ __$$\\ \n" + + "| $$$$\\ $$$$ |$$ | $$ | $$ | $$ | $$ / \\__| \n" + + "| $$\\$$\\$$ $$ |$$ | $$ | $$ | $$ | \\$$$$$$\\ \n" + + "| $$ \\$$$ $$ |$$ | $$ | $$ | $$ | \\____$$\\ \n" + + "| $$ |\\$ /$$ |$$ | $$ | $$ | $$ | $$\\ $$ | \n" + + "| $$ | \\_/ $$ |$$$$$$$$\\\\$$$$$$ | $$ | \\$$$$$$ \n" + + "| \\__| \\__|\\________|\\______/ \\__| \\______/ \n|\n"; + + public static void main(String[] args) { + try { + printb(); + } catch (IOException ignored) { + } + } + + public static String getPid() { + try { + var name = ManagementFactory.getRuntimeMXBean().getName(); + var index = name.indexOf('@'); + if (index > 0) { + return name.substring(0, index); + } else { + return "-1"; + } + } catch (Exception e) { + return "-1"; + } + } + + public static String getComputerName() { + try { + var name = System.getenv("COMPUTERNAME"); + if (name == null || name.isEmpty()) { + name = System.getenv("HOSTNAME"); + } + if (name == null || name.isEmpty()) { + name = InetAddress.getLocalHost().getHostName(); + } + return name != null ? name : "unknown"; + } catch (Exception e) { + return "unknown"; + } + } + + public static String getUserName() { + try { + String user = System.getenv("USERNAME"); + + if (user == null || user.isEmpty()) { + user = System.getenv("USER"); + } + if (user == null || user.isEmpty()) { + user = System.getenv("user.name"); + } + if (user == null || user.isEmpty()) { + user = "unknown"; + } + return user; + } catch (Exception e) { + return "unknown"; + } + } + + + public static void printb() throws IOException { + InputStream inputStream = Main.class.getResourceAsStream("/META-INF/meta-data"); + if (inputStream == null) return; + String data = new String(inputStream.readAllBytes()); + inputStream.close(); + StringBuilder sb = new StringBuilder(BANNER); + for (String sz : data.split("\n")) { + var d = sz.split("="); + sb.append("| -> ").append(d[0]).append(": ").append(d[1]).append("\n"); + } + sb.append("| -> jdkVersion: ").append(System.getProperty("java.specification.version")).append("\n"); + sb.append("| -> pid: ").append(getPid()).append("\n"); + sb.append("| -> computerName: ").append(getComputerName()).append("\n"); + sb.append("| -> userName: ").append(getUserName()).append("\n"); + sb.append("| -> time: ") + .append(LocalDateTime.now() + .format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSSSSSS"))) + .append("\n"); + System.out.println(); + System.out.println(sb); + } +} diff --git a/src/main/kotlin/com/mingliqiye/utils/aes/AesUtils.kt b/src/main/kotlin/com/mingliqiye/utils/aes/AesUtils.kt index 7861276..ae00490 100644 --- a/src/main/kotlin/com/mingliqiye/utils/aes/AesUtils.kt +++ b/src/main/kotlin/com/mingliqiye/utils/aes/AesUtils.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025 mingliqiye + * Copyright 2026 mingliqiye * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ * ProjectName mingli-utils * ModuleName mingli-utils.main * CurrentFile AesUtils.kt - * LastUpdate 2025-09-19 21:35:53 + * LastUpdate 2026-03-11 08:46:40 * UpdateUser MingLiPro */ @@ -25,7 +25,7 @@ package com.mingliqiye.utils.aes -import com.mingliqiye.utils.base.BASE64 +import com.mingliqiye.utils.base.code.Base64 import java.nio.charset.StandardCharsets import java.security.GeneralSecurityException import java.security.MessageDigest @@ -71,8 +71,8 @@ fun encrypt(sSrc: String, sKey: String?): String? { val encrypted = cipher.doFinal( sSrc.toByteArray(StandardCharsets.UTF_8) ) - return BASE64.encode( - "${BASE64.encode(iv)}:${BASE64.encode(encrypted)}".toByteArray() + return Base64.encode( + "${Base64.encode(iv)}:${Base64.encode(encrypted)}".toByteArray() ) } @@ -85,13 +85,13 @@ fun encrypt(sSrc: String, sKey: String?): String? { fun decrypt(sSrc: String, sKey: String): String? { try { // 分割IV和加密数据 - val sSrcs = String(BASE64.decode(sSrc)) + val sSrcs = String(Base64.decode(sSrc)) val parts: Array = sSrcs.split(":".toRegex(), limit = 2).toTypedArray() if (parts.size != 2) { return null } - val iv = BASE64.decode(parts[0]!!) - val encryptedData = BASE64.decode(parts[1]!!) + val iv = Base64.decode(parts[0]!!) + val encryptedData = Base64.decode(parts[1]!!) if (iv.size != GCM_IV_LENGTH) { return null } @@ -121,4 +121,3 @@ private fun createSecretKey(sKey: String): SecretKeySpec { val digest = md.digest(key) return SecretKeySpec(digest, ALGORITHM) } - diff --git a/src/main/kotlin/com/mingliqiye/utils/annotation/processor/AutoServiceProcessor.kt b/src/main/kotlin/com/mingliqiye/utils/annotation/processor/AutoServiceProcessor.kt index aa549a9..5e107ff 100644 --- a/src/main/kotlin/com/mingliqiye/utils/annotation/processor/AutoServiceProcessor.kt +++ b/src/main/kotlin/com/mingliqiye/utils/annotation/processor/AutoServiceProcessor.kt @@ -16,14 +16,13 @@ * ProjectName mingli-utils * ModuleName mingli-utils.main * CurrentFile AutoServiceProcessor.kt - * LastUpdate 2026-02-08 01:24:16 + * LastUpdate 2026-03-11 08:46:40 * UpdateUser MingLiPro */ package com.mingliqiye.utils.annotation.processor import com.mingliqiye.utils.annotation.AutoService -import com.mingliqiye.utils.io.IO.println import javax.annotation.processing.AbstractProcessor import javax.annotation.processing.ProcessingEnvironment import javax.annotation.processing.RoundEnvironment @@ -42,7 +41,7 @@ class AutoServiceProcessor : AbstractProcessor() { override fun process( annotations: Set, - roundEnv: RoundEnvironment + roundEnv: RoundEnvironment, ): Boolean { val service = mutableMapOf>() diff --git a/src/main/kotlin/com/mingliqiye/utils/array/ArrayUtils.kt b/src/main/kotlin/com/mingliqiye/utils/array/ArrayUtils.kt index 2aa5150..3bbb2e9 100644 --- a/src/main/kotlin/com/mingliqiye/utils/array/ArrayUtils.kt +++ b/src/main/kotlin/com/mingliqiye/utils/array/ArrayUtils.kt @@ -16,7 +16,7 @@ * ProjectName mingli-utils * ModuleName mingli-utils.main * CurrentFile ArrayUtils.kt - * LastUpdate 2026-02-06 14:01:56 + * LastUpdate 2026-03-11 08:42:08 * UpdateUser MingLiPro */ @@ -25,7 +25,7 @@ package com.mingliqiye.utils.array -import com.mingliqiye.utils.base.BASE16 +import com.mingliqiye.utils.base.code.Base16 /** @@ -35,7 +35,7 @@ import com.mingliqiye.utils.base.BASE16 * @since 4.6.0 * @see toHexByteArray */ -fun ByteArray.toHexString(): String = BASE16.encode(this).uppercase() +fun ByteArray.toHexString(): String = Base16.encode(this).uppercase() /** * 将十六进制字符串转换为字节数组 @@ -45,9 +45,7 @@ fun ByteArray.toHexString(): String = BASE16.encode(this).uppercase() * @since 4.6.0 * @see toHexString */ -fun String.toHexByteArray(): ByteArray = BASE16.decode(this.lowercase()) - -/* ==================== 数组复制扩展函数 ==================== */ +fun String.toHexByteArray(): ByteArray = Base16.decode(this.lowercase()) /** * 将当前数组的指定范围复制到目标数组 diff --git a/src/main/kotlin/com/mingliqiye/utils/base/BaseCodec.kt b/src/main/kotlin/com/mingliqiye/utils/base/BaseCodec.kt index 5ef033e..4a176bd 100644 --- a/src/main/kotlin/com/mingliqiye/utils/base/BaseCodec.kt +++ b/src/main/kotlin/com/mingliqiye/utils/base/BaseCodec.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025 mingliqiye + * Copyright 2026 mingliqiye * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,158 +16,163 @@ * ProjectName mingli-utils * ModuleName mingli-utils.main * CurrentFile BaseCodec.kt - * LastUpdate 2025-09-18 14:07:35 + * LastUpdate 2026-02-09 19:58:29 * UpdateUser MingLiPro */ package com.mingliqiye.utils.base +import com.mingliqiye.utils.exception.CodecException import java.io.File -import java.io.IOException import java.nio.file.Path +/** + * BaseCodec 接口定义了一组用于编码和解码数据的基本方法。 + * 提供了对字节数组、字符串、文件和路径的编码与解码功能, + * 并支持安全操作(在发生异常时返回默认值或布尔状态)。 + */ interface BaseCodec { + /** - * 将字节数组编码为Base64字符串 + * 对字节数组进行编码,并捕获可能发生的异常。 * * @param bytes 需要编码的字节数组 - * @return 编码后的Base64字符串 + * @return 编码后的字符串结果 + * @throws CodecException 如果编码过程中发生异常 + */ + fun catchEncode(bytes: ByteArray) = try { + encode(bytes) + } catch (e: Exception) { + throw CodecException(e) + } + + /** + * 对字符串进行解码,并捕获可能发生的异常。 + * + * @param string 需要解码的字符串 + * @return 解码后的字节数组结果 + * @throws CodecException 如果解码过程中发生异常 + */ + fun catchDecode(string: String) = try { + decode(string) + } catch (e: Exception) { + throw CodecException(e) + } + + /** + * 将字节数组编码为字符串。 + * + * @param bytes 需要编码的字节数组 + * @return 编码后的字符串结果 */ fun encode(bytes: ByteArray): String /** - * 将Base64字符串解码为字节数组 + * 将字符串解码为字节数组。 * - * @param string 需要解码的Base64字符串 - * @return 解码后的字节数组 + * @param string 需要解码的字符串 + * @return 解码后的字节数组结果 */ fun decode(string: String): ByteArray /** - * 将文件内容编码为Base64字符串 + * 对文件内容进行编码。 * - * @param file 需要编码的文件 - * @return 文件内容的Base64编码字符串 - * @throws IOException 当文件读取失败时抛出 + * @param file 需要编码的文件对象 + * @return 文件内容编码后的字符串结果 */ - @Throws(IOException::class) - fun encode(file: File): String { - return encode(file.readBytes()) + fun encode(file: File) = catchEncode(file.readBytes()) + + /** + * 将字符串解码后写入指定文件。 + * + * @param file 目标文件对象 + * @param string 需要解码的字符串 + */ + fun decode(file: File, string: String) = + file.writeBytes(catchDecode(string)) + + /** + * 安全地对文件内容进行编码,如果发生异常则返回 null。 + * + * @param file 需要编码的文件对象 + * @return 文件内容编码后的字符串结果,若失败则返回 null + */ + fun encodeSafe(file: File) = try { + encode(file) + } catch (_: Exception) { + null } /** - * 将Base64字符串解码并写入文件 + * 安全地将字符串解码并写入指定文件,如果成功则返回 true,否则返回 false。 * - * @param file 目标文件 - * @param string 需要解码的Base64字符串 - * @throws IOException 当文件写入失败时抛出 + * @param file 目标文件对象 + * @param string 需要解码的字符串 + * @return 操作是否成功的布尔值 */ - @Throws(IOException::class) - fun decode(file: File, string: String) { - file.writeBytes(decode(string)) + fun decodeSafe(file: File, string: String) = try { + decode(file, string) + true + } catch (_: Exception) { + false } /** - * 安全地将文件内容编码为Base64字符串,出现异常时返回null - * - * @param file 需要编码的文件 - * @return 文件内容的Base64编码字符串,失败时返回null - */ - fun encodeSafe(file: File): String? { - return try { - encode(file) - } catch (_: Exception) { - null - } - } - - /** - * 安全地将Base64字符串解码并写入文件,返回操作是否成功 - * - * @param file 目标文件 - * @param string 需要解码的Base64字符串 - * @return 操作成功返回true,失败返回false - */ - fun decodeSafe(file: File, string: String): Boolean { - return try { - decode(file, string) - true - } catch (_: Exception) { - false - } - } - - /** - * 将路径对应的文件内容编码为Base64字符串 + * 对路径指向的文件内容进行编码。 * * @param path 需要编码的文件路径 - * @return 文件内容的Base64编码字符串 - * @throws IOException 当文件读取失败时抛出 + * @return 文件内容编码后的字符串结果 */ - @Throws(IOException::class) - fun encode(path: Path): String { - return encode(path.toFile().readBytes()) - } + fun encode(path: Path) = catchEncode(path.toFile().readBytes()) /** - * 将Base64字符串解码并写入路径指定的文件 + * 将字符串解码后写入指定路径的文件。 * * @param path 目标文件路径 - * @param string 需要解码的Base64字符串 - * @throws IOException 当文件写入失败时抛出 + * @param string 需要解码的字符串 */ - @Throws(IOException::class) - fun decode(path: Path, string: String) { - path.toFile().writeBytes(decode(string)) - } + fun decode(path: Path, string: String) = path.toFile().writeBytes(catchDecode(string)) /** - * 安全地将路径对应的文件内容编码为Base64字符串,出现异常时返回null + * 安全地对路径指向的文件内容进行编码,如果发生异常则返回 null。 * * @param path 需要编码的文件路径 - * @return 文件内容的Base64编码字符串,失败时返回null + * @return 文件内容编码后的字符串结果,若失败则返回 null */ - fun encodeSafe(path: Path): String? { - return try { - encode(path) - } catch (_: Exception) { - null - } + fun encodeSafe(path: Path) = try { + encode(path) + } catch (_: Exception) { + null } /** - * 安全地将Base64字符串解码并写入路径指定的文件,返回操作是否成功 + * 安全地将字符串解码并写入指定路径的文件,如果成功则返回 true,否则返回 false。 * * @param path 目标文件路径 - * @param string 需要解码的Base64字符串 - * @return 操作成功返回true,失败返回false + * @param string 需要解码的字符串 + * @return 操作是否成功的布尔值 */ - fun decodeSafe(path: Path, string: String): Boolean { - return try { - decode(path, string) - true - } catch (_: Exception) { - false - } + fun decodeSafe(path: Path, string: String) = try { + decode(path, string) + true + } catch (_: Exception) { + false } /** - * 将字符串编码为Base64字符串 + * 对字符串进行编码。 * * @param string 需要编码的字符串 - * @return 编码后的Base64字符串 + * @return 编码后的字符串结果 */ - fun encode(string: String): String { - return encode(string.toByteArray()) - } + fun encode(string: String) = catchEncode(string.toByteArray()) /** - * 将Base64字符串解码为字符串 + * 将字符串解码为 UTF-8 格式的字符串。 * - * @param string 需要解码的Base64字符串 - * @return 解码后的字符串 + * @param string 需要解码的字符串 + * @return 解码后的 UTF-8 字符串结果 */ - fun decodetoString(string: String): String { - return decode(string).toString(Charsets.UTF_8) - } + fun decodetoString(string: String) = catchDecode(string).toString(Charsets.UTF_8) } diff --git a/src/main/kotlin/com/mingliqiye/utils/base/BaseType.kt b/src/main/kotlin/com/mingliqiye/utils/base/BaseType.kt index 87882ec..dc2af4e 100644 --- a/src/main/kotlin/com/mingliqiye/utils/base/BaseType.kt +++ b/src/main/kotlin/com/mingliqiye/utils/base/BaseType.kt @@ -16,15 +16,29 @@ * ProjectName mingli-utils * ModuleName mingli-utils.main * CurrentFile BaseType.kt - * LastUpdate 2026-02-04 21:54:04 + * LastUpdate 2026-02-09 19:54:38 * UpdateUser MingLiPro */ package com.mingliqiye.utils.base -enum class BaseType(val baseCodec: BaseCodec) { - BASE16(com.mingliqiye.utils.base.BASE16), - BASE64(com.mingliqiye.utils.base.BASE64), - BASE91(com.mingliqiye.utils.base.BASE91), - BASE256(com.mingliqiye.utils.base.BASE256), +import com.mingliqiye.utils.base.code.Base10 +import com.mingliqiye.utils.base.code.Base16 +import com.mingliqiye.utils.base.code.Base2 +import com.mingliqiye.utils.base.code.Base256 +import com.mingliqiye.utils.base.code.Base64 +import com.mingliqiye.utils.base.code.Base91 + +enum class BaseType(val baseCodec: BaseCodec) : BaseCodec { + + BASE2(Base2), + BASE10(Base10), + BASE16(Base16), + BASE64(Base64), + BASE91(Base91), + BASE256(Base256); + + override fun encode(bytes: ByteArray) = baseCodec.encode(bytes) + override fun decode(string: String) = baseCodec.decode(string) + } diff --git a/src/main/kotlin/com/mingliqiye/utils/base/BaseUtils.kt b/src/main/kotlin/com/mingliqiye/utils/base/BaseUtils.kt deleted file mode 100644 index 1960288..0000000 --- a/src/main/kotlin/com/mingliqiye/utils/base/BaseUtils.kt +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2026 mingliqiye - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ProjectName mingli-utils - * ModuleName mingli-utils.main - * CurrentFile BaseUtils.kt - * LastUpdate 2026-02-08 03:00:37 - * UpdateUser MingLiPro - */ - -@file:JvmName("BaseUtils") - -package com.mingliqiye.utils.base - -import com.mingliqiye.utils.base.code.Base10 -import com.mingliqiye.utils.base.code.Base16 -import com.mingliqiye.utils.base.code.Base256 -import com.mingliqiye.utils.base.code.Base64 -import com.mingliqiye.utils.base.code.Base91 - - -@Deprecated( - "重命名", replaceWith = ReplaceWith( - expression = "Base10", imports = ["com.mingliqiye.utils.base.code"] - ) -) -val BASE10: BaseCodec - get() = Base10 - -@Deprecated( - "重命名", replaceWith = ReplaceWith( - expression = "Base16", imports = ["com.mingliqiye.utils.base.code"] - ) -) -val BASE16: BaseCodec - get() = Base16 - -@Deprecated( - "重命名", replaceWith = ReplaceWith( - expression = "Base64", imports = ["com.mingliqiye.utils.base.code"] - ) -) -val BASE64: BaseCodec - get() = Base64 - -@Deprecated( - "重命名", replaceWith = ReplaceWith( - expression = "Base91", imports = ["com.mingliqiye.utils.base.code"] - ) -) -val BASE91: BaseCodec - get() = Base91 - -@Deprecated( - "重命名", replaceWith = ReplaceWith( - expression = "Base256", imports = ["com.mingliqiye.utils.base.code"] - ) -) -val BASE256: BaseCodec - get() = Base256 diff --git a/src/main/kotlin/com/mingliqiye/utils/bytes/ByteBufferUtils.kt b/src/main/kotlin/com/mingliqiye/utils/bytes/ByteBufferUtils.kt index 551e3e8..1a3a92b 100644 --- a/src/main/kotlin/com/mingliqiye/utils/bytes/ByteBufferUtils.kt +++ b/src/main/kotlin/com/mingliqiye/utils/bytes/ByteBufferUtils.kt @@ -16,7 +16,7 @@ * ProjectName mingli-utils * ModuleName mingli-utils.main * CurrentFile ByteBufferUtils.kt - * LastUpdate 2026-01-11 09:44:19 + * LastUpdate 2026-03-11 08:46:40 * UpdateUser MingLiPro */ @@ -26,6 +26,7 @@ package com.mingliqiye.utils.bytes import java.io.IOException import java.io.OutputStream +import java.nio.BufferUnderflowException import java.nio.ByteBuffer import java.nio.charset.Charset diff --git a/src/main/kotlin/com/mingliqiye/utils/bytes/ByteConvertible.kt b/src/main/kotlin/com/mingliqiye/utils/bytes/ByteConvertible.kt new file mode 100644 index 0000000..fed6c88 --- /dev/null +++ b/src/main/kotlin/com/mingliqiye/utils/bytes/ByteConvertible.kt @@ -0,0 +1,50 @@ +/* + * Copyright 2026 mingliqiye + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ProjectName mingli-utils + * ModuleName mingli-utils.main + * CurrentFile ByteConvertible.kt + * LastUpdate 2026-02-08 10:25:22 + * UpdateUser MingLiPro + */ + +package com.mingliqiye.utils.bytes + +import java.io.OutputStream +import java.io.Serializable +import java.nio.ByteBuffer + +interface ByteConvertible : Serializable { + + fun toBytes(): ByteArray + + fun writeToStream(outputStream: OutputStream) { + outputStream.write(toBytes()) + } + + fun putToByteBuffer(byteBuffer: ByteBuffer) { + byteBuffer.put(toBytes()) + } + + companion object { + fun OutputStream.write(byteConvertible: ByteConvertible) { + byteConvertible.writeToStream(this) + } + + fun ByteBuffer.put(byteConvertible: ByteConvertible) { + byteConvertible.putToByteBuffer(this) + } + } +} diff --git a/src/main/kotlin/com/mingliqiye/utils/bytes/ByteUtils.kt b/src/main/kotlin/com/mingliqiye/utils/bytes/ByteUtils.kt index 8a9c844..d9402ab 100644 --- a/src/main/kotlin/com/mingliqiye/utils/bytes/ByteUtils.kt +++ b/src/main/kotlin/com/mingliqiye/utils/bytes/ByteUtils.kt @@ -16,14 +16,14 @@ * ProjectName mingli-utils * ModuleName mingli-utils.main * CurrentFile ByteUtils.kt - * LastUpdate 2026-01-14 13:01:44 + * LastUpdate 2026-03-11 08:46:40 * UpdateUser MingLiPro */ @file:JvmName("ByteUtils") package com.mingliqiye.utils.bytes -import com.mingliqiye.utils.base.BASE16 +import com.mingliqiye.utils.base.code.Base16 import com.mingliqiye.utils.stream.SuperStream /** @@ -125,5 +125,5 @@ fun hexStringToByteArray(string: String): ByteArray { * @return 对应的十六进制字符串 */ fun bytesToHex(bytes: ByteArray): String { - return BASE16.encode(bytes) + return Base16.encode(bytes) } diff --git a/src/main/kotlin/com/mingliqiye/utils/clone/CloneUtils.kt b/src/main/kotlin/com/mingliqiye/utils/clone/CloneUtils.kt index bb69204..8a75b2d 100644 --- a/src/main/kotlin/com/mingliqiye/utils/clone/CloneUtils.kt +++ b/src/main/kotlin/com/mingliqiye/utils/clone/CloneUtils.kt @@ -16,7 +16,7 @@ * ProjectName mingli-utils * ModuleName mingli-utils.main * CurrentFile CloneUtils.kt - * LastUpdate 2026-02-05 14:41:27 + * LastUpdate 2026-02-08 10:36:51 * UpdateUser MingLiPro */ @file:JvmName("CloneUtils") @@ -24,17 +24,18 @@ package com.mingliqiye.utils.clone import com.mingliqiye.utils.exception.JsonException -import com.mingliqiye.utils.json.api.base.JsonApi +import com.mingliqiye.utils.json.api.JSONA import java.io.* -inline fun Serializable.deepClone(): T { - return deepClone(this) as T +@JvmName("_inline_deepClone") +inline fun T.deepClone(): T { + return deepClone(this) } -inline fun T.deepJsonClone(jsonApi: JsonApi): T { +inline fun T.deepJsonClone(): T { try { - return jsonApi.convert(this as Any, this!!.javaClass) as T + return JSONA.convert(this as Any, this!!.javaClass) as T } catch (e: Exception) { throw JsonException( "Failed to deep clone object using JSON", e diff --git a/src/main/kotlin/com/mingliqiye/utils/exception/CodecException.kt b/src/main/kotlin/com/mingliqiye/utils/exception/CodecException.kt new file mode 100644 index 0000000..8e90e99 --- /dev/null +++ b/src/main/kotlin/com/mingliqiye/utils/exception/CodecException.kt @@ -0,0 +1,36 @@ +/* + * Copyright 2026 mingliqiye + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ProjectName mingli-utils + * ModuleName mingli-utils.main + * CurrentFile CodecException.kt + * LastUpdate 2026-02-09 19:52:21 + * UpdateUser MingLiPro + */ + +package com.mingliqiye.utils.exception + +class CodecException : MingLiUtilsBaseException { + constructor() + constructor(message: String) : super(message) + constructor(throwable: Throwable) : super(throwable) + constructor(message: String, throwable: Throwable) : super(message, throwable) + constructor( + message: String? = null, + throwable: Throwable? = null, + enableSuppression: Boolean = false, + writableStackTrace: Boolean = false + ) : super(message, throwable, enableSuppression, writableStackTrace) +} diff --git a/src/main/kotlin/com/mingliqiye/utils/exception/HttpStatusException.kt b/src/main/kotlin/com/mingliqiye/utils/exception/HttpStatusException.kt index 0c35236..ae1d106 100644 --- a/src/main/kotlin/com/mingliqiye/utils/exception/HttpStatusException.kt +++ b/src/main/kotlin/com/mingliqiye/utils/exception/HttpStatusException.kt @@ -16,7 +16,7 @@ * ProjectName mingli-utils * ModuleName mingli-utils.main * CurrentFile HttpStatusException.kt - * LastUpdate 2026-02-05 14:55:04 + * LastUpdate 2026-02-10 01:12:53 * UpdateUser MingLiPro */ @@ -29,7 +29,7 @@ package com.mingliqiye.utils.exception * @param message 异常信息,默认为 null * @param cause 异常原因,默认为 null */ -sealed class HttpStatusException( +open class HttpStatusException( open val statusCode: Int, override val message: String? = null, override val cause: Throwable? = null diff --git a/src/main/kotlin/com/mingliqiye/utils/exception/HttpUrlException.kt b/src/main/kotlin/com/mingliqiye/utils/exception/HttpUrlException.kt index e8d88d8..f01a091 100644 --- a/src/main/kotlin/com/mingliqiye/utils/exception/HttpUrlException.kt +++ b/src/main/kotlin/com/mingliqiye/utils/exception/HttpUrlException.kt @@ -16,13 +16,13 @@ * ProjectName mingli-utils * ModuleName mingli-utils.main * CurrentFile HttpUrlException.kt - * LastUpdate 2026-02-05 15:21:48 + * LastUpdate 2026-03-11 08:46:40 * UpdateUser MingLiPro */ package com.mingliqiye.utils.exception -open class HttpUrlException : HttpException { +open class HttpUrlException : MingLiUtilsBaseException { constructor() constructor(message: String) : super(message) constructor(throwable: Throwable) : super(throwable) @@ -31,6 +31,6 @@ open class HttpUrlException : HttpException { message: String? = null, throwable: Throwable? = null, enableSuppression: Boolean = false, - writableStackTrace: Boolean = false + writableStackTrace: Boolean = false, ) : super(message, throwable, enableSuppression, writableStackTrace) } diff --git a/src/main/kotlin/com/mingliqiye/utils/exception/JsonObjectCastException.kt b/src/main/kotlin/com/mingliqiye/utils/exception/JsonObjectCastException.kt index 848c187..569d86f 100644 --- a/src/main/kotlin/com/mingliqiye/utils/exception/JsonObjectCastException.kt +++ b/src/main/kotlin/com/mingliqiye/utils/exception/JsonObjectCastException.kt @@ -16,7 +16,7 @@ * ProjectName mingli-utils * ModuleName mingli-utils.main * CurrentFile JsonObjectCastException.kt - * LastUpdate 2026-02-07 15:11:42 + * LastUpdate 2026-02-09 19:52:21 * UpdateUser MingLiPro */ diff --git a/src/main/kotlin/com/mingliqiye/utils/foreach/ForEach.kt b/src/main/kotlin/com/mingliqiye/utils/foreach/ForEach.kt index 0d7c5c2..bc67494 100644 --- a/src/main/kotlin/com/mingliqiye/utils/foreach/ForEach.kt +++ b/src/main/kotlin/com/mingliqiye/utils/foreach/ForEach.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025 mingliqiye + * Copyright 2026 mingliqiye * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ * ProjectName mingli-utils * ModuleName mingli-utils.main * CurrentFile ForEach.kt - * LastUpdate 2025-09-15 12:44:46 + * LastUpdate 2026-02-27 12:45:39 * UpdateUser MingLiPro */ @file:JvmName("ForEach") @@ -58,10 +58,8 @@ fun forEach( else -> { // 对于其他类型的可迭代对象,使用增强 for 循环并手动维护索引 - var index = 0 - for (element in iterable) { + for ((index, element) in iterable.withIndex()) { action.call(element, index) - index++ } } } diff --git a/src/main/kotlin/com/mingliqiye/utils/functions/Pipeline.kt b/src/main/kotlin/com/mingliqiye/utils/functions/Pipeline.kt index 2b44ca9..ab9e47e 100644 --- a/src/main/kotlin/com/mingliqiye/utils/functions/Pipeline.kt +++ b/src/main/kotlin/com/mingliqiye/utils/functions/Pipeline.kt @@ -16,14 +16,14 @@ * ProjectName mingli-utils * ModuleName mingli-utils.main * CurrentFile Pipeline.kt - * LastUpdate 2026-02-05 15:22:21 + * LastUpdate 2026-02-24 09:10:26 * UpdateUser MingLiPro */ package com.mingliqiye.utils.functions import com.mingliqiye.utils.require.Require -import java.util.* +import kotlin.reflect.KClass /** * 流水线操作类,提供链式调用的操作方式来处理数据转换和操作 @@ -112,6 +112,7 @@ class Pipeline(private val value: T) { * @throws ClassCastException 当类型转换失败时抛出异常 */ @Throws(ClassCastException::class) + @Suppress("UNCHECKED_CAST") fun cast(type: Class): Pipeline = Pipeline(value as E) /** @@ -160,7 +161,7 @@ class Pipeline(private val value: T) { fun require( any: Any, message: String, exception: Class = IllegalArgumentException::class.java ): Pipeline { - Require.require(Objects.equals(any, value), message, exception) + Require.require(any == value, message, exception) return this } @@ -174,7 +175,7 @@ class Pipeline(private val value: T) { fun require( any: Any, message: String ): Pipeline { - Require.RequireLayz.require(any == value, message) + Require.require(any == value, message) return this } @@ -194,6 +195,38 @@ class Pipeline(private val value: T) { return this } + /** + * 验证当前值是否等于指定值,如果不相等则抛出异常 + * @param any 比较的目标值 + * @param message 错误消息 + * @param exception 异常类型,默认为IllegalArgumentException + * @return 当前Pipeline实例 + */ + fun require( + any: Any, + message: String, + exception: KClass = IllegalArgumentException::class + ): Pipeline { + Require.require(any == value, message, exception) + return this + } + + /** + * 使用P1RFunction验证当前值是否满足条件,不满足则抛出异常 + * @param must 验证条件函数 + * @param message 错误消息 + * @param exception 异常类型,默认为IllegalArgumentException + * @return 当前Pipeline实例 + */ + fun require( + must: P1RFunction, + message: String, + exception: KClass = IllegalArgumentException::class + ): Pipeline { + Require.require(must.call(value), message, exception) + return this + } + /** * 使用P1RFunction验证当前值是否满足条件,不满足则抛出IllegalArgumentException异常 * @param must 验证条件函数 diff --git a/src/main/kotlin/com/mingliqiye/utils/http/MediaType.kt b/src/main/kotlin/com/mingliqiye/utils/http/MediaType.kt new file mode 100644 index 0000000..ca1fd40 --- /dev/null +++ b/src/main/kotlin/com/mingliqiye/utils/http/MediaType.kt @@ -0,0 +1,2278 @@ +/* + * Copyright 2026 mingliqiye + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ProjectName mingli-utils + * ModuleName mingli-utils.main + * CurrentFile MediaType.kt + * LastUpdate 2026-03-11 08:46:40 + * UpdateUser MingLiPro + */ + +package com.mingliqiye.utils.http + +enum class MediaType(val value: String) { + APPLICATION_1D_INTERLEAVED_PARITYFEC("application/1d-interleaved-parityfec"), + APPLICATION_3GPDASH_QOE_REPORT_XML("application/3gpdash-qoe-report+xml"), + APPLICATION_3GPP_IMS_XML("application/3gpp-ims+xml"), + APPLICATION_3GPP_MBS_OBJECT_MANIFEST_JSON("application/3gpp-mbs-object-manifest+json"), + APPLICATION_3GPP_MBS_USER_SERVICE_DESCRIPTIONS_JSON("application/3gpp-mbs-user-service-descriptions+json"), + APPLICATION_3GPP_MEDIA_DELIVERY_METRICS_REPORT_JSON("application/3gpp-media-delivery-metrics-report+json"), + APPLICATION_3GPPHAL_JSON("application/3gppHal+json"), + APPLICATION_3GPPHALFORMS_JSON("application/3gppHalForms+json"), + APPLICATION_AAS_ZIP("application/aas+zip"), + APPLICATION_A2L("application/A2L"), + APPLICATION_ACE_GROUPCOMM_CBOR("application/ace-groupcomm+cbor"), + APPLICATION_ACE_TRL_CBOR("application/ace-trl+cbor"), + APPLICATION_ACE_CBOR("application/ace+cbor"), + APPLICATION_ACE_JSON("application/ace+json"), + APPLICATION_ACTIVEMESSAGE("application/activemessage"), + APPLICATION_ACTIVITY_JSON("application/activity+json"), + APPLICATION_AIF_CBOR("application/aif+cbor"), + APPLICATION_AIF_JSON("application/aif+json"), + APPLICATION_ALTO_CDNI_JSON("application/alto-cdni+json"), + APPLICATION_ALTO_CDNIFILTER_JSON("application/alto-cdnifilter+json"), + APPLICATION_ALTO_COSTMAP_JSON("application/alto-costmap+json"), + APPLICATION_ALTO_COSTMAPFILTER_JSON("application/alto-costmapfilter+json"), + APPLICATION_ALTO_DIRECTORY_JSON("application/alto-directory+json"), + APPLICATION_ALTO_ENDPOINTPROP_JSON("application/alto-endpointprop+json"), + APPLICATION_ALTO_ENDPOINTPROPPARAMS_JSON("application/alto-endpointpropparams+json"), + APPLICATION_ALTO_ENDPOINTCOST_JSON("application/alto-endpointcost+json"), + APPLICATION_ALTO_ENDPOINTCOSTPARAMS_JSON("application/alto-endpointcostparams+json"), + APPLICATION_ALTO_ERROR_JSON("application/alto-error+json"), + APPLICATION_ALTO_NETWORKMAPFILTER_JSON("application/alto-networkmapfilter+json"), + APPLICATION_ALTO_NETWORKMAP_JSON("application/alto-networkmap+json"), + APPLICATION_ALTO_PROPMAP_JSON("application/alto-propmap+json"), + APPLICATION_ALTO_PROPMAPPARAMS_JSON("application/alto-propmapparams+json"), + APPLICATION_ALTO_TIPS_JSON("application/alto-tips+json"), + APPLICATION_ALTO_TIPSPARAMS_JSON("application/alto-tipsparams+json"), + APPLICATION_ALTO_UPDATESTREAMCONTROL_JSON("application/alto-updatestreamcontrol+json"), + APPLICATION_ALTO_UPDATESTREAMPARAMS_JSON("application/alto-updatestreamparams+json"), + APPLICATION_AML("application/AML"), + APPLICATION_ANDREW_INSET("application/andrew-inset"), + APPLICATION_APPLEFILE("application/applefile"), + APPLICATION_ASYNCAPI_JSON("application/asyncapi+json"), + APPLICATION_ASYNCAPI_YAML("application/asyncapi+yaml"), + APPLICATION_AT_JWT("application/at+jwt"), + APPLICATION_ATF("application/ATF"), + APPLICATION_ATFX("application/ATFX"), + APPLICATION_ATOM_XML("application/atom+xml"), + APPLICATION_ATOMCAT_XML("application/atomcat+xml"), + APPLICATION_ATOMDELETED_XML("application/atomdeleted+xml"), + APPLICATION_ATOMICMAIL("application/atomicmail"), + APPLICATION_ATOMSVC_XML("application/atomsvc+xml"), + APPLICATION_ATSC_DWD_XML("application/atsc-dwd+xml"), + APPLICATION_ATSC_DYNAMIC_EVENT_MESSAGE("application/atsc-dynamic-event-message"), + APPLICATION_ATSC_HELD_XML("application/atsc-held+xml"), + APPLICATION_ATSC_RDT_JSON("application/atsc-rdt+json"), + APPLICATION_ATSC_RSAT_XML("application/atsc-rsat+xml"), + APPLICATION_ATXML("application/ATXML"), + APPLICATION_AUTH_POLICY_XML("application/auth-policy+xml"), + APPLICATION_AUTOMATIONML_AML_XML("application/automationml-aml+xml"), + APPLICATION_AUTOMATIONML_AMLX_ZIP("application/automationml-amlx+zip"), + APPLICATION_BACNET_XDD_ZIP("application/bacnet-xdd+zip"), + APPLICATION_BATCH_SMTP("application/batch-SMTP"), + APPLICATION_BEEP_XML("application/beep+xml"), + APPLICATION_BUFR("application/bufr"), + APPLICATION_C2PA("application/c2pa"), + APPLICATION_CALENDAR_JSON("application/calendar+json"), + APPLICATION_CALENDAR_XML("application/calendar+xml"), + APPLICATION_CALL_COMPLETION("application/call-completion"), + APPLICATION_CALS_1840("application/CALS-1840"), + APPLICATION_CAPTIVE_JSON("application/captive+json"), + APPLICATION_CBOR("application/cbor"), + APPLICATION_CBOR_SEQ("application/cbor-seq"), + APPLICATION_CCCEX("application/cccex"), + APPLICATION_CCMP_XML("application/ccmp+xml"), + APPLICATION_CCXML_XML("application/ccxml+xml"), + APPLICATION_CDA_XML("application/cda+xml"), + APPLICATION_CDFX_XML("application/CDFX+XML"), + APPLICATION_CDMI_CAPABILITY("application/cdmi-capability"), + APPLICATION_CDMI_CONTAINER("application/cdmi-container"), + APPLICATION_CDMI_DOMAIN("application/cdmi-domain"), + APPLICATION_CDMI_OBJECT("application/cdmi-object"), + APPLICATION_CDMI_QUEUE("application/cdmi-queue"), + APPLICATION_CDNI("application/cdni"), + APPLICATION_CE_CBOR("application/ce+cbor"), + APPLICATION_CEA("application/CEA"), + APPLICATION_CEA_2018_XML("application/cea-2018+xml"), + APPLICATION_CELLML_XML("application/cellml+xml"), + APPLICATION_CFW("application/cfw"), + APPLICATION_CID("application/cid"), + APPLICATION_CID_EDHOC_CBOR_SEQ("application/cid-edhoc+cbor-seq"), + APPLICATION_CITY_JSON("application/city+json"), + APPLICATION_CITY_JSON_SEQ("application/city+json-seq"), + APPLICATION_CLR("application/clr"), + APPLICATION_CLUE_INFO_XML("application/clue_info+xml"), + APPLICATION_CLUE_XML("application/clue+xml"), + APPLICATION_CMS("application/cms"), + APPLICATION_CMW_CBOR("application/cmw+cbor"), + APPLICATION_CMW_COSE("application/cmw+cose"), + APPLICATION_CMW_JSON("application/cmw+json"), + APPLICATION_CMW_JWS("application/cmw+jws"), + APPLICATION_CNRP_XML("application/cnrp+xml"), + APPLICATION_COAP_EAP("application/coap-eap"), + APPLICATION_COAP_GROUP_JSON("application/coap-group+json"), + APPLICATION_COAP_PAYLOAD("application/coap-payload"), + APPLICATION_COMMONGROUND("application/commonground"), + APPLICATION_CONCISE_PROBLEM_DETAILS_CBOR("application/concise-problem-details+cbor"), + APPLICATION_CONFERENCE_INFO_XML("application/conference-info+xml"), + APPLICATION_CPL_XML("application/cpl+xml"), + APPLICATION_COSE("application/cose"), + APPLICATION_COSE_KEY("application/cose-key"), + APPLICATION_COSE_KEY_SET("application/cose-key-set"), + APPLICATION_COSE_X509("application/cose-x509"), + APPLICATION_CSRATTRS("application/csrattrs"), + APPLICATION_CSTA_XML("application/csta+xml"), + APPLICATION_CSTADATA_XML("application/CSTAdata+xml"), + APPLICATION_CSVM_JSON("application/csvm+json"), + APPLICATION_CWL("application/cwl"), + APPLICATION_CWL_JSON("application/cwl+json"), + APPLICATION_CWL_YAML("application/cwl+yaml"), + APPLICATION_CWT("application/cwt"), + APPLICATION_CYBERCASH("application/cybercash"), + APPLICATION_DASH_XML("application/dash+xml"), + APPLICATION_DASH_PATCH_XML("application/dash-patch+xml"), + APPLICATION_DASHDELTA("application/dashdelta"), + APPLICATION_DAVMOUNT_XML("application/davmount+xml"), + APPLICATION_DCA_RFT("application/dca-rft"), + APPLICATION_DCD("application/DCD"), + APPLICATION_DEC_DX("application/dec-dx"), + APPLICATION_DIALOG_INFO_XML("application/dialog-info+xml"), + APPLICATION_DICOM("application/dicom"), + APPLICATION_DICOM_JSON("application/dicom+json"), + APPLICATION_DICOM_XML("application/dicom+xml"), + APPLICATION_DID("application/did"), + APPLICATION_DII("application/DII"), + APPLICATION_DIT("application/DIT"), + APPLICATION_DNS("application/dns"), + APPLICATION_DNS_JSON("application/dns+json"), + APPLICATION_DNS_MESSAGE("application/dns-message"), + APPLICATION_DOTS_CBOR("application/dots+cbor"), + APPLICATION_DPOP_JWT("application/dpop+jwt"), + APPLICATION_DSKPP_XML("application/dskpp+xml"), + APPLICATION_DSSC_DER("application/dssc+der"), + APPLICATION_DSSC_XML("application/dssc+xml"), + APPLICATION_DVCS("application/dvcs"), + APPLICATION_EAT_CWT("application/eat+cwt"), + APPLICATION_EAT_JWT("application/eat+jwt"), + APPLICATION_EAT_BUN_CBOR("application/eat-bun+cbor"), + APPLICATION_EAT_BUN_JSON("application/eat-bun+json"), + APPLICATION_EAT_UCS_CBOR("application/eat-ucs+cbor"), + APPLICATION_EAT_UCS_JSON("application/eat-ucs+json"), + APPLICATION_ECMASCRIPT("application/ecmascript"), + APPLICATION_EDHOC_CBOR_SEQ("application/edhoc+cbor-seq"), + APPLICATION_EDI_CONSENT("application/EDI-consent"), + APPLICATION_EDIFACT("application/EDIFACT"), + APPLICATION_EDI_X12("application/EDI-X12"), + APPLICATION_EFI("application/efi"), + APPLICATION_ELM_JSON("application/elm+json"), + APPLICATION_ELM_XML("application/elm+xml"), + APPLICATION_EMERGENCYCALLDATA_CAP_XML("application/EmergencyCallData.cap+xml"), + APPLICATION_EMERGENCYCALLDATA_COMMENT_XML("application/EmergencyCallData.Comment+xml"), + APPLICATION_EMERGENCYCALLDATA_CONTROL_XML("application/EmergencyCallData.Control+xml"), + APPLICATION_EMERGENCYCALLDATA_DEVICEINFO_XML("application/EmergencyCallData.DeviceInfo+xml"), + APPLICATION_EMERGENCYCALLDATA_ECALL_MSD("application/EmergencyCallData.eCall.MSD"), + APPLICATION_EMERGENCYCALLDATA_LEGACYESN_JSON("application/EmergencyCallData.LegacyESN+json"), + APPLICATION_EMERGENCYCALLDATA_PROVIDERINFO_XML("application/EmergencyCallData.ProviderInfo+xml"), + APPLICATION_EMERGENCYCALLDATA_SERVICEINFO_XML("application/EmergencyCallData.ServiceInfo+xml"), + APPLICATION_EMERGENCYCALLDATA_SUBSCRIBERINFO_XML("application/EmergencyCallData.SubscriberInfo+xml"), + APPLICATION_EMERGENCYCALLDATA_VEDS_XML("application/EmergencyCallData.VEDS+xml"), + APPLICATION_EMMA_XML("application/emma+xml"), + APPLICATION_EMOTIONML_XML("application/emotionml+xml"), + APPLICATION_ENCAPRTP("application/encaprtp"), + APPLICATION_ENTITY_STATEMENT_JWT("application/entity-statement+jwt"), + APPLICATION_EPP_XML("application/epp+xml"), + APPLICATION_EPUB_ZIP("application/epub+zip"), + APPLICATION_ESHOP("application/eshop"), + APPLICATION_EXAMPLE("application/example"), + APPLICATION_EXI("application/exi"), + APPLICATION_EXPECT_CT_REPORT_JSON("application/expect-ct-report+json"), + APPLICATION_EXPLICIT_REGISTRATION_RESPONSE_JWT("application/explicit-registration-response+jwt"), + APPLICATION_EXPRESS("application/express"), + APPLICATION_FASTINFOSET("application/fastinfoset"), + APPLICATION_FASTSOAP("application/fastsoap"), + APPLICATION_FDF("application/fdf"), + APPLICATION_FDT_XML("application/fdt+xml"), + APPLICATION_FHIR_JSON("application/fhir+json"), + APPLICATION_FHIR_XML("application/fhir+xml"), + APPLICATION_FITS("application/fits"), + APPLICATION_FLEXFEC("application/flexfec"), + APPLICATION_FONT_SFNT("application/font-sfnt"), + APPLICATION_FONT_TDPFR("application/font-tdpfr"), + APPLICATION_FONT_WOFF("application/font-woff"), + APPLICATION_FRAMEWORK_ATTRIBUTES_XML("application/framework-attributes+xml"), + APPLICATION_GEO_JSON("application/geo+json"), + APPLICATION_GEO_JSON_SEQ("application/geo+json-seq"), + APPLICATION_GEOFEED_CSV("application/geofeed+csv"), + APPLICATION_GEOPACKAGE_SQLITE3("application/geopackage+sqlite3"), + APPLICATION_GEOPOSE_JSON("application/geopose+json"), + APPLICATION_GEOXACML_JSON("application/geoxacml+json"), + APPLICATION_GEOXACML_XML("application/geoxacml+xml"), + APPLICATION_GLTF_BUFFER("application/gltf-buffer"), + APPLICATION_GML_XML("application/gml+xml"), + APPLICATION_GNAP_BINDING_JWS("application/gnap-binding-jws"), + APPLICATION_GNAP_BINDING_JWSD("application/gnap-binding-jwsd"), + APPLICATION_GNAP_BINDING_ROTATION_JWS("application/gnap-binding-rotation-jws"), + APPLICATION_GNAP_BINDING_ROTATION_JWSD("application/gnap-binding-rotation-jwsd"), + APPLICATION_GRIB("application/grib"), + APPLICATION_GZIP("application/gzip"), + APPLICATION_H224("application/H224"), + APPLICATION_HELD_XML("application/held+xml"), + APPLICATION_HL7V2_XML("application/hl7v2+xml"), + APPLICATION_HTTP("application/http"), + APPLICATION_HYPERSTUDIO("application/hyperstudio"), + APPLICATION_IBE_KEY_REQUEST_XML("application/ibe-key-request+xml"), + APPLICATION_IBE_PKG_REPLY_XML("application/ibe-pkg-reply+xml"), + APPLICATION_IBE_PP_DATA("application/ibe-pp-data"), + APPLICATION_IGES("application/iges"), + APPLICATION_IM_ISCOMPOSING_XML("application/im-iscomposing+xml"), + APPLICATION_INDEX("application/index"), + APPLICATION_INDEX_CMD("application/index.cmd"), + APPLICATION_INDEX_OBJ("application/index.obj"), + APPLICATION_INDEX_RESPONSE("application/index.response"), + APPLICATION_INDEX_VND("application/index.vnd"), + APPLICATION_INKML_XML("application/inkml+xml"), + APPLICATION_IOTP("application/IOTP"), + APPLICATION_IPFIX("application/ipfix"), + APPLICATION_IPP("application/ipp"), + APPLICATION_ISUP("application/ISUP"), + APPLICATION_ITS_XML("application/its+xml"), + APPLICATION_JAVA_ARCHIVE("application/java-archive"), + APPLICATION_JAVASCRIPT("application/javascript"), + APPLICATION_JF2FEED_JSON("application/jf2feed+json"), + APPLICATION_JOSE("application/jose"), + APPLICATION_JOSE_JSON("application/jose+json"), + APPLICATION_JRD_JSON("application/jrd+json"), + APPLICATION_JSCALENDAR_JSON("application/jscalendar+json"), + APPLICATION_JSCONTACT_JSON("application/jscontact+json"), + APPLICATION_JSON("application/json"), + APPLICATION_JSON_PATCH_JSON("application/json-patch+json"), + APPLICATION_JSON_PATCH_QUERY_JSON("application/json-patch-query+json"), + APPLICATION_JSON_SEQ("application/json-seq"), + APPLICATION_JSONPATH("application/jsonpath"), + APPLICATION_JWK_JSON("application/jwk+json"), + APPLICATION_JWK_SET_JSON("application/jwk-set+json"), + APPLICATION_JWK_SET_JWT("application/jwk-set+jwt"), + APPLICATION_JWT("application/jwt"), + APPLICATION_KB_JWT("application/kb+jwt"), + APPLICATION_KBL_XML("application/kbl+xml"), + APPLICATION_KPML_REQUEST_XML("application/kpml-request+xml"), + APPLICATION_KPML_RESPONSE_XML("application/kpml-response+xml"), + APPLICATION_LD_JSON("application/ld+json"), + APPLICATION_LGR_XML("application/lgr+xml"), + APPLICATION_LINK_FORMAT("application/link-format"), + APPLICATION_LINKSET("application/linkset"), + APPLICATION_LINKSET_JSON("application/linkset+json"), + APPLICATION_LOAD_CONTROL_XML("application/load-control+xml"), + APPLICATION_LOGOUT_JWT("application/logout+jwt"), + APPLICATION_LOST_XML("application/lost+xml"), + APPLICATION_LOSTSYNC_XML("application/lostsync+xml"), + APPLICATION_LPF_ZIP("application/lpf+zip"), + APPLICATION_LXF("application/LXF"), + APPLICATION_MAC_BINHEX40("application/mac-binhex40"), + APPLICATION_MACWRITEII("application/macwriteii"), + APPLICATION_MADS_XML("application/mads+xml"), + APPLICATION_MANIFEST_JSON("application/manifest+json"), + APPLICATION_MARC("application/marc"), + APPLICATION_MARCXML_XML("application/marcxml+xml"), + APPLICATION_MATHEMATICA("application/mathematica"), + APPLICATION_MATHML_XML("application/mathml+xml"), + APPLICATION_MATHML_CONTENT_XML("application/mathml-content+xml"), + APPLICATION_MATHML_PRESENTATION_XML("application/mathml-presentation+xml"), + APPLICATION_MBMS_ASSOCIATED_PROCEDURE_DESCRIPTION_XML("application/mbms-associated-procedure-description+xml"), + APPLICATION_MBMS_DEREGISTER_XML("application/mbms-deregister+xml"), + APPLICATION_MBMS_ENVELOPE_XML("application/mbms-envelope+xml"), + APPLICATION_MBMS_MSK_RESPONSE_XML("application/mbms-msk-response+xml"), + APPLICATION_MBMS_MSK_XML("application/mbms-msk+xml"), + APPLICATION_MBMS_PROTECTION_DESCRIPTION_XML("application/mbms-protection-description+xml"), + APPLICATION_MBMS_RECEPTION_REPORT_XML("application/mbms-reception-report+xml"), + APPLICATION_MBMS_REGISTER_RESPONSE_XML("application/mbms-register-response+xml"), + APPLICATION_MBMS_REGISTER_XML("application/mbms-register+xml"), + APPLICATION_MBMS_SCHEDULE_XML("application/mbms-schedule+xml"), + APPLICATION_MBMS_USER_SERVICE_DESCRIPTION_XML("application/mbms-user-service-description+xml"), + APPLICATION_MBOX("application/mbox"), + APPLICATION_MEDIA_CONTROL_XML("application/media_control+xml"), + APPLICATION_MEDIA_POLICY_DATASET_XML("application/media-policy-dataset+xml"), + APPLICATION_MEDIASERVERCONTROL_XML("application/mediaservercontrol+xml"), + APPLICATION_MERGE_PATCH_JSON("application/merge-patch+json"), + APPLICATION_METALINK4_XML("application/metalink4+xml"), + APPLICATION_METS_XML("application/mets+xml"), + APPLICATION_MF4("application/MF4"), + APPLICATION_MIKEY("application/mikey"), + APPLICATION_MIPC("application/mipc"), + APPLICATION_MISSING_BLOCKS_CBOR_SEQ("application/missing-blocks+cbor-seq"), + APPLICATION_MMT_AEI_XML("application/mmt-aei+xml"), + APPLICATION_MMT_USD_XML("application/mmt-usd+xml"), + APPLICATION_MODS_XML("application/mods+xml"), + APPLICATION_MOSS_KEYS("application/moss-keys"), + APPLICATION_MOSS_SIGNATURE("application/moss-signature"), + APPLICATION_MOSSKEY_DATA("application/mosskey-data"), + APPLICATION_MOSSKEY_REQUEST("application/mosskey-request"), + APPLICATION_MP21("application/mp21"), + APPLICATION_MP4("application/mp4"), + APPLICATION_MPEG4_GENERIC("application/mpeg4-generic"), + APPLICATION_MPEG4_IOD("application/mpeg4-iod"), + APPLICATION_MPEG4_IOD_XMT("application/mpeg4-iod-xmt"), + APPLICATION_MRB_CONSUMER_XML("application/mrb-consumer+xml"), + APPLICATION_MRB_PUBLISH_XML("application/mrb-publish+xml"), + APPLICATION_MSC_IVR_XML("application/msc-ivr+xml"), + APPLICATION_MSC_MIXER_XML("application/msc-mixer+xml"), + APPLICATION_MSWORD("application/msword"), + APPLICATION_MUD_JSON("application/mud+json"), + APPLICATION_MULTIPART_CORE("application/multipart-core"), + APPLICATION_MXF("application/mxf"), + APPLICATION_N_QUADS("application/n-quads"), + APPLICATION_N_TRIPLES("application/n-triples"), + APPLICATION_NASDATA("application/nasdata"), + APPLICATION_NEWS_CHECKGROUPS("application/news-checkgroups"), + APPLICATION_NEWS_GROUPINFO("application/news-groupinfo"), + APPLICATION_NEWS_TRANSMISSION("application/news-transmission"), + APPLICATION_NLSML_XML("application/nlsml+xml"), + APPLICATION_NODE("application/node"), + APPLICATION_NSS("application/nss"), + APPLICATION_OAUTH_AUTHZ_REQ_JWT("application/oauth-authz-req+jwt"), + APPLICATION_OBLIVIOUS_DNS_MESSAGE("application/oblivious-dns-message"), + APPLICATION_OCSP_REQUEST("application/ocsp-request"), + APPLICATION_OCSP_RESPONSE("application/ocsp-response"), + APPLICATION_OCTET_STREAM("application/octet-stream"), + APPLICATION_ODA("application/ODA"), + APPLICATION_ODM_XML("application/odm+xml"), + APPLICATION_ODX("application/ODX"), + APPLICATION_OEBPS_PACKAGE_XML("application/oebps-package+xml"), + APPLICATION_OGG("application/ogg"), + APPLICATION_OHTTP_KEYS("application/ohttp-keys"), + APPLICATION_OPC_NODESET_XML("application/opc-nodeset+xml"), + APPLICATION_OSCORE("application/oscore"), + APPLICATION_OXPS("application/oxps"), + APPLICATION_P21("application/p21"), + APPLICATION_P21_ZIP("application/p21+zip"), + APPLICATION_P2P_OVERLAY_XML("application/p2p-overlay+xml"), + APPLICATION_PARITYFEC("application/parityfec"), + APPLICATION_PASSPORT("application/passport"), + APPLICATION_PATCH_OPS_ERROR_XML("application/patch-ops-error+xml"), + APPLICATION_PDF("application/pdf"), + APPLICATION_PDX("application/PDX"), + APPLICATION_PEM_CERTIFICATE_CHAIN("application/pem-certificate-chain"), + APPLICATION_PGP_ENCRYPTED("application/pgp-encrypted"), + APPLICATION_PGP_KEYS("application/pgp-keys"), + APPLICATION_PGP_SIGNATURE("application/pgp-signature"), + APPLICATION_PIDF_DIFF_XML("application/pidf-diff+xml"), + APPLICATION_PIDF_XML("application/pidf+xml"), + APPLICATION_PKCS10("application/pkcs10"), + APPLICATION_PKCS7_MIME("application/pkcs7-mime"), + APPLICATION_PKCS7_SIGNATURE("application/pkcs7-signature"), + APPLICATION_PKCS8("application/pkcs8"), + APPLICATION_PKCS8_ENCRYPTED("application/pkcs8-encrypted"), + APPLICATION_PKCS12("application/pkcs12"), + APPLICATION_PKIX_ATTR_CERT("application/pkix-attr-cert"), + APPLICATION_PKIX_CERT("application/pkix-cert"), + APPLICATION_PKIX_CRL("application/pkix-crl"), + APPLICATION_PKIX_PKIPATH("application/pkix-pkipath"), + APPLICATION_PKIXCMP("application/pkixcmp"), + APPLICATION_PLS_XML("application/pls+xml"), + APPLICATION_POC_SETTINGS_XML("application/poc-settings+xml"), + APPLICATION_POSTSCRIPT("application/postscript"), + APPLICATION_PPSP_TRACKER_JSON("application/ppsp-tracker+json"), + APPLICATION_PRIVATE_TOKEN_ISSUER_DIRECTORY("application/private-token-issuer-directory"), + APPLICATION_PRIVATE_TOKEN_REQUEST("application/private-token-request"), + APPLICATION_PRIVATE_TOKEN_RESPONSE("application/private-token-response"), + APPLICATION_PROBLEM_JSON("application/problem+json"), + APPLICATION_PROBLEM_XML("application/problem+xml"), + APPLICATION_PROTOBUF("application/protobuf"), + APPLICATION_PROTOBUF_JSON("application/protobuf+json"), + APPLICATION_PROVENANCE_XML("application/provenance+xml"), + APPLICATION_PROVIDED_CLAIMS_JWT("application/provided-claims+jwt"), + APPLICATION_PRS_ALVESTRAND_TITRAX_SHEET("application/prs.alvestrand.titrax-sheet"), + APPLICATION_PRS_CWW("application/prs.cww"), + APPLICATION_PRS_CYN("application/prs.cyn"), + APPLICATION_PRS_HPUB_ZIP("application/prs.hpub+zip"), + APPLICATION_PRS_IMPLIED_DOCUMENT_XML("application/prs.implied-document+xml"), + APPLICATION_PRS_IMPLIED_EXECUTABLE("application/prs.implied-executable"), + APPLICATION_PRS_IMPLIED_OBJECT_JSON("application/prs.implied-object+json"), + APPLICATION_PRS_IMPLIED_OBJECT_JSON_SEQ("application/prs.implied-object+json-seq"), + APPLICATION_PRS_IMPLIED_OBJECT_YAML("application/prs.implied-object+yaml"), + APPLICATION_PRS_IMPLIED_STRUCTURE("application/prs.implied-structure"), + APPLICATION_PRS_MAYFILE("application/prs.mayfile"), + APPLICATION_PRS_NPREND("application/prs.nprend"), + APPLICATION_PRS_PLUCKER("application/prs.plucker"), + APPLICATION_PRS_RDF_XML_CRYPT("application/prs.rdf-xml-crypt"), + APPLICATION_PRS_SCLT("application/prs.sclt"), + APPLICATION_PRS_VCFBZIP2("application/prs.vcfbzip2"), + APPLICATION_PRS_XSF_XML("application/prs.xsf+xml"), + APPLICATION_PSKC_XML("application/pskc+xml"), + APPLICATION_PVD_JSON("application/pvd+json"), + APPLICATION_RDF_XML("application/rdf+xml"), + APPLICATION_ROUTE_APD_XML("application/route-apd+xml"), + APPLICATION_ROUTE_S_TSID_XML("application/route-s-tsid+xml"), + APPLICATION_ROUTE_USD_XML("application/route-usd+xml"), + APPLICATION_QSIG("application/QSIG"), + APPLICATION_RAPTORFEC("application/raptorfec"), + APPLICATION_RDAP_JSON("application/rdap+json"), + APPLICATION_REGINFO_XML("application/reginfo+xml"), + APPLICATION_RELAX_NG_COMPACT_SYNTAX("application/relax-ng-compact-syntax"), + APPLICATION_REMOTE_PRINTING("application/remote-printing"), + APPLICATION_REPUTON_JSON("application/reputon+json"), + APPLICATION_RESOLVE_RESPONSE_JWT("application/resolve-response+jwt"), + APPLICATION_RESOURCE_LISTS_DIFF_XML("application/resource-lists-diff+xml"), + APPLICATION_RESOURCE_LISTS_XML("application/resource-lists+xml"), + APPLICATION_RFC_XML("application/rfc+xml"), + APPLICATION_RISCOS("application/riscos"), + APPLICATION_RLMI_XML("application/rlmi+xml"), + APPLICATION_RLS_SERVICES_XML("application/rls-services+xml"), + APPLICATION_RPKI_CHECKLIST("application/rpki-checklist"), + APPLICATION_RPKI_GHOSTBUSTERS("application/rpki-ghostbusters"), + APPLICATION_RPKI_MANIFEST("application/rpki-manifest"), + APPLICATION_RPKI_PUBLICATION("application/rpki-publication"), + APPLICATION_RPKI_ROA("application/rpki-roa"), + APPLICATION_RPKI_SIGNED_TAL("application/rpki-signed-tal"), + APPLICATION_RPKI_UPDOWN("application/rpki-updown"), + APPLICATION_RS_METADATA_XML("application/rs-metadata+xml"), + APPLICATION_RTF("application/rtf"), + APPLICATION_RTPLOOPBACK("application/rtploopback"), + APPLICATION_RTX("application/rtx"), + APPLICATION_SAMLASSERTION_XML("application/samlassertion+xml"), + APPLICATION_SAMLMETADATA_XML("application/samlmetadata+xml"), + APPLICATION_SARIF_EXTERNAL_PROPERTIES_JSON("application/sarif-external-properties+json"), + APPLICATION_SARIF_JSON("application/sarif+json"), + APPLICATION_SBE("application/sbe"), + APPLICATION_SBML_XML("application/sbml+xml"), + APPLICATION_SCAIP_XML("application/scaip+xml"), + APPLICATION_SCIM_JSON("application/scim+json"), + APPLICATION_SCITT_RECEIPT_COSE("application/scitt-receipt+cose"), + APPLICATION_SCITT_STATEMENT_COSE("application/scitt-statement+cose"), + APPLICATION_SCVP_CV_REQUEST("application/scvp-cv-request"), + APPLICATION_SCVP_CV_RESPONSE("application/scvp-cv-response"), + APPLICATION_SCVP_VP_REQUEST("application/scvp-vp-request"), + APPLICATION_SCVP_VP_RESPONSE("application/scvp-vp-response"), + APPLICATION_SD_JWT("application/sd-jwt"), + APPLICATION_SD_JWT_JSON("application/sd-jwt+json"), + APPLICATION_SDF_JSON("application/sdf+json"), + APPLICATION_SDP("application/sdp"), + APPLICATION_SECEVENT_JWT("application/secevent+jwt"), + APPLICATION_SENML_ETCH_CBOR("application/senml-etch+cbor"), + APPLICATION_SENML_ETCH_JSON("application/senml-etch+json"), + APPLICATION_SENML_EXI("application/senml-exi"), + APPLICATION_SENML_CBOR("application/senml+cbor"), + APPLICATION_SENML_JSON("application/senml+json"), + APPLICATION_SENML_XML("application/senml+xml"), + APPLICATION_SENSML_EXI("application/sensml-exi"), + APPLICATION_SENSML_CBOR("application/sensml+cbor"), + APPLICATION_SENSML_JSON("application/sensml+json"), + APPLICATION_SENSML_XML("application/sensml+xml"), + APPLICATION_SEP_EXI("application/sep-exi"), + APPLICATION_SEP_XML("application/sep+xml"), + APPLICATION_SESSION_INFO("application/session-info"), + APPLICATION_SET_PAYMENT("application/set-payment"), + APPLICATION_SET_PAYMENT_INITIATION("application/set-payment-initiation"), + APPLICATION_SET_REGISTRATION("application/set-registration"), + APPLICATION_SET_REGISTRATION_INITIATION("application/set-registration-initiation"), + APPLICATION_SGML("application/SGML"), + APPLICATION_SGML_OPEN_CATALOG("application/sgml-open-catalog"), + APPLICATION_SHF_XML("application/shf+xml"), + APPLICATION_SIEVE("application/sieve"), + APPLICATION_SIMPLE_FILTER_XML("application/simple-filter+xml"), + APPLICATION_SIMPLE_MESSAGE_SUMMARY("application/simple-message-summary"), + APPLICATION_SIMPLESYMBOLCONTAINER("application/simpleSymbolContainer"), + APPLICATION_SIPC("application/sipc"), + APPLICATION_SLATE("application/slate"), + APPLICATION_SMIL("application/smil"), + APPLICATION_SMIL_XML("application/smil+xml"), + APPLICATION_SMPTE336M("application/smpte336m"), + APPLICATION_SOAP_FASTINFOSET("application/soap+fastinfoset"), + APPLICATION_SOAP_XML("application/soap+xml"), + APPLICATION_SPARQL_QUERY("application/sparql-query"), + APPLICATION_SPDX_JSON("application/spdx+json"), + APPLICATION_SPARQL_RESULTS_XML("application/sparql-results+xml"), + APPLICATION_SPIRITS_EVENT_XML("application/spirits-event+xml"), + APPLICATION_SQL("application/sql"), + APPLICATION_SRGS("application/srgs"), + APPLICATION_SRGS_XML("application/srgs+xml"), + APPLICATION_SRU_XML("application/sru+xml"), + APPLICATION_SSLKEYLOGFILE("application/sslkeylogfile"), + APPLICATION_SSML_XML("application/ssml+xml"), + APPLICATION_ST2110_41("application/ST2110-41"), + APPLICATION_STIX_JSON("application/stix+json"), + APPLICATION_STRATUM("application/stratum"), + APPLICATION_SUIT_ENVELOPE_COSE("application/suit-envelope+cose"), + APPLICATION_SUIT_REPORT_COSE("application/suit-report+cose"), + APPLICATION_SWID_CBOR("application/swid+cbor"), + APPLICATION_SWID_XML("application/swid+xml"), + APPLICATION_TAMP_APEX_UPDATE("application/tamp-apex-update"), + APPLICATION_TAMP_APEX_UPDATE_CONFIRM("application/tamp-apex-update-confirm"), + APPLICATION_TAMP_COMMUNITY_UPDATE("application/tamp-community-update"), + APPLICATION_TAMP_COMMUNITY_UPDATE_CONFIRM("application/tamp-community-update-confirm"), + APPLICATION_TAMP_ERROR("application/tamp-error"), + APPLICATION_TAMP_SEQUENCE_ADJUST("application/tamp-sequence-adjust"), + APPLICATION_TAMP_SEQUENCE_ADJUST_CONFIRM("application/tamp-sequence-adjust-confirm"), + APPLICATION_TAMP_STATUS_QUERY("application/tamp-status-query"), + APPLICATION_TAMP_STATUS_RESPONSE("application/tamp-status-response"), + APPLICATION_TAMP_UPDATE("application/tamp-update"), + APPLICATION_TAMP_UPDATE_CONFIRM("application/tamp-update-confirm"), + APPLICATION_TAXII_JSON("application/taxii+json"), + APPLICATION_TD_JSON("application/td+json"), + APPLICATION_TEI_XML("application/tei+xml"), + APPLICATION_TETRA_ISI("application/TETRA_ISI"), + APPLICATION_TEXINFO("application/texinfo"), + APPLICATION_THRAUD_XML("application/thraud+xml"), + APPLICATION_TIMESTAMP_QUERY("application/timestamp-query"), + APPLICATION_TIMESTAMP_REPLY("application/timestamp-reply"), + APPLICATION_TIMESTAMPED_DATA("application/timestamped-data"), + APPLICATION_TLSRPT_GZIP("application/tlsrpt+gzip"), + APPLICATION_TLSRPT_JSON("application/tlsrpt+json"), + APPLICATION_TM_JSON("application/tm+json"), + APPLICATION_TNAUTHLIST("application/tnauthlist"), + APPLICATION_TOC_CBOR("application/toc+cbor"), + APPLICATION_TOKEN_INTROSPECTION_JWT("application/token-introspection+jwt"), + APPLICATION_TOML("application/toml"), + APPLICATION_TRICKLE_ICE_SDPFRAG("application/trickle-ice-sdpfrag"), + APPLICATION_TRIG("application/trig"), + APPLICATION_TRUST_CHAIN_JSON("application/trust-chain+json"), + APPLICATION_TRUST_MARK_JWT("application/trust-mark+jwt"), + APPLICATION_TRUST_MARK_DELEGATION_JWT("application/trust-mark-delegation+jwt"), + APPLICATION_TRUST_MARK_STATUS_RESPONSE_JWT("application/trust-mark-status-response+jwt"), + APPLICATION_TTML_XML("application/ttml+xml"), + APPLICATION_TVE_TRIGGER("application/tve-trigger"), + APPLICATION_TZIF("application/tzif"), + APPLICATION_TZIF_LEAP("application/tzif-leap"), + APPLICATION_UCCS_CBOR("application/uccs+cbor"), + APPLICATION_UJCS_JSON("application/ujcs+json"), + APPLICATION_ULPFEC("application/ulpfec"), + APPLICATION_URC_GRPSHEET_XML("application/urc-grpsheet+xml"), + APPLICATION_URC_RESSHEET_XML("application/urc-ressheet+xml"), + APPLICATION_URC_TARGETDESC_XML("application/urc-targetdesc+xml"), + APPLICATION_URC_UISOCKETDESC_XML("application/urc-uisocketdesc+xml"), + APPLICATION_VC("application/vc"), + APPLICATION_VC_COSE("application/vc+cose"), + APPLICATION_VC_JWT("application/vc+jwt"), + APPLICATION_VC_SD_JWT("application/vc+sd-jwt"), + APPLICATION_VCARD_JSON("application/vcard+json"), + APPLICATION_VCARD_XML("application/vcard+xml"), + APPLICATION_VEC_XML("application/vec+xml"), + APPLICATION_VEC_PACKAGE_GZIP("application/vec-package+gzip"), + APPLICATION_VEC_PACKAGE_ZIP("application/vec-package+zip"), + APPLICATION_VEMMI("application/vemmi"), + APPLICATION_VND_1000MINDS_DECISION_MODEL_XML("application/vnd.1000minds.decision-model+xml"), + APPLICATION_VND_1OB("application/vnd.1ob"), + APPLICATION_VND_3GPP_5GNAS("application/vnd.3gpp.5gnas"), + APPLICATION_VND_3GPP_5GSA2X("application/vnd.3gpp.5gsa2x"), + APPLICATION_VND_3GPP_5GSA2X_LOCAL_SERVICE_INFORMATION("application/vnd.3gpp.5gsa2x-local-service-information"), + APPLICATION_VND_3GPP_5GSV2X("application/vnd.3gpp.5gsv2x"), + APPLICATION_VND_3GPP_5GSV2X_LOCAL_SERVICE_INFORMATION("application/vnd.3gpp.5gsv2x-local-service-information"), + APPLICATION_VND_3GPP_ACCESS_TRANSFER_EVENTS_XML("application/vnd.3gpp.access-transfer-events+xml"), + APPLICATION_VND_3GPP_BSF_XML("application/vnd.3gpp.bsf+xml"), + APPLICATION_VND_3GPP_CRS_XML("application/vnd.3gpp.crs+xml"), + APPLICATION_VND_3GPP_CURRENT_LOCATION_DISCOVERY_XML("application/vnd.3gpp.current-location-discovery+xml"), + APPLICATION_VND_3GPP_GMOP_XML("application/vnd.3gpp.GMOP+xml"), + APPLICATION_VND_3GPP_GTPC("application/vnd.3gpp.gtpc"), + APPLICATION_VND_3GPP_INTERWORKING_DATA("application/vnd.3gpp.interworking-data"), + APPLICATION_VND_3GPP_LPP("application/vnd.3gpp.lpp"), + APPLICATION_VND_3GPP_MC_SIGNALLING_EAR("application/vnd.3gpp.mc-signalling-ear"), + APPLICATION_VND_3GPP_MCDATA_AFFILIATION_COMMAND_XML("application/vnd.3gpp.mcdata-affiliation-command+xml"), + APPLICATION_VND_3GPP_MCDATA_INFO_XML("application/vnd.3gpp.mcdata-info+xml"), + APPLICATION_VND_3GPP_MCDATA_MSGSTORE_CTRL_REQUEST_XML("application/vnd.3gpp.mcdata-msgstore-ctrl-request+xml"), + APPLICATION_VND_3GPP_MCDATA_PAYLOAD("application/vnd.3gpp.mcdata-payload"), + APPLICATION_VND_3GPP_MCDATA_REGROUP_XML("application/vnd.3gpp.mcdata-regroup+xml"), + APPLICATION_VND_3GPP_MCDATA_SERVICE_CONFIG_XML("application/vnd.3gpp.mcdata-service-config+xml"), + APPLICATION_VND_3GPP_MCDATA_SIGNALLING("application/vnd.3gpp.mcdata-signalling"), + APPLICATION_VND_3GPP_MCDATA_UE_CONFIG_XML("application/vnd.3gpp.mcdata-ue-config+xml"), + APPLICATION_VND_3GPP_MCDATA_USER_PROFILE_XML("application/vnd.3gpp.mcdata-user-profile+xml"), + APPLICATION_VND_3GPP_MCPTT_AFFILIATION_COMMAND_XML("application/vnd.3gpp.mcptt-affiliation-command+xml"), + APPLICATION_VND_3GPP_MCPTT_FLOOR_REQUEST_XML("application/vnd.3gpp.mcptt-floor-request+xml"), + APPLICATION_VND_3GPP_MCPTT_INFO_XML("application/vnd.3gpp.mcptt-info+xml"), + APPLICATION_VND_3GPP_MCPTT_LOCATION_INFO_XML("application/vnd.3gpp.mcptt-location-info+xml"), + APPLICATION_VND_3GPP_MCPTT_MBMS_USAGE_INFO_XML("application/vnd.3gpp.mcptt-mbms-usage-info+xml"), + APPLICATION_VND_3GPP_MCPTT_REGROUP_XML("application/vnd.3gpp.mcptt-regroup+xml"), + APPLICATION_VND_3GPP_MCPTT_SERVICE_CONFIG_XML("application/vnd.3gpp.mcptt-service-config+xml"), + APPLICATION_VND_3GPP_MCPTT_SIGNED_XML("application/vnd.3gpp.mcptt-signed+xml"), + APPLICATION_VND_3GPP_MCPTT_UE_CONFIG_XML("application/vnd.3gpp.mcptt-ue-config+xml"), + APPLICATION_VND_3GPP_MCPTT_UE_INIT_CONFIG_XML("application/vnd.3gpp.mcptt-ue-init-config+xml"), + APPLICATION_VND_3GPP_MCPTT_USER_PROFILE_XML("application/vnd.3gpp.mcptt-user-profile+xml"), + APPLICATION_VND_3GPP_MCVIDEO_AFFILIATION_COMMAND_XML("application/vnd.3gpp.mcvideo-affiliation-command+xml"), + APPLICATION_VND_3GPP_MCVIDEO_AFFILIATION_INFO_XML("application/vnd.3gpp.mcvideo-affiliation-info+xml"), + APPLICATION_VND_3GPP_MCVIDEO_INFO_XML("application/vnd.3gpp.mcvideo-info+xml"), + APPLICATION_VND_3GPP_MCVIDEO_LOCATION_INFO_XML("application/vnd.3gpp.mcvideo-location-info+xml"), + APPLICATION_VND_3GPP_MCVIDEO_MBMS_USAGE_INFO_XML("application/vnd.3gpp.mcvideo-mbms-usage-info+xml"), + APPLICATION_VND_3GPP_MCVIDEO_REGROUP_XML("application/vnd.3gpp.mcvideo-regroup+xml"), + APPLICATION_VND_3GPP_MCVIDEO_SERVICE_CONFIG_XML("application/vnd.3gpp.mcvideo-service-config+xml"), + APPLICATION_VND_3GPP_MCVIDEO_TRANSMISSION_REQUEST_XML("application/vnd.3gpp.mcvideo-transmission-request+xml"), + APPLICATION_VND_3GPP_MCVIDEO_UE_CONFIG_XML("application/vnd.3gpp.mcvideo-ue-config+xml"), + APPLICATION_VND_3GPP_MCVIDEO_USER_PROFILE_XML("application/vnd.3gpp.mcvideo-user-profile+xml"), + APPLICATION_VND_3GPP_MID_CALL_XML("application/vnd.3gpp.mid-call+xml"), + APPLICATION_VND_3GPP_NGAP("application/vnd.3gpp.ngap"), + APPLICATION_VND_3GPP_PFCP("application/vnd.3gpp.pfcp"), + APPLICATION_VND_3GPP_PIC_BW_LARGE("application/vnd.3gpp.pic-bw-large"), + APPLICATION_VND_3GPP_PIC_BW_SMALL("application/vnd.3gpp.pic-bw-small"), + APPLICATION_VND_3GPP_PIC_BW_VAR("application/vnd.3gpp.pic-bw-var"), + APPLICATION_VND_3GPP_PINAPP_INFO_XML("application/vnd.3gpp.pinapp-info+xml"), + APPLICATION_VND_3GPP_PROSE_PC3A_XML("application/vnd.3gpp-prose-pc3a+xml"), + APPLICATION_VND_3GPP_PROSE_PC3ACH_XML("application/vnd.3gpp-prose-pc3ach+xml"), + APPLICATION_VND_3GPP_PROSE_PC3CH_XML("application/vnd.3gpp-prose-pc3ch+xml"), + APPLICATION_VND_3GPP_PROSE_PC8_XML("application/vnd.3gpp-prose-pc8+xml"), + APPLICATION_VND_3GPP_PROSE_XML("application/vnd.3gpp-prose+xml"), + APPLICATION_VND_3GPP_S1AP("application/vnd.3gpp.s1ap"), + APPLICATION_VND_3GPP_SEAL_APP_COMM_REQUIREMENTS_INFO_XML("application/vnd.3gpp.seal-app-comm-requirements-info+xml"), + APPLICATION_VND_3GPP_SEAL_DATA_DELIVERY_INFO_CBOR("application/vnd.3gpp.seal-data-delivery-info+cbor"), + APPLICATION_VND_3GPP_SEAL_DATA_DELIVERY_INFO_XML("application/vnd.3gpp.seal-data-delivery-info+xml"), + APPLICATION_VND_3GPP_SEAL_GROUP_DOC_XML("application/vnd.3gpp.seal-group-doc+xml"), + APPLICATION_VND_3GPP_SEAL_INFO_XML("application/vnd.3gpp.seal-info+xml"), + APPLICATION_VND_3GPP_SEAL_LOCATION_INFO_CBOR("application/vnd.3gpp.seal-location-info+cbor"), + APPLICATION_VND_3GPP_SEAL_LOCATION_INFO_XML("application/vnd.3gpp.seal-location-info+xml"), + APPLICATION_VND_3GPP_SEAL_MBMS_USAGE_INFO_XML("application/vnd.3gpp.seal-mbms-usage-info+xml"), + APPLICATION_VND_3GPP_SEAL_MBS_USAGE_INFO_XML("application/vnd.3gpp.seal-mbs-usage-info+xml"), + APPLICATION_VND_3GPP_SEAL_NETWORK_QOS_MANAGEMENT_INFO_XML("application/vnd.3gpp.seal-network-QoS-management-info+xml"), + APPLICATION_VND_3GPP_SEAL_NETWORK_RESOURCE_INFO_CBOR("application/vnd.3gpp.seal-network-resource-info+cbor"), + APPLICATION_VND_3GPP_SEAL_UE_CONFIG_INFO_XML("application/vnd.3gpp.seal-ue-config-info+xml"), + APPLICATION_VND_3GPP_SEAL_UNICAST_INFO_XML("application/vnd.3gpp.seal-unicast-info+xml"), + APPLICATION_VND_3GPP_SEAL_USER_PROFILE_INFO_XML("application/vnd.3gpp.seal-user-profile-info+xml"), + APPLICATION_VND_3GPP_SMS("application/vnd.3gpp.sms"), + APPLICATION_VND_3GPP_SMS_XML("application/vnd.3gpp.sms+xml"), + APPLICATION_VND_3GPP_SRVCC_EXT_XML("application/vnd.3gpp.srvcc-ext+xml"), + APPLICATION_VND_3GPP_SRVCC_INFO_XML("application/vnd.3gpp.SRVCC-info+xml"), + APPLICATION_VND_3GPP_STATE_AND_EVENT_INFO_XML("application/vnd.3gpp.state-and-event-info+xml"), + APPLICATION_VND_3GPP_USSD_XML("application/vnd.3gpp.ussd+xml"), + APPLICATION_VND_3GPP_VAE_INFO_XML("application/vnd.3gpp.vae-info+xml"), + APPLICATION_VND_3GPP_V2X_LOCAL_SERVICE_INFORMATION("application/vnd.3gpp-v2x-local-service-information"), + APPLICATION_VND_3GPP2_BCMCSINFO_XML("application/vnd.3gpp2.bcmcsinfo+xml"), + APPLICATION_VND_3GPP2_SMS("application/vnd.3gpp2.sms"), + APPLICATION_VND_3GPP2_TCAP("application/vnd.3gpp2.tcap"), + APPLICATION_VND_3GPP_V2X("application/vnd.3gpp.v2x"), + APPLICATION_VND_3LIGHTSSOFTWARE_IMAGESCAL("application/vnd.3lightssoftware.imagescal"), + APPLICATION_VND_3M_POST_IT_NOTES("application/vnd.3M.Post-it-Notes"), + APPLICATION_VND_ACCPAC_SIMPLY_ASO("application/vnd.accpac.simply.aso"), + APPLICATION_VND_ACCPAC_SIMPLY_IMP("application/vnd.accpac.simply.imp"), + APPLICATION_VND_ACM_ADDRESSXFER_JSON("application/vnd.acm.addressxfer+json"), + APPLICATION_VND_ACM_CHATBOT_JSON("application/vnd.acm.chatbot+json"), + APPLICATION_VND_ACUCOBOL("application/vnd.acucobol"), + APPLICATION_VND_ACUCORP("application/vnd.acucorp"), + APPLICATION_VND_ADOBE_FLASH_MOVIE("application/vnd.adobe.flash.movie"), + APPLICATION_VND_ADOBE_FORMSCENTRAL_FCDT("application/vnd.adobe.formscentral.fcdt"), + APPLICATION_VND_ADOBE_FXP("application/vnd.adobe.fxp"), + APPLICATION_VND_ADOBE_PARTIAL_UPLOAD("application/vnd.adobe.partial-upload"), + APPLICATION_VND_ADOBE_XDP_XML("application/vnd.adobe.xdp+xml"), + APPLICATION_VND_AETHER_IMP("application/vnd.aether.imp"), + APPLICATION_VND_AFPC_AFPLINEDATA("application/vnd.afpc.afplinedata"), + APPLICATION_VND_AFPC_AFPLINEDATA_PAGEDEF("application/vnd.afpc.afplinedata-pagedef"), + APPLICATION_VND_AFPC_CMOCA_CMRESOURCE("application/vnd.afpc.cmoca-cmresource"), + APPLICATION_VND_AFPC_FOCA_CHARSET("application/vnd.afpc.foca-charset"), + APPLICATION_VND_AFPC_FOCA_CODEDFONT("application/vnd.afpc.foca-codedfont"), + APPLICATION_VND_AFPC_FOCA_CODEPAGE("application/vnd.afpc.foca-codepage"), + APPLICATION_VND_AFPC_MODCA("application/vnd.afpc.modca"), + APPLICATION_VND_AFPC_MODCA_CMTABLE("application/vnd.afpc.modca-cmtable"), + APPLICATION_VND_AFPC_MODCA_FORMDEF("application/vnd.afpc.modca-formdef"), + APPLICATION_VND_AFPC_MODCA_MEDIUMMAP("application/vnd.afpc.modca-mediummap"), + APPLICATION_VND_AFPC_MODCA_OBJECTCONTAINER("application/vnd.afpc.modca-objectcontainer"), + APPLICATION_VND_AFPC_MODCA_OVERLAY("application/vnd.afpc.modca-overlay"), + APPLICATION_VND_AFPC_MODCA_PAGESEGMENT("application/vnd.afpc.modca-pagesegment"), + APPLICATION_VND_AGE("application/vnd.age"), + APPLICATION_VND_AH_BARCODE("application/vnd.ah-barcode"), + APPLICATION_VND_AHEAD_SPACE("application/vnd.ahead.space"), + APPLICATION_VND_AIA("application/vnd.aia"), + APPLICATION_VND_AIRZIP_FILESECURE_AZF("application/vnd.airzip.filesecure.azf"), + APPLICATION_VND_AIRZIP_FILESECURE_AZS("application/vnd.airzip.filesecure.azs"), + APPLICATION_VND_AMADEUS_JSON("application/vnd.amadeus+json"), + APPLICATION_VND_AMAZON_MOBI8_EBOOK("application/vnd.amazon.mobi8-ebook"), + APPLICATION_VND_AMERICANDYNAMICS_ACC("application/vnd.americandynamics.acc"), + APPLICATION_VND_AMIGA_AMI("application/vnd.amiga.ami"), + APPLICATION_VND_AMUNDSEN_MAZE_XML("application/vnd.amundsen.maze+xml"), + APPLICATION_VND_ANDROID_OTA("application/vnd.android.ota"), + APPLICATION_VND_ANKI("application/vnd.anki"), + APPLICATION_VND_ANSER_WEB_CERTIFICATE_ISSUE_INITIATION("application/vnd.anser-web-certificate-issue-initiation"), + APPLICATION_VND_ANTIX_GAME_COMPONENT("application/vnd.antix.game-component"), + APPLICATION_VND_APACHE_ARROW_FILE("application/vnd.apache.arrow.file"), + APPLICATION_VND_APACHE_ARROW_STREAM("application/vnd.apache.arrow.stream"), + APPLICATION_VND_APACHE_PARQUET("application/vnd.apache.parquet"), + APPLICATION_VND_APACHE_THRIFT_BINARY("application/vnd.apache.thrift.binary"), + APPLICATION_VND_APACHE_THRIFT_COMPACT("application/vnd.apache.thrift.compact"), + APPLICATION_VND_APACHE_THRIFT_JSON("application/vnd.apache.thrift.json"), + APPLICATION_VND_APEXLANG("application/vnd.apexlang"), + APPLICATION_VND_API_JSON("application/vnd.api+json"), + APPLICATION_VND_APLEXTOR_WARRP_JSON("application/vnd.aplextor.warrp+json"), + APPLICATION_VND_APOTHEKENDE_RESERVATION_JSON("application/vnd.apothekende.reservation+json"), + APPLICATION_VND_APPLE_INSTALLER_XML("application/vnd.apple.installer+xml"), + APPLICATION_VND_APPLE_KEYNOTE("application/vnd.apple.keynote"), + APPLICATION_VND_APPLE_MPEGURL("application/vnd.apple.mpegurl"), + APPLICATION_VND_APPLE_NUMBERS("application/vnd.apple.numbers"), + APPLICATION_VND_APPLE_PAGES("application/vnd.apple.pages"), + APPLICATION_VND_ARASTRA_SWI("application/vnd.arastra.swi"), + APPLICATION_VND_ARISTANETWORKS_SWI("application/vnd.aristanetworks.swi"), + APPLICATION_VND_ARTISAN_JSON("application/vnd.artisan+json"), + APPLICATION_VND_ARTSQUARE("application/vnd.artsquare"), + APPLICATION_VND_AS207960_VAS_CONFIG_JER("application/vnd.as207960.vas.config+jer"), + APPLICATION_VND_AS207960_VAS_CONFIG_UPER("application/vnd.as207960.vas.config+uper"), + APPLICATION_VND_AS207960_VAS_TAP_JER("application/vnd.as207960.vas.tap+jer"), + APPLICATION_VND_AS207960_VAS_TAP_UPER("application/vnd.as207960.vas.tap+uper"), + APPLICATION_VND_ASTRAEA_SOFTWARE_IOTA("application/vnd.astraea-software.iota"), + APPLICATION_VND_AUDIOGRAPH("application/vnd.audiograph"), + APPLICATION_VND_AUTOPACKAGE("application/vnd.autopackage"), + APPLICATION_VND_AVALON_JSON("application/vnd.avalon+json"), + APPLICATION_VND_AVISTAR_XML("application/vnd.avistar+xml"), + APPLICATION_VND_BALSAMIQ_BMML_XML("application/vnd.balsamiq.bmml+xml"), + APPLICATION_VND_BANANA_ACCOUNTING("application/vnd.banana-accounting"), + APPLICATION_VND_BBF_USP_ERROR("application/vnd.bbf.usp.error"), + APPLICATION_VND_BBF_USP_MSG("application/vnd.bbf.usp.msg"), + APPLICATION_VND_BBF_USP_MSG_JSON("application/vnd.bbf.usp.msg+json"), + APPLICATION_VND_BALSAMIQ_BMPR("application/vnd.balsamiq.bmpr"), + APPLICATION_VND_BEKITZUR_STECH_JSON("application/vnd.bekitzur-stech+json"), + APPLICATION_VND_BELIGHTSOFT_LHZD_ZIP("application/vnd.belightsoft.lhzd+zip"), + APPLICATION_VND_BELIGHTSOFT_LHZL_ZIP("application/vnd.belightsoft.lhzl+zip"), + APPLICATION_VND_BINT_MED_CONTENT("application/vnd.bint.med-content"), + APPLICATION_VND_BIOPAX_RDF_XML("application/vnd.biopax.rdf+xml"), + APPLICATION_VND_BLINK_IDB_VALUE_WRAPPER("application/vnd.blink-idb-value-wrapper"), + APPLICATION_VND_BLUEICE_MULTIPASS("application/vnd.blueice.multipass"), + APPLICATION_VND_BLUETOOTH_EP_OOB("application/vnd.bluetooth.ep.oob"), + APPLICATION_VND_BLUETOOTH_LE_OOB("application/vnd.bluetooth.le.oob"), + APPLICATION_VND_BMI("application/vnd.bmi"), + APPLICATION_VND_BPF("application/vnd.bpf"), + APPLICATION_VND_BPF3("application/vnd.bpf3"), + APPLICATION_VND_BUSINESSOBJECTS("application/vnd.businessobjects"), + APPLICATION_VND_BYU_UAPI_JSON("application/vnd.byu.uapi+json"), + APPLICATION_VND_BZIP3("application/vnd.bzip3"), + APPLICATION_VND_C3VOC_SCHEDULE_XML("application/vnd.c3voc.schedule+xml"), + APPLICATION_VND_CAB_JSCRIPT("application/vnd.cab-jscript"), + APPLICATION_VND_CANON_CPDL("application/vnd.canon-cpdl"), + APPLICATION_VND_CANON_LIPS("application/vnd.canon-lips"), + APPLICATION_VND_CAPASYSTEMS_PG_JSON("application/vnd.capasystems-pg+json"), + APPLICATION_VND_CEL("application/vnd.cel"), + APPLICATION_VND_CENDIO_THINLINC_CLIENTCONF("application/vnd.cendio.thinlinc.clientconf"), + APPLICATION_VND_CENTURY_SYSTEMS_TCP_STREAM("application/vnd.century-systems.tcp_stream"), + APPLICATION_VND_CHEMDRAW_XML("application/vnd.chemdraw+xml"), + APPLICATION_VND_CHESS_PGN("application/vnd.chess-pgn"), + APPLICATION_VND_CHIPNUTS_KARAOKE_MMD("application/vnd.chipnuts.karaoke-mmd"), + APPLICATION_VND_CIEDI("application/vnd.ciedi"), + APPLICATION_VND_CINDERELLA("application/vnd.cinderella"), + APPLICATION_VND_CIRPACK_ISDN_EXT("application/vnd.cirpack.isdn-ext"), + APPLICATION_VND_CITATIONSTYLES_STYLE_XML("application/vnd.citationstyles.style+xml"), + APPLICATION_VND_CLAYMORE("application/vnd.claymore"), + APPLICATION_VND_CLOANTO_RP9("application/vnd.cloanto.rp9"), + APPLICATION_VND_CLONK_C4GROUP("application/vnd.clonk.c4group"), + APPLICATION_VND_CLUETRUST_CARTOMOBILE_CONFIG("application/vnd.cluetrust.cartomobile-config"), + APPLICATION_VND_CLUETRUST_CARTOMOBILE_CONFIG_PKG("application/vnd.cluetrust.cartomobile-config-pkg"), + APPLICATION_VND_CNCF_HELM_CHART_CONTENT_V1_TAR_GZIP("application/vnd.cncf.helm.chart.content.v1.tar+gzip"), + APPLICATION_VND_CNCF_HELM_CHART_PROVENANCE_V1_PROV("application/vnd.cncf.helm.chart.provenance.v1.prov"), + APPLICATION_VND_CNCF_HELM_CONFIG_V1_JSON("application/vnd.cncf.helm.config.v1+json"), + APPLICATION_VND_COFFEESCRIPT("application/vnd.coffeescript"), + APPLICATION_VND_COLLABIO_XODOCUMENTS_DOCUMENT("application/vnd.collabio.xodocuments.document"), + APPLICATION_VND_COLLABIO_XODOCUMENTS_DOCUMENT_TEMPLATE("application/vnd.collabio.xodocuments.document-template"), + APPLICATION_VND_COLLABIO_XODOCUMENTS_PRESENTATION("application/vnd.collabio.xodocuments.presentation"), + APPLICATION_VND_COLLABIO_XODOCUMENTS_PRESENTATION_TEMPLATE("application/vnd.collabio.xodocuments.presentation-template"), + APPLICATION_VND_COLLABIO_XODOCUMENTS_SPREADSHEET("application/vnd.collabio.xodocuments.spreadsheet"), + APPLICATION_VND_COLLABIO_XODOCUMENTS_SPREADSHEET_TEMPLATE("application/vnd.collabio.xodocuments.spreadsheet-template"), + APPLICATION_VND_COLLECTION_DOC_JSON("application/vnd.collection.doc+json"), + APPLICATION_VND_COLLECTION_JSON("application/vnd.collection+json"), + APPLICATION_VND_COLLECTION_NEXT_JSON("application/vnd.collection.next+json"), + APPLICATION_VND_COMICBOOK_RAR("application/vnd.comicbook-rar"), + APPLICATION_VND_COMICBOOK_ZIP("application/vnd.comicbook+zip"), + APPLICATION_VND_COMMERCE_BATTELLE("application/vnd.commerce-battelle"), + APPLICATION_VND_COMMONSPACE("application/vnd.commonspace"), + APPLICATION_VND_COREOS_IGNITION_JSON("application/vnd.coreos.ignition+json"), + APPLICATION_VND_COSMOCALLER("application/vnd.cosmocaller"), + APPLICATION_VND_CONTACT_CMSG("application/vnd.contact.cmsg"), + APPLICATION_VND_CRICK_CLICKER("application/vnd.crick.clicker"), + APPLICATION_VND_CRICK_CLICKER_KEYBOARD("application/vnd.crick.clicker.keyboard"), + APPLICATION_VND_CRICK_CLICKER_PALETTE("application/vnd.crick.clicker.palette"), + APPLICATION_VND_CRICK_CLICKER_TEMPLATE("application/vnd.crick.clicker.template"), + APPLICATION_VND_CRICK_CLICKER_WORDBANK("application/vnd.crick.clicker.wordbank"), + APPLICATION_VND_CRITICALTOOLS_WBS_XML("application/vnd.criticaltools.wbs+xml"), + APPLICATION_VND_CRYPTII_PIPE_JSON("application/vnd.cryptii.pipe+json"), + APPLICATION_VND_CRYPTO_SHADE_FILE("application/vnd.crypto-shade-file"), + APPLICATION_VND_CRYPTOMATOR_ENCRYPTED("application/vnd.cryptomator.encrypted"), + APPLICATION_VND_CRYPTOMATOR_VAULT("application/vnd.cryptomator.vault"), + APPLICATION_VND_CTC_POSML("application/vnd.ctc-posml"), + APPLICATION_VND_CTCT_WS_XML("application/vnd.ctct.ws+xml"), + APPLICATION_VND_CUPS_PDF("application/vnd.cups-pdf"), + APPLICATION_VND_CUPS_POSTSCRIPT("application/vnd.cups-postscript"), + APPLICATION_VND_CUPS_PPD("application/vnd.cups-ppd"), + APPLICATION_VND_CUPS_RASTER("application/vnd.cups-raster"), + APPLICATION_VND_CUPS_RAW("application/vnd.cups-raw"), + APPLICATION_VND_CURL("application/vnd.curl"), + APPLICATION_VND_CYAN_DEAN_ROOT_XML("application/vnd.cyan.dean.root+xml"), + APPLICATION_VND_CYBANK("application/vnd.cybank"), + APPLICATION_VND_CYCLONEDX_JSON("application/vnd.cyclonedx+json"), + APPLICATION_VND_CYCLONEDX_XML("application/vnd.cyclonedx+xml"), + APPLICATION_VND_D2L_COURSEPACKAGE1P0_ZIP("application/vnd.d2l.coursepackage1p0+zip"), + APPLICATION_VND_D3M_DATASET("application/vnd.d3m-dataset"), + APPLICATION_VND_D3M_PROBLEM("application/vnd.d3m-problem"), + APPLICATION_VND_DART("application/vnd.dart"), + APPLICATION_VND_DATA_VISION_RDZ("application/vnd.data-vision.rdz"), + APPLICATION_VND_DATALOG("application/vnd.datalog"), + APPLICATION_VND_DATAPACKAGE_JSON("application/vnd.datapackage+json"), + APPLICATION_VND_DATARESOURCE_JSON("application/vnd.dataresource+json"), + APPLICATION_VND_DBF("application/vnd.dbf"), + APPLICATION_VND_DCMP_XML("application/vnd.dcmp+xml"), + APPLICATION_VND_DEBIAN_BINARY_PACKAGE("application/vnd.debian.binary-package"), + APPLICATION_VND_DECE_DATA("application/vnd.dece.data"), + APPLICATION_VND_DECE_TTML_XML("application/vnd.dece.ttml+xml"), + APPLICATION_VND_DECE_UNSPECIFIED("application/vnd.dece.unspecified"), + APPLICATION_VND_DECE_ZIP("application/vnd.dece.zip"), + APPLICATION_VND_DENOVO_FCSELAYOUT_LINK("application/vnd.denovo.fcselayout-link"), + APPLICATION_VND_DESMUME_MOVIE("application/vnd.desmume.movie"), + APPLICATION_VND_DIR_BI_PLATE_DL_NOSUFFIX("application/vnd.dir-bi.plate-dl-nosuffix"), + APPLICATION_VND_DM_DELEGATION_XML("application/vnd.dm.delegation+xml"), + APPLICATION_VND_DNA("application/vnd.dna"), + APPLICATION_VND_DOCUMENT_JSON("application/vnd.document+json"), + APPLICATION_VND_DOLBY_MOBILE_1("application/vnd.dolby.mobile.1"), + APPLICATION_VND_DOLBY_MOBILE_2("application/vnd.dolby.mobile.2"), + APPLICATION_VND_DOREMIR_SCORECLOUD_BINARY_DOCUMENT("application/vnd.doremir.scorecloud-binary-document"), + APPLICATION_VND_DPGRAPH("application/vnd.dpgraph"), + APPLICATION_VND_DREAMFACTORY("application/vnd.dreamfactory"), + APPLICATION_VND_DRIVE_JSON("application/vnd.drive+json"), + APPLICATION_VND_DTG_LOCAL("application/vnd.dtg.local"), + APPLICATION_VND_DTG_LOCAL_FLASH("application/vnd.dtg.local.flash"), + APPLICATION_VND_DTG_LOCAL_HTML("application/vnd.dtg.local.html"), + APPLICATION_VND_DVB_AIT("application/vnd.dvb.ait"), + APPLICATION_VND_DVB_DVBISL_XML("application/vnd.dvb.dvbisl+xml"), + APPLICATION_VND_DVB_DVBJ("application/vnd.dvb.dvbj"), + APPLICATION_VND_DVB_ESGCONTAINER("application/vnd.dvb.esgcontainer"), + APPLICATION_VND_DVB_IPDCDFTNOTIFACCESS("application/vnd.dvb.ipdcdftnotifaccess"), + APPLICATION_VND_DVB_IPDCESGACCESS("application/vnd.dvb.ipdcesgaccess"), + APPLICATION_VND_DVB_IPDCESGACCESS2("application/vnd.dvb.ipdcesgaccess2"), + APPLICATION_VND_DVB_IPDCESGPDD("application/vnd.dvb.ipdcesgpdd"), + APPLICATION_VND_DVB_IPDCROAMING("application/vnd.dvb.ipdcroaming"), + APPLICATION_VND_DVB_IPTV_ALFEC_BASE("application/vnd.dvb.iptv.alfec-base"), + APPLICATION_VND_DVB_IPTV_ALFEC_ENHANCEMENT("application/vnd.dvb.iptv.alfec-enhancement"), + APPLICATION_VND_DVB_NOTIF_AGGREGATE_ROOT_XML("application/vnd.dvb.notif-aggregate-root+xml"), + APPLICATION_VND_DVB_NOTIF_CONTAINER_XML("application/vnd.dvb.notif-container+xml"), + APPLICATION_VND_DVB_NOTIF_GENERIC_XML("application/vnd.dvb.notif-generic+xml"), + APPLICATION_VND_DVB_NOTIF_IA_MSGLIST_XML("application/vnd.dvb.notif-ia-msglist+xml"), + APPLICATION_VND_DVB_NOTIF_IA_REGISTRATION_REQUEST_XML("application/vnd.dvb.notif-ia-registration-request+xml"), + APPLICATION_VND_DVB_NOTIF_IA_REGISTRATION_RESPONSE_XML("application/vnd.dvb.notif-ia-registration-response+xml"), + APPLICATION_VND_DVB_NOTIF_INIT_XML("application/vnd.dvb.notif-init+xml"), + APPLICATION_VND_DVB_PFR("application/vnd.dvb.pfr"), + APPLICATION_VND_DVB_SERVICE("application/vnd.dvb.service"), + APPLICATION_VND_DXR("application/vnd.dxr"), + APPLICATION_VND_DYNAGEO("application/vnd.dynageo"), + APPLICATION_VND_DZR("application/vnd.dzr"), + APPLICATION_VND_EASYKARAOKE_CDGDOWNLOAD("application/vnd.easykaraoke.cdgdownload"), + APPLICATION_VND_ECIP_RLP("application/vnd.ecip.rlp"), + APPLICATION_VND_ECDIS_UPDATE("application/vnd.ecdis-update"), + APPLICATION_VND_ECLIPSE_DITTO_JSON("application/vnd.eclipse.ditto+json"), + APPLICATION_VND_ECOWIN_CHART("application/vnd.ecowin.chart"), + APPLICATION_VND_ECOWIN_FILEREQUEST("application/vnd.ecowin.filerequest"), + APPLICATION_VND_ECOWIN_FILEUPDATE("application/vnd.ecowin.fileupdate"), + APPLICATION_VND_ECOWIN_SERIES("application/vnd.ecowin.series"), + APPLICATION_VND_ECOWIN_SERIESREQUEST("application/vnd.ecowin.seriesrequest"), + APPLICATION_VND_ECOWIN_SERIESUPDATE("application/vnd.ecowin.seriesupdate"), + APPLICATION_VND_EFI_IMG("application/vnd.efi.img"), + APPLICATION_VND_EFI_ISO("application/vnd.efi.iso"), + APPLICATION_VND_ELN_ZIP("application/vnd.eln+zip"), + APPLICATION_VND_EMCLIENT_ACCESSREQUEST_XML("application/vnd.emclient.accessrequest+xml"), + APPLICATION_VND_ENLIVEN("application/vnd.enliven"), + APPLICATION_VND_ENPHASE_ENVOY("application/vnd.enphase.envoy"), + APPLICATION_VND_EPRINTS_DATA_XML("application/vnd.eprints.data+xml"), + APPLICATION_VND_EPSON_ESF("application/vnd.epson.esf"), + APPLICATION_VND_EPSON_MSF("application/vnd.epson.msf"), + APPLICATION_VND_EPSON_QUICKANIME("application/vnd.epson.quickanime"), + APPLICATION_VND_EPSON_SALT("application/vnd.epson.salt"), + APPLICATION_VND_EPSON_SSF("application/vnd.epson.ssf"), + APPLICATION_VND_ERICSSON_QUICKCALL("application/vnd.ericsson.quickcall"), + APPLICATION_VND_EROFS("application/vnd.erofs"), + APPLICATION_VND_ESPASS_ESPASS_ZIP("application/vnd.espass-espass+zip"), + APPLICATION_VND_ESZIGNO3_XML("application/vnd.eszigno3+xml"), + APPLICATION_VND_ETSI_AOC_XML("application/vnd.etsi.aoc+xml"), + APPLICATION_VND_ETSI_ASIC_S_ZIP("application/vnd.etsi.asic-s+zip"), + APPLICATION_VND_ETSI_ASIC_E_ZIP("application/vnd.etsi.asic-e+zip"), + APPLICATION_VND_ETSI_CUG_XML("application/vnd.etsi.cug+xml"), + APPLICATION_VND_ETSI_IPTVCOMMAND_XML("application/vnd.etsi.iptvcommand+xml"), + APPLICATION_VND_ETSI_IPTVDISCOVERY_XML("application/vnd.etsi.iptvdiscovery+xml"), + APPLICATION_VND_ETSI_IPTVPROFILE_XML("application/vnd.etsi.iptvprofile+xml"), + APPLICATION_VND_ETSI_IPTVSAD_BC_XML("application/vnd.etsi.iptvsad-bc+xml"), + APPLICATION_VND_ETSI_IPTVSAD_COD_XML("application/vnd.etsi.iptvsad-cod+xml"), + APPLICATION_VND_ETSI_IPTVSAD_NPVR_XML("application/vnd.etsi.iptvsad-npvr+xml"), + APPLICATION_VND_ETSI_IPTVSERVICE_XML("application/vnd.etsi.iptvservice+xml"), + APPLICATION_VND_ETSI_IPTVSYNC_XML("application/vnd.etsi.iptvsync+xml"), + APPLICATION_VND_ETSI_IPTVUEPROFILE_XML("application/vnd.etsi.iptvueprofile+xml"), + APPLICATION_VND_ETSI_MCID_XML("application/vnd.etsi.mcid+xml"), + APPLICATION_VND_ETSI_MHEG5("application/vnd.etsi.mheg5"), + APPLICATION_VND_ETSI_OVERLOAD_CONTROL_POLICY_DATASET_XML("application/vnd.etsi.overload-control-policy-dataset+xml"), + APPLICATION_VND_ETSI_PSTN_XML("application/vnd.etsi.pstn+xml"), + APPLICATION_VND_ETSI_SCI_XML("application/vnd.etsi.sci+xml"), + APPLICATION_VND_ETSI_SIMSERVS_XML("application/vnd.etsi.simservs+xml"), + APPLICATION_VND_ETSI_TIMESTAMP_TOKEN("application/vnd.etsi.timestamp-token"), + APPLICATION_VND_ETSI_TSL_XML("application/vnd.etsi.tsl+xml"), + APPLICATION_VND_ETSI_TSL_DER("application/vnd.etsi.tsl.der"), + APPLICATION_VND_EU_KASPARIAN_CAR_JSON("application/vnd.eu.kasparian.car+json"), + APPLICATION_VND_EUDORA_DATA("application/vnd.eudora.data"), + APPLICATION_VND_EVOLV_ECIG_PROFILE("application/vnd.evolv.ecig.profile"), + APPLICATION_VND_EVOLV_ECIG_SETTINGS("application/vnd.evolv.ecig.settings"), + APPLICATION_VND_EVOLV_ECIG_THEME("application/vnd.evolv.ecig.theme"), + APPLICATION_VND_EXSTREAM_EMPOWER_ZIP("application/vnd.exstream-empower+zip"), + APPLICATION_VND_EXSTREAM_PACKAGE("application/vnd.exstream-package"), + APPLICATION_VND_EZPIX_ALBUM("application/vnd.ezpix-album"), + APPLICATION_VND_EZPIX_PACKAGE("application/vnd.ezpix-package"), + APPLICATION_VND_F_SECURE_MOBILE("application/vnd.f-secure.mobile"), + APPLICATION_VND_FAF_YAML("application/vnd.faf+yaml"), + APPLICATION_VND_FASTCOPY_DISK_IMAGE("application/vnd.fastcopy-disk-image"), + APPLICATION_VND_FAMILYSEARCH_GEDCOM_ZIP("application/vnd.familysearch.gedcom+zip"), + APPLICATION_VND_FDSN_MSEED("application/vnd.fdsn.mseed"), + APPLICATION_VND_FDSN_SEED("application/vnd.fdsn.seed"), + APPLICATION_VND_FDSN_STATIONXML_XML("application/vnd.fdsn.stationxml+xml"), + APPLICATION_VND_FFSNS("application/vnd.ffsns"), + APPLICATION_VND_FGB("application/vnd.fgb"), + APPLICATION_VND_FICLAB_FLB_ZIP("application/vnd.ficlab.flb+zip"), + APPLICATION_VND_FILMIT_ZFC("application/vnd.filmit.zfc"), + APPLICATION_VND_FINTS("application/vnd.fints"), + APPLICATION_VND_FIREMONKEYS_CLOUDCELL("application/vnd.firemonkeys.cloudcell"), + APPLICATION_VND_FLOGRAPHIT("application/vnd.FloGraphIt"), + APPLICATION_VND_FLUXTIME_CLIP("application/vnd.fluxtime.clip"), + APPLICATION_VND_FONT_FONTFORGE_SFD("application/vnd.font-fontforge-sfd"), + APPLICATION_VND_FRAMEMAKER("application/vnd.framemaker"), + APPLICATION_VND_FREELOG_COMIC("application/vnd.freelog.comic"), + APPLICATION_VND_FROGANS_FNC("application/vnd.frogans.fnc"), + APPLICATION_VND_FROGANS_LTF("application/vnd.frogans.ltf"), + APPLICATION_VND_FSC_WEBLAUNCH("application/vnd.fsc.weblaunch"), + APPLICATION_VND_FUJIFILM_FB_DOCUWORKS("application/vnd.fujifilm.fb.docuworks"), + APPLICATION_VND_FUJIFILM_FB_DOCUWORKS_BINDER("application/vnd.fujifilm.fb.docuworks.binder"), + APPLICATION_VND_FUJIFILM_FB_DOCUWORKS_CONTAINER("application/vnd.fujifilm.fb.docuworks.container"), + APPLICATION_VND_FUJIFILM_FB_JFI_XML("application/vnd.fujifilm.fb.jfi+xml"), + APPLICATION_VND_FUJITSU_OASYS("application/vnd.fujitsu.oasys"), + APPLICATION_VND_FUJITSU_OASYS2("application/vnd.fujitsu.oasys2"), + APPLICATION_VND_FUJITSU_OASYS3("application/vnd.fujitsu.oasys3"), + APPLICATION_VND_FUJITSU_OASYSGP("application/vnd.fujitsu.oasysgp"), + APPLICATION_VND_FUJITSU_OASYSPRS("application/vnd.fujitsu.oasysprs"), + APPLICATION_VND_FUJIXEROX_ART4("application/vnd.fujixerox.ART4"), + APPLICATION_VND_FUJIXEROX_ART_EX("application/vnd.fujixerox.ART-EX"), + APPLICATION_VND_FUJIXEROX_DDD("application/vnd.fujixerox.ddd"), + APPLICATION_VND_FUJIXEROX_DOCUWORKS("application/vnd.fujixerox.docuworks"), + APPLICATION_VND_FUJIXEROX_DOCUWORKS_BINDER("application/vnd.fujixerox.docuworks.binder"), + APPLICATION_VND_FUJIXEROX_DOCUWORKS_CONTAINER("application/vnd.fujixerox.docuworks.container"), + APPLICATION_VND_FUJIXEROX_HBPL("application/vnd.fujixerox.HBPL"), + APPLICATION_VND_FUT_MISNET("application/vnd.fut-misnet"), + APPLICATION_VND_FUTOIN_CBOR("application/vnd.futoin+cbor"), + APPLICATION_VND_FUTOIN_JSON("application/vnd.futoin+json"), + APPLICATION_VND_FUZZYSHEET("application/vnd.fuzzysheet"), + APPLICATION_VND_G3PIX_G3FC("application/vnd.g3pix.g3fc"), + APPLICATION_VND_GA4GH_PASSPORT_JWT("application/vnd.ga4gh.passport+jwt"), + APPLICATION_VND_GENOMATIX_TUXEDO("application/vnd.genomatix.tuxedo"), + APPLICATION_VND_GENOZIP("application/vnd.genozip"), + APPLICATION_VND_GENTICS_GRD_JSON("application/vnd.gentics.grd+json"), + APPLICATION_VND_GENTOO_CATMETADATA_XML("application/vnd.gentoo.catmetadata+xml"), + APPLICATION_VND_GENTOO_EBUILD("application/vnd.gentoo.ebuild"), + APPLICATION_VND_GENTOO_ECLASS("application/vnd.gentoo.eclass"), + APPLICATION_VND_GENTOO_GPKG("application/vnd.gentoo.gpkg"), + APPLICATION_VND_GENTOO_MANIFEST("application/vnd.gentoo.manifest"), + APPLICATION_VND_GENTOO_XPAK("application/vnd.gentoo.xpak"), + APPLICATION_VND_GENTOO_PKGMETADATA_XML("application/vnd.gentoo.pkgmetadata+xml"), + APPLICATION_VND_GEO_JSON("application/vnd.geo+json"), + APPLICATION_VND_GEOCUBE_XML("application/vnd.geocube+xml"), + APPLICATION_VND_GEOGEBRA_FILE("application/vnd.geogebra.file"), + APPLICATION_VND_GEOGEBRA_PINBOARD("application/vnd.geogebra.pinboard"), + APPLICATION_VND_GEOGEBRA_SLIDES("application/vnd.geogebra.slides"), + APPLICATION_VND_GEOGEBRA_TOOL("application/vnd.geogebra.tool"), + APPLICATION_VND_GEOMETRY_EXPLORER("application/vnd.geometry-explorer"), + APPLICATION_VND_GEONEXT("application/vnd.geonext"), + APPLICATION_VND_GEOPLAN("application/vnd.geoplan"), + APPLICATION_VND_GEOSPACE("application/vnd.geospace"), + APPLICATION_VND_GERBER("application/vnd.gerber"), + APPLICATION_VND_GLOBALPLATFORM_CARD_CONTENT_MGT("application/vnd.globalplatform.card-content-mgt"), + APPLICATION_VND_GLOBALPLATFORM_CARD_CONTENT_MGT_RESPONSE("application/vnd.globalplatform.card-content-mgt-response"), + APPLICATION_VND_GMX("application/vnd.gmx"), + APPLICATION_VND_GNU_TALER_EXCHANGE_JSON("application/vnd.gnu.taler.exchange+json"), + APPLICATION_VND_GNU_TALER_MERCHANT_JSON("application/vnd.gnu.taler.merchant+json"), + APPLICATION_VND_GOOGLE_EARTH_KML_XML("application/vnd.google-earth.kml+xml"), + APPLICATION_VND_GOOGLE_EARTH_KMZ("application/vnd.google-earth.kmz"), + APPLICATION_VND_GOV_SK_E_FORM_XML("application/vnd.gov.sk.e-form+xml"), + APPLICATION_VND_GOV_SK_E_FORM_ZIP("application/vnd.gov.sk.e-form+zip"), + APPLICATION_VND_GOV_SK_XMLDATACONTAINER_XML("application/vnd.gov.sk.xmldatacontainer+xml"), + APPLICATION_VND_GPXSEE_MAP_XML("application/vnd.gpxsee.map+xml"), + APPLICATION_VND_GRAFEQ("application/vnd.grafeq"), + APPLICATION_VND_GRIDMP("application/vnd.gridmp"), + APPLICATION_VND_GROOVE_ACCOUNT("application/vnd.groove-account"), + APPLICATION_VND_GROOVE_HELP("application/vnd.groove-help"), + APPLICATION_VND_GROOVE_IDENTITY_MESSAGE("application/vnd.groove-identity-message"), + APPLICATION_VND_GROOVE_INJECTOR("application/vnd.groove-injector"), + APPLICATION_VND_GROOVE_TOOL_MESSAGE("application/vnd.groove-tool-message"), + APPLICATION_VND_GROOVE_TOOL_TEMPLATE("application/vnd.groove-tool-template"), + APPLICATION_VND_GROOVE_VCARD("application/vnd.groove-vcard"), + APPLICATION_VND_HAL_JSON("application/vnd.hal+json"), + APPLICATION_VND_HAL_XML("application/vnd.hal+xml"), + APPLICATION_VND_HANDHELD_ENTERTAINMENT_XML("application/vnd.HandHeld-Entertainment+xml"), + APPLICATION_VND_HBCI("application/vnd.hbci"), + APPLICATION_VND_HC_JSON("application/vnd.hc+json"), + APPLICATION_VND_HCL_BIREPORTS("application/vnd.hcl-bireports"), + APPLICATION_VND_HDT("application/vnd.hdt"), + APPLICATION_VND_HEROKU_JSON("application/vnd.heroku+json"), + APPLICATION_VND_HHE_LESSON_PLAYER("application/vnd.hhe.lesson-player"), + APPLICATION_VND_HP_HPGL("application/vnd.hp-HPGL"), + APPLICATION_VND_HP_HPID("application/vnd.hp-hpid"), + APPLICATION_VND_HP_HPS("application/vnd.hp-hps"), + APPLICATION_VND_HP_JLYT("application/vnd.hp-jlyt"), + APPLICATION_VND_HP_PCL("application/vnd.hp-PCL"), + APPLICATION_VND_HP_PCLXL("application/vnd.hp-PCLXL"), + APPLICATION_VND_HSL("application/vnd.hsl"), + APPLICATION_VND_HTTPHONE("application/vnd.httphone"), + APPLICATION_VND_HYDROSTATIX_SOF_DATA("application/vnd.hydrostatix.sof-data"), + APPLICATION_VND_HYPER_ITEM_JSON("application/vnd.hyper-item+json"), + APPLICATION_VND_HYPER_JSON("application/vnd.hyper+json"), + APPLICATION_VND_HYPERDRIVE_JSON("application/vnd.hyperdrive+json"), + APPLICATION_VND_HZN_3D_CROSSWORD("application/vnd.hzn-3d-crossword"), + APPLICATION_VND_IBM_AFPLINEDATA("application/vnd.ibm.afplinedata"), + APPLICATION_VND_IBM_ELECTRONIC_MEDIA("application/vnd.ibm.electronic-media"), + APPLICATION_VND_IBM_MINIPAY("application/vnd.ibm.MiniPay"), + APPLICATION_VND_IBM_MODCAP("application/vnd.ibm.modcap"), + APPLICATION_VND_IBM_RIGHTS_MANAGEMENT("application/vnd.ibm.rights-management"), + APPLICATION_VND_IBM_SECURE_CONTAINER("application/vnd.ibm.secure-container"), + APPLICATION_VND_ICCPROFILE("application/vnd.iccprofile"), + APPLICATION_VND_IEEE_1905("application/vnd.ieee.1905"), + APPLICATION_VND_IGLOADER("application/vnd.igloader"), + APPLICATION_VND_IMAGEMETER_FOLDER_ZIP("application/vnd.imagemeter.folder+zip"), + APPLICATION_VND_IMAGEMETER_IMAGE_ZIP("application/vnd.imagemeter.image+zip"), + APPLICATION_VND_IMMERVISION_IVP("application/vnd.immervision-ivp"), + APPLICATION_VND_IMMERVISION_IVU("application/vnd.immervision-ivu"), + APPLICATION_VND_IMS_IMSCCV1P1("application/vnd.ims.imsccv1p1"), + APPLICATION_VND_IMS_IMSCCV1P2("application/vnd.ims.imsccv1p2"), + APPLICATION_VND_IMS_IMSCCV1P3("application/vnd.ims.imsccv1p3"), + APPLICATION_VND_IMS_LIS_V2_RESULT_JSON("application/vnd.ims.lis.v2.result+json"), + APPLICATION_VND_IMS_LTI_V2_TOOLCONSUMERPROFILE_JSON("application/vnd.ims.lti.v2.toolconsumerprofile+json"), + APPLICATION_VND_IMS_LTI_V2_TOOLPROXY_ID_JSON("application/vnd.ims.lti.v2.toolproxy.id+json"), + APPLICATION_VND_IMS_LTI_V2_TOOLPROXY_JSON("application/vnd.ims.lti.v2.toolproxy+json"), + APPLICATION_VND_IMS_LTI_V2_TOOLSETTINGS_JSON("application/vnd.ims.lti.v2.toolsettings+json"), + APPLICATION_VND_IMS_LTI_V2_TOOLSETTINGS_SIMPLE_JSON("application/vnd.ims.lti.v2.toolsettings.simple+json"), + APPLICATION_VND_INFORMEDCONTROL_RMS_XML("application/vnd.informedcontrol.rms+xml"), + APPLICATION_VND_INFOTECH_PROJECT("application/vnd.infotech.project"), + APPLICATION_VND_INFOTECH_PROJECT_XML("application/vnd.infotech.project+xml"), + APPLICATION_VND_INFORMIX_VISIONARY("application/vnd.informix-visionary"), + APPLICATION_VND_INNOPATH_WAMP_NOTIFICATION("application/vnd.innopath.wamp.notification"), + APPLICATION_VND_INSORS_IGM("application/vnd.insors.igm"), + APPLICATION_VND_INTERCON_FORMNET("application/vnd.intercon.formnet"), + APPLICATION_VND_INTERGEO("application/vnd.intergeo"), + APPLICATION_VND_INTERTRUST_DIGIBOX("application/vnd.intertrust.digibox"), + APPLICATION_VND_INTERTRUST_NNCP("application/vnd.intertrust.nncp"), + APPLICATION_VND_INTU_QBO("application/vnd.intu.qbo"), + APPLICATION_VND_INTU_QFX("application/vnd.intu.qfx"), + APPLICATION_VND_IPFS_IPNS_RECORD("application/vnd.ipfs.ipns-record"), + APPLICATION_VND_IPLD_CAR("application/vnd.ipld.car"), + APPLICATION_VND_IPLD_DAG_CBOR("application/vnd.ipld.dag-cbor"), + APPLICATION_VND_IPLD_DAG_JSON("application/vnd.ipld.dag-json"), + APPLICATION_VND_IPLD_RAW("application/vnd.ipld.raw"), + APPLICATION_VND_IPTC_G2_CATALOGITEM_XML("application/vnd.iptc.g2.catalogitem+xml"), + APPLICATION_VND_IPTC_G2_CONCEPTITEM_XML("application/vnd.iptc.g2.conceptitem+xml"), + APPLICATION_VND_IPTC_G2_KNOWLEDGEITEM_XML("application/vnd.iptc.g2.knowledgeitem+xml"), + APPLICATION_VND_IPTC_G2_NEWSITEM_XML("application/vnd.iptc.g2.newsitem+xml"), + APPLICATION_VND_IPTC_G2_NEWSMESSAGE_XML("application/vnd.iptc.g2.newsmessage+xml"), + APPLICATION_VND_IPTC_G2_PACKAGEITEM_XML("application/vnd.iptc.g2.packageitem+xml"), + APPLICATION_VND_IPTC_G2_PLANNINGITEM_XML("application/vnd.iptc.g2.planningitem+xml"), + APPLICATION_VND_IPUNPLUGGED_RCPROFILE("application/vnd.ipunplugged.rcprofile"), + APPLICATION_VND_IREPOSITORY_PACKAGE_XML("application/vnd.irepository.package+xml"), + APPLICATION_VND_IS_XPR("application/vnd.is-xpr"), + APPLICATION_VND_ISAC_FCS("application/vnd.isac.fcs"), + APPLICATION_VND_JAM("application/vnd.jam"), + APPLICATION_VND_ISO11783_10_ZIP("application/vnd.iso11783-10+zip"), + APPLICATION_VND_JAPANNET_DIRECTORY_SERVICE("application/vnd.japannet-directory-service"), + APPLICATION_VND_JAPANNET_JPNSTORE_WAKEUP("application/vnd.japannet-jpnstore-wakeup"), + APPLICATION_VND_JAPANNET_PAYMENT_WAKEUP("application/vnd.japannet-payment-wakeup"), + APPLICATION_VND_JAPANNET_REGISTRATION("application/vnd.japannet-registration"), + APPLICATION_VND_JAPANNET_REGISTRATION_WAKEUP("application/vnd.japannet-registration-wakeup"), + APPLICATION_VND_JAPANNET_SETSTORE_WAKEUP("application/vnd.japannet-setstore-wakeup"), + APPLICATION_VND_JAPANNET_VERIFICATION("application/vnd.japannet-verification"), + APPLICATION_VND_JAPANNET_VERIFICATION_WAKEUP("application/vnd.japannet-verification-wakeup"), + APPLICATION_VND_JCP_JAVAME_MIDLET_RMS("application/vnd.jcp.javame.midlet-rms"), + APPLICATION_VND_JISP("application/vnd.jisp"), + APPLICATION_VND_JOOST_JODA_ARCHIVE("application/vnd.joost.joda-archive"), + APPLICATION_VND_JSK_ISDN_NGN("application/vnd.jsk.isdn-ngn"), + APPLICATION_VND_KAHOOTZ("application/vnd.kahootz"), + APPLICATION_VND_KDE_KARBON("application/vnd.kde.karbon"), + APPLICATION_VND_KDE_KCHART("application/vnd.kde.kchart"), + APPLICATION_VND_KDE_KFORMULA("application/vnd.kde.kformula"), + APPLICATION_VND_KDE_KIVIO("application/vnd.kde.kivio"), + APPLICATION_VND_KDE_KONTOUR("application/vnd.kde.kontour"), + APPLICATION_VND_KDE_KPRESENTER("application/vnd.kde.kpresenter"), + APPLICATION_VND_KDE_KSPREAD("application/vnd.kde.kspread"), + APPLICATION_VND_KDE_KWORD("application/vnd.kde.kword"), + APPLICATION_VND_KDL("application/vnd.kdl"), + APPLICATION_VND_KENAMEAAPP("application/vnd.kenameaapp"), + APPLICATION_VND_KEYMAN_KMP_ZIP("application/vnd.keyman.kmp+zip"), + APPLICATION_VND_KEYMAN_KMX("application/vnd.keyman.kmx"), + APPLICATION_VND_KIDSPIRATION("application/vnd.kidspiration"), + APPLICATION_VND_KINAR("application/vnd.Kinar"), + APPLICATION_VND_KOAN("application/vnd.koan"), + APPLICATION_VND_KODAK_DESCRIPTOR("application/vnd.kodak-descriptor"), + APPLICATION_VND_LAS("application/vnd.las"), + APPLICATION_VND_LAS_LAS_JSON("application/vnd.las.las+json"), + APPLICATION_VND_LAS_LAS_XML("application/vnd.las.las+xml"), + APPLICATION_VND_LASZIP("application/vnd.laszip"), + APPLICATION_VND_LDEV_PRODUCTLICENSING("application/vnd.ldev.productlicensing"), + APPLICATION_VND_LEAP_JSON("application/vnd.leap+json"), + APPLICATION_VND_LIBERTY_REQUEST_XML("application/vnd.liberty-request+xml"), + APPLICATION_VND_LLAMAGRAPHICS_LIFE_BALANCE_DESKTOP("application/vnd.llamagraphics.life-balance.desktop"), + APPLICATION_VND_LLAMAGRAPHICS_LIFE_BALANCE_EXCHANGE_XML("application/vnd.llamagraphics.life-balance.exchange+xml"), + APPLICATION_VND_LOGIPIPE_CIRCUIT_ZIP("application/vnd.logipipe.circuit+zip"), + APPLICATION_VND_LOOM("application/vnd.loom"), + APPLICATION_VND_LOTUS_1_2_3("application/vnd.lotus-1-2-3"), + APPLICATION_VND_LOTUS_APPROACH("application/vnd.lotus-approach"), + APPLICATION_VND_LOTUS_FREELANCE("application/vnd.lotus-freelance"), + APPLICATION_VND_LOTUS_NOTES("application/vnd.lotus-notes"), + APPLICATION_VND_LOTUS_ORGANIZER("application/vnd.lotus-organizer"), + APPLICATION_VND_LOTUS_SCREENCAM("application/vnd.lotus-screencam"), + APPLICATION_VND_LOTUS_WORDPRO("application/vnd.lotus-wordpro"), + APPLICATION_VND_MACPORTS_PORTPKG("application/vnd.macports.portpkg"), + APPLICATION_VND_MAML("application/vnd.maml"), + APPLICATION_VND_MAPBOX_VECTOR_TILE("application/vnd.mapbox-vector-tile"), + APPLICATION_VND_MARLIN_DRM_ACTIONTOKEN_XML("application/vnd.marlin.drm.actiontoken+xml"), + APPLICATION_VND_MARLIN_DRM_CONFTOKEN_XML("application/vnd.marlin.drm.conftoken+xml"), + APPLICATION_VND_MARLIN_DRM_LICENSE_XML("application/vnd.marlin.drm.license+xml"), + APPLICATION_VND_MARLIN_DRM_MDCF("application/vnd.marlin.drm.mdcf"), + APPLICATION_VND_MASON_JSON("application/vnd.mason+json"), + APPLICATION_VND_MAXAR_ARCHIVE_3TZ_ZIP("application/vnd.maxar.archive.3tz+zip"), + APPLICATION_VND_MAXMIND_MAXMIND_DB("application/vnd.maxmind.maxmind-db"), + APPLICATION_VND_MCD("application/vnd.mcd"), + APPLICATION_VND_MDL("application/vnd.mdl"), + APPLICATION_VND_MDL_MBSDF("application/vnd.mdl-mbsdf"), + APPLICATION_VND_MEDCALCDATA("application/vnd.medcalcdata"), + APPLICATION_VND_MEDIASTATION_CDKEY("application/vnd.mediastation.cdkey"), + APPLICATION_VND_MEDICALHOLODECK_RECORDXR("application/vnd.medicalholodeck.recordxr"), + APPLICATION_VND_MERIDIAN_SLINGSHOT("application/vnd.meridian-slingshot"), + APPLICATION_VND_MERMAID("application/vnd.mermaid"), + APPLICATION_VND_MFER("application/vnd.MFER"), + APPLICATION_VND_MFMP("application/vnd.mfmp"), + APPLICATION_VND_MICRO_JSON("application/vnd.micro+json"), + APPLICATION_VND_MICROGRAFX_FLO("application/vnd.micrografx.flo"), + APPLICATION_VND_MICROGRAFX_IGX("application/vnd.micrografx.igx"), + APPLICATION_VND_MICROSOFT_PORTABLE_EXECUTABLE("application/vnd.microsoft.portable-executable"), + APPLICATION_VND_MICROSOFT_WINDOWS_THUMBNAIL_CACHE("application/vnd.microsoft.windows.thumbnail-cache"), + APPLICATION_VND_MIELE_JSON("application/vnd.miele+json"), + APPLICATION_VND_MIF("application/vnd.mif"), + APPLICATION_VND_MINISOFT_HP3000_SAVE("application/vnd.minisoft-hp3000-save"), + APPLICATION_VND_MITSUBISHI_MISTY_GUARD_TRUSTWEB("application/vnd.mitsubishi.misty-guard.trustweb"), + APPLICATION_VND_MOBIUS_DAF("application/vnd.Mobius.DAF"), + APPLICATION_VND_MOBIUS_DIS("application/vnd.Mobius.DIS"), + APPLICATION_VND_MOBIUS_MBK("application/vnd.Mobius.MBK"), + APPLICATION_VND_MOBIUS_MQY("application/vnd.Mobius.MQY"), + APPLICATION_VND_MOBIUS_MSL("application/vnd.Mobius.MSL"), + APPLICATION_VND_MOBIUS_PLC("application/vnd.Mobius.PLC"), + APPLICATION_VND_MOBIUS_TXF("application/vnd.Mobius.TXF"), + APPLICATION_VND_MODL("application/vnd.modl"), + APPLICATION_VND_MOPHUN_APPLICATION("application/vnd.mophun.application"), + APPLICATION_VND_MOPHUN_CERTIFICATE("application/vnd.mophun.certificate"), + APPLICATION_VND_MOTOROLA_FLEXSUITE("application/vnd.motorola.flexsuite"), + APPLICATION_VND_MOTOROLA_FLEXSUITE_ADSI("application/vnd.motorola.flexsuite.adsi"), + APPLICATION_VND_MOTOROLA_FLEXSUITE_FIS("application/vnd.motorola.flexsuite.fis"), + APPLICATION_VND_MOTOROLA_FLEXSUITE_GOTAP("application/vnd.motorola.flexsuite.gotap"), + APPLICATION_VND_MOTOROLA_FLEXSUITE_KMR("application/vnd.motorola.flexsuite.kmr"), + APPLICATION_VND_MOTOROLA_FLEXSUITE_TTC("application/vnd.motorola.flexsuite.ttc"), + APPLICATION_VND_MOTOROLA_FLEXSUITE_WEM("application/vnd.motorola.flexsuite.wem"), + APPLICATION_VND_MOTOROLA_IPRM("application/vnd.motorola.iprm"), + APPLICATION_VND_MOZILLA_XUL_XML("application/vnd.mozilla.xul+xml"), + APPLICATION_VND_MS_ARTGALRY("application/vnd.ms-artgalry"), + APPLICATION_VND_MS_ASF("application/vnd.ms-asf"), + APPLICATION_VND_MS_CAB_COMPRESSED("application/vnd.ms-cab-compressed"), + APPLICATION_VND_MS_3MFDOCUMENT("application/vnd.ms-3mfdocument"), + APPLICATION_VND_MS_EXCEL("application/vnd.ms-excel"), + APPLICATION_VND_MS_EXCEL_ADDIN_MACROENABLED_12("application/vnd.ms-excel.addin.macroEnabled.12"), + APPLICATION_VND_MS_EXCEL_SHEET_BINARY_MACROENABLED_12("application/vnd.ms-excel.sheet.binary.macroEnabled.12"), + APPLICATION_VND_MS_EXCEL_SHEET_MACROENABLED_12("application/vnd.ms-excel.sheet.macroEnabled.12"), + APPLICATION_VND_MS_EXCEL_TEMPLATE_MACROENABLED_12("application/vnd.ms-excel.template.macroEnabled.12"), + APPLICATION_VND_MS_FONTOBJECT("application/vnd.ms-fontobject"), + APPLICATION_VND_MS_HTMLHELP("application/vnd.ms-htmlhelp"), + APPLICATION_VND_MS_IMS("application/vnd.ms-ims"), + APPLICATION_VND_MS_LRM("application/vnd.ms-lrm"), + APPLICATION_VND_MS_OFFICE_ACTIVEX_XML("application/vnd.ms-office.activeX+xml"), + APPLICATION_VND_MS_OFFICETHEME("application/vnd.ms-officetheme"), + APPLICATION_VND_MS_PLAYREADY_INITIATOR_XML("application/vnd.ms-playready.initiator+xml"), + APPLICATION_VND_MS_POWERPOINT("application/vnd.ms-powerpoint"), + APPLICATION_VND_MS_POWERPOINT_ADDIN_MACROENABLED_12("application/vnd.ms-powerpoint.addin.macroEnabled.12"), + APPLICATION_VND_MS_POWERPOINT_PRESENTATION_MACROENABLED_12("application/vnd.ms-powerpoint.presentation.macroEnabled.12"), + APPLICATION_VND_MS_POWERPOINT_SLIDE_MACROENABLED_12("application/vnd.ms-powerpoint.slide.macroEnabled.12"), + APPLICATION_VND_MS_POWERPOINT_SLIDESHOW_MACROENABLED_12("application/vnd.ms-powerpoint.slideshow.macroEnabled.12"), + APPLICATION_VND_MS_POWERPOINT_TEMPLATE_MACROENABLED_12("application/vnd.ms-powerpoint.template.macroEnabled.12"), + APPLICATION_VND_MS_PRINTDEVICECAPABILITIES_XML("application/vnd.ms-PrintDeviceCapabilities+xml"), + APPLICATION_VND_MS_PRINTSCHEMATICKET_XML("application/vnd.ms-PrintSchemaTicket+xml"), + APPLICATION_VND_MS_PROJECT("application/vnd.ms-project"), + APPLICATION_VND_MS_TNEF("application/vnd.ms-tnef"), + APPLICATION_VND_MS_WINDOWS_DEVICEPAIRING("application/vnd.ms-windows.devicepairing"), + APPLICATION_VND_MS_WINDOWS_NWPRINTING_OOB("application/vnd.ms-windows.nwprinting.oob"), + APPLICATION_VND_MS_WINDOWS_PRINTERPAIRING("application/vnd.ms-windows.printerpairing"), + APPLICATION_VND_MS_WINDOWS_WSD_OOB("application/vnd.ms-windows.wsd.oob"), + APPLICATION_VND_MS_WMDRM_LIC_CHLG_REQ("application/vnd.ms-wmdrm.lic-chlg-req"), + APPLICATION_VND_MS_WMDRM_LIC_RESP("application/vnd.ms-wmdrm.lic-resp"), + APPLICATION_VND_MS_WMDRM_METER_CHLG_REQ("application/vnd.ms-wmdrm.meter-chlg-req"), + APPLICATION_VND_MS_WMDRM_METER_RESP("application/vnd.ms-wmdrm.meter-resp"), + APPLICATION_VND_MS_WORD_DOCUMENT_MACROENABLED_12("application/vnd.ms-word.document.macroEnabled.12"), + APPLICATION_VND_MS_WORD_TEMPLATE_MACROENABLED_12("application/vnd.ms-word.template.macroEnabled.12"), + APPLICATION_VND_MS_WORKS("application/vnd.ms-works"), + APPLICATION_VND_MS_WPL("application/vnd.ms-wpl"), + APPLICATION_VND_MS_XPSDOCUMENT("application/vnd.ms-xpsdocument"), + APPLICATION_VND_MSA_DISK_IMAGE("application/vnd.msa-disk-image"), + APPLICATION_VND_MSEQ("application/vnd.mseq"), + APPLICATION_VND_MSGPACK("application/vnd.msgpack"), + APPLICATION_VND_MSIGN("application/vnd.msign"), + APPLICATION_VND_MULTIAD_CREATOR("application/vnd.multiad.creator"), + APPLICATION_VND_MULTIAD_CREATOR_CIF("application/vnd.multiad.creator.cif"), + APPLICATION_VND_MUSICIAN("application/vnd.musician"), + APPLICATION_VND_MUSIC_NIFF("application/vnd.music-niff"), + APPLICATION_VND_MUVEE_STYLE("application/vnd.muvee.style"), + APPLICATION_VND_MYNFC("application/vnd.mynfc"), + APPLICATION_VND_NACAMAR_YBRID_JSON("application/vnd.nacamar.ybrid+json"), + APPLICATION_VND_NATO_BINDINGDATAOBJECT_CBOR("application/vnd.nato.bindingdataobject+cbor"), + APPLICATION_VND_NATO_BINDINGDATAOBJECT_JSON("application/vnd.nato.bindingdataobject+json"), + APPLICATION_VND_NATO_BINDINGDATAOBJECT_XML("application/vnd.nato.bindingdataobject+xml"), + APPLICATION_VND_NATO_OPENXMLFORMATS_PACKAGE_IEPD_ZIP("application/vnd.nato.openxmlformats-package.iepd+zip"), + APPLICATION_VND_NCD_CONTROL("application/vnd.ncd.control"), + APPLICATION_VND_NCD_REFERENCE("application/vnd.ncd.reference"), + APPLICATION_VND_NEARST_INV_JSON("application/vnd.nearst.inv+json"), + APPLICATION_VND_NEBUMIND_LINE("application/vnd.nebumind.line"), + APPLICATION_VND_NERVANA("application/vnd.nervana"), + APPLICATION_VND_NETFPX("application/vnd.netfpx"), + APPLICATION_VND_NEUROLANGUAGE_NLU("application/vnd.neurolanguage.nlu"), + APPLICATION_VND_NIMN("application/vnd.nimn"), + APPLICATION_VND_NINTENDO_SNES_ROM("application/vnd.nintendo.snes.rom"), + APPLICATION_VND_NINTENDO_NITRO_ROM("application/vnd.nintendo.nitro.rom"), + APPLICATION_VND_NITF("application/vnd.nitf"), + APPLICATION_VND_NOBLENET_DIRECTORY("application/vnd.noblenet-directory"), + APPLICATION_VND_NOBLENET_SEALER("application/vnd.noblenet-sealer"), + APPLICATION_VND_NOBLENET_WEB("application/vnd.noblenet-web"), + APPLICATION_VND_NOKIA_CATALOGS("application/vnd.nokia.catalogs"), + APPLICATION_VND_NOKIA_CONML_WBXML("application/vnd.nokia.conml+wbxml"), + APPLICATION_VND_NOKIA_CONML_XML("application/vnd.nokia.conml+xml"), + APPLICATION_VND_NOKIA_IPTV_CONFIG_XML("application/vnd.nokia.iptv.config+xml"), + APPLICATION_VND_NOKIA_ISDS_RADIO_PRESETS("application/vnd.nokia.iSDS-radio-presets"), + APPLICATION_VND_NOKIA_LANDMARK_WBXML("application/vnd.nokia.landmark+wbxml"), + APPLICATION_VND_NOKIA_LANDMARK_XML("application/vnd.nokia.landmark+xml"), + APPLICATION_VND_NOKIA_LANDMARKCOLLECTION_XML("application/vnd.nokia.landmarkcollection+xml"), + APPLICATION_VND_NOKIA_NCD("application/vnd.nokia.ncd"), + APPLICATION_VND_NOKIA_N_GAGE_AC_XML("application/vnd.nokia.n-gage.ac+xml"), + APPLICATION_VND_NOKIA_N_GAGE_DATA("application/vnd.nokia.n-gage.data"), + APPLICATION_VND_NOKIA_N_GAGE_SYMBIAN_INSTALL("application/vnd.nokia.n-gage.symbian.install"), + APPLICATION_VND_NOKIA_PCD_WBXML("application/vnd.nokia.pcd+wbxml"), + APPLICATION_VND_NOKIA_PCD_XML("application/vnd.nokia.pcd+xml"), + APPLICATION_VND_NOKIA_RADIO_PRESET("application/vnd.nokia.radio-preset"), + APPLICATION_VND_NOKIA_RADIO_PRESETS("application/vnd.nokia.radio-presets"), + APPLICATION_VND_NOVADIGM_EDM("application/vnd.novadigm.EDM"), + APPLICATION_VND_NOVADIGM_EDX("application/vnd.novadigm.EDX"), + APPLICATION_VND_NOVADIGM_EXT("application/vnd.novadigm.EXT"), + APPLICATION_VND_NTT_LOCAL_CONTENT_SHARE("application/vnd.ntt-local.content-share"), + APPLICATION_VND_NTT_LOCAL_FILE_TRANSFER("application/vnd.ntt-local.file-transfer"), + APPLICATION_VND_NTT_LOCAL_OGW_REMOTE_ACCESS("application/vnd.ntt-local.ogw_remote-access"), + APPLICATION_VND_NTT_LOCAL_SIP_TA_REMOTE("application/vnd.ntt-local.sip-ta_remote"), + APPLICATION_VND_NTT_LOCAL_SIP_TA_TCP_STREAM("application/vnd.ntt-local.sip-ta_tcp_stream"), + APPLICATION_VND_NUBALTEC_NUDOKU_GAME("application/vnd.nubaltec.nudoku-game"), + APPLICATION_VND_OAI_WORKFLOWS("application/vnd.oai.workflows"), + APPLICATION_VND_OAI_WORKFLOWS_JSON("application/vnd.oai.workflows+json"), + APPLICATION_VND_OAI_WORKFLOWS_YAML("application/vnd.oai.workflows+yaml"), + APPLICATION_VND_OASIS_OPENDOCUMENT_BASE("application/vnd.oasis.opendocument.base"), + APPLICATION_VND_OASIS_OPENDOCUMENT_CHART("application/vnd.oasis.opendocument.chart"), + APPLICATION_VND_OASIS_OPENDOCUMENT_CHART_TEMPLATE("application/vnd.oasis.opendocument.chart-template"), + APPLICATION_VND_OASIS_OPENDOCUMENT_DATABASE("application/vnd.oasis.opendocument.database"), + APPLICATION_VND_OASIS_OPENDOCUMENT_FORMULA("application/vnd.oasis.opendocument.formula"), + APPLICATION_VND_OASIS_OPENDOCUMENT_FORMULA_TEMPLATE("application/vnd.oasis.opendocument.formula-template"), + APPLICATION_VND_OASIS_OPENDOCUMENT_GRAPHICS("application/vnd.oasis.opendocument.graphics"), + APPLICATION_VND_OASIS_OPENDOCUMENT_GRAPHICS_TEMPLATE("application/vnd.oasis.opendocument.graphics-template"), + APPLICATION_VND_OASIS_OPENDOCUMENT_IMAGE("application/vnd.oasis.opendocument.image"), + APPLICATION_VND_OASIS_OPENDOCUMENT_IMAGE_TEMPLATE("application/vnd.oasis.opendocument.image-template"), + APPLICATION_VND_OASIS_OPENDOCUMENT_PRESENTATION("application/vnd.oasis.opendocument.presentation"), + APPLICATION_VND_OASIS_OPENDOCUMENT_PRESENTATION_TEMPLATE("application/vnd.oasis.opendocument.presentation-template"), + APPLICATION_VND_OASIS_OPENDOCUMENT_SPREADSHEET("application/vnd.oasis.opendocument.spreadsheet"), + APPLICATION_VND_OASIS_OPENDOCUMENT_SPREADSHEET_TEMPLATE("application/vnd.oasis.opendocument.spreadsheet-template"), + APPLICATION_VND_OASIS_OPENDOCUMENT_TEXT("application/vnd.oasis.opendocument.text"), + APPLICATION_VND_OASIS_OPENDOCUMENT_TEXT_MASTER("application/vnd.oasis.opendocument.text-master"), + APPLICATION_VND_OASIS_OPENDOCUMENT_TEXT_MASTER_TEMPLATE("application/vnd.oasis.opendocument.text-master-template"), + APPLICATION_VND_OASIS_OPENDOCUMENT_TEXT_TEMPLATE("application/vnd.oasis.opendocument.text-template"), + APPLICATION_VND_OASIS_OPENDOCUMENT_TEXT_WEB("application/vnd.oasis.opendocument.text-web"), + APPLICATION_VND_OBN("application/vnd.obn"), + APPLICATION_VND_OCF_CBOR("application/vnd.ocf+cbor"), + APPLICATION_VND_OCI_IMAGE_MANIFEST_V1_JSON("application/vnd.oci.image.manifest.v1+json"), + APPLICATION_VND_OFTN_L10N_JSON("application/vnd.oftn.l10n+json"), + APPLICATION_VND_OIPF_CONTENTACCESSDOWNLOAD_XML("application/vnd.oipf.contentaccessdownload+xml"), + APPLICATION_VND_OIPF_CONTENTACCESSSTREAMING_XML("application/vnd.oipf.contentaccessstreaming+xml"), + APPLICATION_VND_OIPF_CSPG_HEXBINARY("application/vnd.oipf.cspg-hexbinary"), + APPLICATION_VND_OIPF_DAE_SVG_XML("application/vnd.oipf.dae.svg+xml"), + APPLICATION_VND_OIPF_DAE_XHTML_XML("application/vnd.oipf.dae.xhtml+xml"), + APPLICATION_VND_OIPF_MIPPVCONTROLMESSAGE_XML("application/vnd.oipf.mippvcontrolmessage+xml"), + APPLICATION_VND_OIPF_PAE_GEM("application/vnd.oipf.pae.gem"), + APPLICATION_VND_OIPF_SPDISCOVERY_XML("application/vnd.oipf.spdiscovery+xml"), + APPLICATION_VND_OIPF_SPDLIST_XML("application/vnd.oipf.spdlist+xml"), + APPLICATION_VND_OIPF_UEPROFILE_XML("application/vnd.oipf.ueprofile+xml"), + APPLICATION_VND_OIPF_USERPROFILE_XML("application/vnd.oipf.userprofile+xml"), + APPLICATION_VND_OLPC_SUGAR("application/vnd.olpc-sugar"), + APPLICATION_VND_OMA_BCAST_ASSOCIATED_PROCEDURE_PARAMETER_XML("application/vnd.oma.bcast.associated-procedure-parameter+xml"), + APPLICATION_VND_OMA_BCAST_DRM_TRIGGER_XML("application/vnd.oma.bcast.drm-trigger+xml"), + APPLICATION_VND_OMA_BCAST_IMD_XML("application/vnd.oma.bcast.imd+xml"), + APPLICATION_VND_OMA_BCAST_LTKM("application/vnd.oma.bcast.ltkm"), + APPLICATION_VND_OMA_BCAST_NOTIFICATION_XML("application/vnd.oma.bcast.notification+xml"), + APPLICATION_VND_OMA_BCAST_PROVISIONINGTRIGGER("application/vnd.oma.bcast.provisioningtrigger"), + APPLICATION_VND_OMA_BCAST_SGBOOT("application/vnd.oma.bcast.sgboot"), + APPLICATION_VND_OMA_BCAST_SGDD_XML("application/vnd.oma.bcast.sgdd+xml"), + APPLICATION_VND_OMA_BCAST_SGDU("application/vnd.oma.bcast.sgdu"), + APPLICATION_VND_OMA_BCAST_SIMPLE_SYMBOL_CONTAINER("application/vnd.oma.bcast.simple-symbol-container"), + APPLICATION_VND_OMA_BCAST_SMARTCARD_TRIGGER_XML("application/vnd.oma.bcast.smartcard-trigger+xml"), + APPLICATION_VND_OMA_BCAST_SPROV_XML("application/vnd.oma.bcast.sprov+xml"), + APPLICATION_VND_OMA_BCAST_STKM("application/vnd.oma.bcast.stkm"), + APPLICATION_VND_OMA_CAB_ADDRESS_BOOK_XML("application/vnd.oma.cab-address-book+xml"), + APPLICATION_VND_OMA_CAB_FEATURE_HANDLER_XML("application/vnd.oma.cab-feature-handler+xml"), + APPLICATION_VND_OMA_CAB_PCC_XML("application/vnd.oma.cab-pcc+xml"), + APPLICATION_VND_OMA_CAB_SUBS_INVITE_XML("application/vnd.oma.cab-subs-invite+xml"), + APPLICATION_VND_OMA_CAB_USER_PREFS_XML("application/vnd.oma.cab-user-prefs+xml"), + APPLICATION_VND_OMA_DCD("application/vnd.oma.dcd"), + APPLICATION_VND_OMA_DCDC("application/vnd.oma.dcdc"), + APPLICATION_VND_OMA_DD2_XML("application/vnd.oma.dd2+xml"), + APPLICATION_VND_OMA_DRM_RISD_XML("application/vnd.oma.drm.risd+xml"), + APPLICATION_VND_OMA_GROUP_USAGE_LIST_XML("application/vnd.oma.group-usage-list+xml"), + APPLICATION_VND_OMA_LWM2M_CBOR("application/vnd.oma.lwm2m+cbor"), + APPLICATION_VND_OMA_LWM2M_JSON("application/vnd.oma.lwm2m+json"), + APPLICATION_VND_OMA_LWM2M_TLV("application/vnd.oma.lwm2m+tlv"), + APPLICATION_VND_OMA_PAL_XML("application/vnd.oma.pal+xml"), + APPLICATION_VND_OMA_POC_DETAILED_PROGRESS_REPORT_XML("application/vnd.oma.poc.detailed-progress-report+xml"), + APPLICATION_VND_OMA_POC_FINAL_REPORT_XML("application/vnd.oma.poc.final-report+xml"), + APPLICATION_VND_OMA_POC_GROUPS_XML("application/vnd.oma.poc.groups+xml"), + APPLICATION_VND_OMA_POC_INVOCATION_DESCRIPTOR_XML("application/vnd.oma.poc.invocation-descriptor+xml"), + APPLICATION_VND_OMA_POC_OPTIMIZED_PROGRESS_REPORT_XML("application/vnd.oma.poc.optimized-progress-report+xml"), + APPLICATION_VND_OMA_PUSH("application/vnd.oma.push"), + APPLICATION_VND_OMA_SCIDM_MESSAGES_XML("application/vnd.oma.scidm.messages+xml"), + APPLICATION_VND_OMA_XCAP_DIRECTORY_XML("application/vnd.oma.xcap-directory+xml"), + APPLICATION_VND_OMADS_EMAIL_XML("application/vnd.omads-email+xml"), + APPLICATION_VND_OMADS_FILE_XML("application/vnd.omads-file+xml"), + APPLICATION_VND_OMADS_FOLDER_XML("application/vnd.omads-folder+xml"), + APPLICATION_VND_OMALOC_SUPL_INIT("application/vnd.omaloc-supl-init"), + APPLICATION_VND_OMA_SCWS_CONFIG("application/vnd.oma-scws-config"), + APPLICATION_VND_OMA_SCWS_HTTP_REQUEST("application/vnd.oma-scws-http-request"), + APPLICATION_VND_OMA_SCWS_HTTP_RESPONSE("application/vnd.oma-scws-http-response"), + APPLICATION_VND_OMS_CELLULAR_COSE_CONTENT_CBOR("application/vnd.oms.cellular-cose-content+cbor"), + APPLICATION_VND_ONEPAGER("application/vnd.onepager"), + APPLICATION_VND_ONEPAGERTAMP("application/vnd.onepagertamp"), + APPLICATION_VND_ONEPAGERTAMX("application/vnd.onepagertamx"), + APPLICATION_VND_ONEPAGERTAT("application/vnd.onepagertat"), + APPLICATION_VND_ONEPAGERTATP("application/vnd.onepagertatp"), + APPLICATION_VND_ONEPAGERTATX("application/vnd.onepagertatx"), + APPLICATION_VND_ONVIF_METADATA("application/vnd.onvif.metadata"), + APPLICATION_VND_OPENBLOX_GAME_BINARY("application/vnd.openblox.game-binary"), + APPLICATION_VND_OPENBLOX_GAME_XML("application/vnd.openblox.game+xml"), + APPLICATION_VND_OPENEYE_OEB("application/vnd.openeye.oeb"), + APPLICATION_VND_OPENPRINTTAG("application/vnd.openprinttag"), + APPLICATION_VND_OPENSTREETMAP_DATA_XML("application/vnd.openstreetmap.data+xml"), + APPLICATION_VND_OPENTIMESTAMPS_OTS("application/vnd.opentimestamps.ots"), + APPLICATION_VND_OPENVPI_DSPX_JSON("application/vnd.openvpi.dspx+json"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_CUSTOM_PROPERTIES_XML("application/vnd.openxmlformats-officedocument.custom-properties+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_CUSTOMXMLPROPERTIES_XML("application/vnd.openxmlformats-officedocument.customXmlProperties+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_DRAWING_XML("application/vnd.openxmlformats-officedocument.drawing+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_DRAWINGML_CHART_XML("application/vnd.openxmlformats-officedocument.drawingml.chart+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_DRAWINGML_CHARTSHAPES_XML("application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_DRAWINGML_DIAGRAMCOLORS_XML("application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_DRAWINGML_DIAGRAMDATA_XML("application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_DRAWINGML_DIAGRAMLAYOUT_XML("application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_DRAWINGML_DIAGRAMSTYLE_XML("application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_EXTENDED_PROPERTIES_XML("application/vnd.openxmlformats-officedocument.extended-properties+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_PRESENTATIONML_COMMENTAUTHORS_XML("application/vnd.openxmlformats-officedocument.presentationml.commentAuthors+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_PRESENTATIONML_COMMENTS_XML("application/vnd.openxmlformats-officedocument.presentationml.comments+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_PRESENTATIONML_HANDOUTMASTER_XML("application/vnd.openxmlformats-officedocument.presentationml.handoutMaster+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_PRESENTATIONML_NOTESMASTER_XML("application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_PRESENTATIONML_NOTESSLIDE_XML("application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_PRESENTATIONML_PRESENTATION("application/vnd.openxmlformats-officedocument.presentationml.presentation"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_PRESENTATIONML_PRESENTATION_MAIN_XML("application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_PRESENTATIONML_PRESPROPS_XML("application/vnd.openxmlformats-officedocument.presentationml.presProps+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_PRESENTATIONML_SLIDE("application/vnd.openxmlformats-officedocument.presentationml.slide"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_PRESENTATIONML_SLIDE_XML("application/vnd.openxmlformats-officedocument.presentationml.slide+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_PRESENTATIONML_SLIDELAYOUT_XML("application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_PRESENTATIONML_SLIDEMASTER_XML("application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_PRESENTATIONML_SLIDESHOW("application/vnd.openxmlformats-officedocument.presentationml.slideshow"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_PRESENTATIONML_SLIDESHOW_MAIN_XML("application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_PRESENTATIONML_SLIDEUPDATEINFO_XML("application/vnd.openxmlformats-officedocument.presentationml.slideUpdateInfo+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_PRESENTATIONML_TABLESTYLES_XML("application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_PRESENTATIONML_TAGS_XML("application/vnd.openxmlformats-officedocument.presentationml.tags+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_PRESENTATIONML_TEMPLATE("application/vnd.openxmlformats-officedocument.presentationml.template"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_PRESENTATIONML_TEMPLATE_MAIN_XML("application/vnd.openxmlformats-officedocument.presentationml.template.main+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_PRESENTATIONML_VIEWPROPS_XML("application/vnd.openxmlformats-officedocument.presentationml.viewProps+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_SPREADSHEETML_CALCCHAIN_XML("application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_SPREADSHEETML_CHARTSHEET_XML("application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_SPREADSHEETML_COMMENTS_XML("application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_SPREADSHEETML_CONNECTIONS_XML("application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_SPREADSHEETML_DIALOGSHEET_XML("application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_SPREADSHEETML_EXTERNALLINK_XML("application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_SPREADSHEETML_PIVOTCACHEDEFINITION_XML("application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_SPREADSHEETML_PIVOTCACHERECORDS_XML("application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_SPREADSHEETML_PIVOTTABLE_XML("application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_SPREADSHEETML_QUERYTABLE_XML("application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_SPREADSHEETML_REVISIONHEADERS_XML("application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_SPREADSHEETML_REVISIONLOG_XML("application/vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_SPREADSHEETML_SHAREDSTRINGS_XML("application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_SPREADSHEETML_SHEET("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_SPREADSHEETML_SHEET_MAIN_XML("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_SPREADSHEETML_SHEETMETADATA_XML("application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_SPREADSHEETML_STYLES_XML("application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_SPREADSHEETML_TABLE_XML("application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_SPREADSHEETML_TABLESINGLECELLS_XML("application/vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_SPREADSHEETML_TEMPLATE("application/vnd.openxmlformats-officedocument.spreadsheetml.template"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_SPREADSHEETML_TEMPLATE_MAIN_XML("application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_SPREADSHEETML_USERNAMES_XML("application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_SPREADSHEETML_VOLATILEDEPENDENCIES_XML("application/vnd.openxmlformats-officedocument.spreadsheetml.volatileDependencies+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_SPREADSHEETML_WORKSHEET_XML("application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_THEME_XML("application/vnd.openxmlformats-officedocument.theme+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_THEMEOVERRIDE_XML("application/vnd.openxmlformats-officedocument.themeOverride+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_VMLDRAWING("application/vnd.openxmlformats-officedocument.vmlDrawing"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_WORDPROCESSINGML_COMMENTS_XML("application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_WORDPROCESSINGML_DOCUMENT("application/vnd.openxmlformats-officedocument.wordprocessingml.document"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_WORDPROCESSINGML_DOCUMENT_GLOSSARY_XML("application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_WORDPROCESSINGML_DOCUMENT_MAIN_XML("application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_WORDPROCESSINGML_ENDNOTES_XML("application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_WORDPROCESSINGML_FONTTABLE_XML("application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_WORDPROCESSINGML_FOOTER_XML("application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_WORDPROCESSINGML_FOOTNOTES_XML("application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_WORDPROCESSINGML_NUMBERING_XML("application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_WORDPROCESSINGML_SETTINGS_XML("application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_WORDPROCESSINGML_STYLES_XML("application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_WORDPROCESSINGML_TEMPLATE("application/vnd.openxmlformats-officedocument.wordprocessingml.template"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_WORDPROCESSINGML_TEMPLATE_MAIN_XML("application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml"), + APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_WORDPROCESSINGML_WEBSETTINGS_XML("application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml"), + APPLICATION_VND_OPENXMLFORMATS_PACKAGE_CORE_PROPERTIES_XML("application/vnd.openxmlformats-package.core-properties+xml"), + APPLICATION_VND_OPENXMLFORMATS_PACKAGE_DIGITAL_SIGNATURE_XMLSIGNATURE_XML("application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml"), + APPLICATION_VND_OPENXMLFORMATS_PACKAGE_RELATIONSHIPS_XML("application/vnd.openxmlformats-package.relationships+xml"), + APPLICATION_VND_ORACLE_RESOURCE_JSON("application/vnd.oracle.resource+json"), + APPLICATION_VND_ORANGE_INDATA("application/vnd.orange.indata"), + APPLICATION_VND_OSA_NETDEPLOY("application/vnd.osa.netdeploy"), + APPLICATION_VND_OSGEO_MAPGUIDE_PACKAGE("application/vnd.osgeo.mapguide.package"), + APPLICATION_VND_OSGI_BUNDLE("application/vnd.osgi.bundle"), + APPLICATION_VND_OSGI_DP("application/vnd.osgi.dp"), + APPLICATION_VND_OSGI_SUBSYSTEM("application/vnd.osgi.subsystem"), + APPLICATION_VND_OTPS_CT_KIP_XML("application/vnd.otps.ct-kip+xml"), + APPLICATION_VND_OXLI_COUNTGRAPH("application/vnd.oxli.countgraph"), + APPLICATION_VND_PAGERDUTY_JSON("application/vnd.pagerduty+json"), + APPLICATION_VND_PALM("application/vnd.palm"), + APPLICATION_VND_PANOPLY("application/vnd.panoply"), + APPLICATION_VND_PAOS_XML("application/vnd.paos.xml"), + APPLICATION_VND_PATENTDIVE("application/vnd.patentdive"), + APPLICATION_VND_PATIENTECOMMSDOC("application/vnd.patientecommsdoc"), + APPLICATION_VND_PAWAAFILE("application/vnd.pawaafile"), + APPLICATION_VND_PCOS("application/vnd.pcos"), + APPLICATION_VND_PG_FORMAT("application/vnd.pg.format"), + APPLICATION_VND_PG_OSASLI("application/vnd.pg.osasli"), + APPLICATION_VND_PIACCESS_APPLICATION_LICENCE("application/vnd.piaccess.application-licence"), + APPLICATION_VND_PICSEL("application/vnd.picsel"), + APPLICATION_VND_PMI_WIDGET("application/vnd.pmi.widget"), + APPLICATION_VND_PMTILES("application/vnd.pmtiles"), + APPLICATION_VND_POC_GROUP_ADVERTISEMENT_XML("application/vnd.poc.group-advertisement+xml"), + APPLICATION_VND_POCKETLEARN("application/vnd.pocketlearn"), + APPLICATION_VND_POWERBUILDER6("application/vnd.powerbuilder6"), + APPLICATION_VND_POWERBUILDER6_S("application/vnd.powerbuilder6-s"), + APPLICATION_VND_POWERBUILDER7("application/vnd.powerbuilder7"), + APPLICATION_VND_POWERBUILDER75("application/vnd.powerbuilder75"), + APPLICATION_VND_POWERBUILDER75_S("application/vnd.powerbuilder75-s"), + APPLICATION_VND_POWERBUILDER7_S("application/vnd.powerbuilder7-s"), + APPLICATION_VND_PP_SYSTEMVERIFY_XML("application/vnd.pp.systemverify+xml"), + APPLICATION_VND_PREMINET("application/vnd.preminet"), + APPLICATION_VND_PREVIEWSYSTEMS_BOX("application/vnd.previewsystems.box"), + APPLICATION_VND_PROJECT_GRAPH("application/vnd.project-graph"), + APPLICATION_VND_PROTEUS_MAGAZINE("application/vnd.proteus.magazine"), + APPLICATION_VND_PSFS("application/vnd.psfs"), + APPLICATION_VND_PT_MUNDUSMUNDI("application/vnd.pt.mundusmundi"), + APPLICATION_VND_PUBLISHARE_DELTA_TREE("application/vnd.publishare-delta-tree"), + APPLICATION_VND_PVI_PTID1("application/vnd.pvi.ptid1"), + APPLICATION_VND_PWG_MULTIPLEXED("application/vnd.pwg-multiplexed"), + APPLICATION_VND_PWG_XHTML_PRINT_XML("application/vnd.pwg-xhtml-print+xml"), + APPLICATION_VND_PYON_JSON("application/vnd.pyon+json"), + APPLICATION_VND_QUALCOMM_BREW_APP_RES("application/vnd.qualcomm.brew-app-res"), + APPLICATION_VND_QUARANTAINENET("application/vnd.quarantainenet"), + APPLICATION_VND_QUARK_QUARKXPRESS("application/vnd.Quark.QuarkXPress"), + APPLICATION_VND_QUOBJECT_QUOXDOCUMENT("application/vnd.quobject-quoxdocument"), + APPLICATION_VND_R74N_SANDBOXELS_JSON("application/vnd.R74n.sandboxels+json"), + APPLICATION_VND_RADISYS_MOML_XML("application/vnd.radisys.moml+xml"), + APPLICATION_VND_RADISYS_MSML_AUDIT_CONF_XML("application/vnd.radisys.msml-audit-conf+xml"), + APPLICATION_VND_RADISYS_MSML_AUDIT_CONN_XML("application/vnd.radisys.msml-audit-conn+xml"), + APPLICATION_VND_RADISYS_MSML_AUDIT_DIALOG_XML("application/vnd.radisys.msml-audit-dialog+xml"), + APPLICATION_VND_RADISYS_MSML_AUDIT_STREAM_XML("application/vnd.radisys.msml-audit-stream+xml"), + APPLICATION_VND_RADISYS_MSML_AUDIT_XML("application/vnd.radisys.msml-audit+xml"), + APPLICATION_VND_RADISYS_MSML_CONF_XML("application/vnd.radisys.msml-conf+xml"), + APPLICATION_VND_RADISYS_MSML_DIALOG_BASE_XML("application/vnd.radisys.msml-dialog-base+xml"), + APPLICATION_VND_RADISYS_MSML_DIALOG_FAX_DETECT_XML("application/vnd.radisys.msml-dialog-fax-detect+xml"), + APPLICATION_VND_RADISYS_MSML_DIALOG_FAX_SENDRECV_XML("application/vnd.radisys.msml-dialog-fax-sendrecv+xml"), + APPLICATION_VND_RADISYS_MSML_DIALOG_GROUP_XML("application/vnd.radisys.msml-dialog-group+xml"), + APPLICATION_VND_RADISYS_MSML_DIALOG_SPEECH_XML("application/vnd.radisys.msml-dialog-speech+xml"), + APPLICATION_VND_RADISYS_MSML_DIALOG_TRANSFORM_XML("application/vnd.radisys.msml-dialog-transform+xml"), + APPLICATION_VND_RADISYS_MSML_DIALOG_XML("application/vnd.radisys.msml-dialog+xml"), + APPLICATION_VND_RADISYS_MSML_XML("application/vnd.radisys.msml+xml"), + APPLICATION_VND_RAINSTOR_DATA("application/vnd.rainstor.data"), + APPLICATION_VND_RAPID("application/vnd.rapid"), + APPLICATION_VND_RAR("application/vnd.rar"), + APPLICATION_VND_REALVNC_BED("application/vnd.realvnc.bed"), + APPLICATION_VND_RECORDARE_MUSICXML("application/vnd.recordare.musicxml"), + APPLICATION_VND_RECORDARE_MUSICXML_XML("application/vnd.recordare.musicxml+xml"), + APPLICATION_VND_RELPIPE("application/vnd.relpipe"), + APPLICATION_VND_RENLEARN_RLPRINT("application/vnd.RenLearn.rlprint"), + APPLICATION_VND_RESILIENT_LOGIC("application/vnd.resilient.logic"), + APPLICATION_VND_RESTFUL_JSON("application/vnd.restful+json"), + APPLICATION_VND_RIG_CRYPTONOTE("application/vnd.rig.cryptonote"), + APPLICATION_VND_ROUTE66_LINK66_XML("application/vnd.route66.link66+xml"), + APPLICATION_VND_RS_274X("application/vnd.rs-274x"), + APPLICATION_VND_RUCKUS_DOWNLOAD("application/vnd.ruckus.download"), + APPLICATION_VND_S3SMS("application/vnd.s3sms"), + APPLICATION_VND_SAILINGTRACKER_TRACK("application/vnd.sailingtracker.track"), + APPLICATION_VND_SAR("application/vnd.sar"), + APPLICATION_VND_SBM_CID("application/vnd.sbm.cid"), + APPLICATION_VND_SBM_MID2("application/vnd.sbm.mid2"), + APPLICATION_VND_SCRIBUS("application/vnd.scribus"), + APPLICATION_VND_SEALED_3DF("application/vnd.sealed.3df"), + APPLICATION_VND_SEALED_CSF("application/vnd.sealed.csf"), + APPLICATION_VND_SEALED_DOC("application/vnd.sealed.doc"), + APPLICATION_VND_SEALED_EML("application/vnd.sealed.eml"), + APPLICATION_VND_SEALED_MHT("application/vnd.sealed.mht"), + APPLICATION_VND_SEALED_NET("application/vnd.sealed.net"), + APPLICATION_VND_SEALED_PPT("application/vnd.sealed.ppt"), + APPLICATION_VND_SEALED_TIFF("application/vnd.sealed.tiff"), + APPLICATION_VND_SEALED_XLS("application/vnd.sealed.xls"), + APPLICATION_VND_SEALEDMEDIA_SOFTSEAL_HTML("application/vnd.sealedmedia.softseal.html"), + APPLICATION_VND_SEALEDMEDIA_SOFTSEAL_PDF("application/vnd.sealedmedia.softseal.pdf"), + APPLICATION_VND_SEEMAIL("application/vnd.seemail"), + APPLICATION_VND_SEIS_JSON("application/vnd.seis+json"), + APPLICATION_VND_SEMA("application/vnd.sema"), + APPLICATION_VND_SEMD("application/vnd.semd"), + APPLICATION_VND_SEMF("application/vnd.semf"), + APPLICATION_VND_SHADE_SAVE_FILE("application/vnd.shade-save-file"), + APPLICATION_VND_SHANA_INFORMED_FORMDATA("application/vnd.shana.informed.formdata"), + APPLICATION_VND_SHANA_INFORMED_FORMTEMPLATE("application/vnd.shana.informed.formtemplate"), + APPLICATION_VND_SHANA_INFORMED_INTERCHANGE("application/vnd.shana.informed.interchange"), + APPLICATION_VND_SHANA_INFORMED_PACKAGE("application/vnd.shana.informed.package"), + APPLICATION_VND_SHOOTPROOF_JSON("application/vnd.shootproof+json"), + APPLICATION_VND_SHOPKICK_JSON("application/vnd.shopkick+json"), + APPLICATION_VND_SHP("application/vnd.shp"), + APPLICATION_VND_SHX("application/vnd.shx"), + APPLICATION_VND_SIGROK_SESSION("application/vnd.sigrok.session"), + APPLICATION_VND_SIMTECH_MINDMAPPER("application/vnd.SimTech-MindMapper"), + APPLICATION_VND_SIREN_JSON("application/vnd.siren+json"), + APPLICATION_VND_SIRTX_VMV0("application/vnd.sirtx.vmv0"), + APPLICATION_VND_SKETCHOMETRY("application/vnd.sketchometry"), + APPLICATION_VND_SMAF("application/vnd.smaf"), + APPLICATION_VND_SMART_NOTEBOOK("application/vnd.smart.notebook"), + APPLICATION_VND_SMART_TEACHER("application/vnd.smart.teacher"), + APPLICATION_VND_SMINTIO_PORTALS_ARCHIVE("application/vnd.smintio.portals.archive"), + APPLICATION_VND_SNESDEV_PAGE_TABLE("application/vnd.snesdev-page-table"), + APPLICATION_VND_SOFTWARE602_FILLER_FORM_XML("application/vnd.software602.filler.form+xml"), + APPLICATION_VND_SOFTWARE602_FILLER_FORM_XML_ZIP("application/vnd.software602.filler.form-xml-zip"), + APPLICATION_VND_SOLENT_SDKM_XML("application/vnd.solent.sdkm+xml"), + APPLICATION_VND_SPOTFIRE_DXP("application/vnd.spotfire.dxp"), + APPLICATION_VND_SPOTFIRE_SFS("application/vnd.spotfire.sfs"), + APPLICATION_VND_SQLITE3("application/vnd.sqlite3"), + APPLICATION_VND_SSS_COD("application/vnd.sss-cod"), + APPLICATION_VND_SSS_DTF("application/vnd.sss-dtf"), + APPLICATION_VND_SSS_NTF("application/vnd.sss-ntf"), + APPLICATION_VND_STEPMANIA_PACKAGE("application/vnd.stepmania.package"), + APPLICATION_VND_STEPMANIA_STEPCHART("application/vnd.stepmania.stepchart"), + APPLICATION_VND_STREET_STREAM("application/vnd.street-stream"), + APPLICATION_VND_SUN_WADL_XML("application/vnd.sun.wadl+xml"), + APPLICATION_VND_SUPERFILE_SUPER("application/vnd.superfile.super"), + APPLICATION_VND_SUS_CALENDAR("application/vnd.sus-calendar"), + APPLICATION_VND_SVD("application/vnd.svd"), + APPLICATION_VND_SWIFTVIEW_ICS("application/vnd.swiftview-ics"), + APPLICATION_VND_SYBYL_MOL2("application/vnd.sybyl.mol2"), + APPLICATION_VND_SYCLE_XML("application/vnd.sycle+xml"), + APPLICATION_VND_SYFT_JSON("application/vnd.syft+json"), + APPLICATION_VND_SYNCML_DM_NOTIFICATION("application/vnd.syncml.dm.notification"), + APPLICATION_VND_SYNCML_DMDDF_XML("application/vnd.syncml.dmddf+xml"), + APPLICATION_VND_SYNCML_DMTNDS_WBXML("application/vnd.syncml.dmtnds+wbxml"), + APPLICATION_VND_SYNCML_DMTNDS_XML("application/vnd.syncml.dmtnds+xml"), + APPLICATION_VND_SYNCML_DMDDF_WBXML("application/vnd.syncml.dmddf+wbxml"), + APPLICATION_VND_SYNCML_DM_WBXML("application/vnd.syncml.dm+wbxml"), + APPLICATION_VND_SYNCML_DM_XML("application/vnd.syncml.dm+xml"), + APPLICATION_VND_SYNCML_DS_NOTIFICATION("application/vnd.syncml.ds.notification"), + APPLICATION_VND_SYNCML_XML("application/vnd.syncml+xml"), + APPLICATION_VND_TABLESCHEMA_JSON("application/vnd.tableschema+json"), + APPLICATION_VND_TAO_INTENT_MODULE_ARCHIVE("application/vnd.tao.intent-module-archive"), + APPLICATION_VND_TCPDUMP_PCAP("application/vnd.tcpdump.pcap"), + APPLICATION_VND_THINK_CELL_PPTTC_JSON("application/vnd.think-cell.ppttc+json"), + APPLICATION_VND_TML("application/vnd.tml"), + APPLICATION_VND_TMD_MEDIAFLEX_API_XML("application/vnd.tmd.mediaflex.api+xml"), + APPLICATION_VND_TMOBILE_LIVETV("application/vnd.tmobile-livetv"), + APPLICATION_VND_TRI_ONESOURCE("application/vnd.tri.onesource"), + APPLICATION_VND_TRID_TPT("application/vnd.trid.tpt"), + APPLICATION_VND_TRISCAPE_MXS("application/vnd.triscape.mxs"), + APPLICATION_VND_TRUEAPP("application/vnd.trueapp"), + APPLICATION_VND_TRUEDOC("application/vnd.truedoc"), + APPLICATION_VND_UBISOFT_WEBPLAYER("application/vnd.ubisoft.webplayer"), + APPLICATION_VND_UFDL("application/vnd.ufdl"), + APPLICATION_VND_UIC_DOSIPAS_V1("application/vnd.uic.dosipas.v1"), + APPLICATION_VND_UIC_DOSIPAS_V2("application/vnd.uic.dosipas.v2"), + APPLICATION_VND_UIC_OSDM_JSON("application/vnd.uic.osdm+json"), + APPLICATION_VND_UIC_TLB_FCB("application/vnd.uic.tlb-fcb"), + APPLICATION_VND_UIQ_THEME("application/vnd.uiq.theme"), + APPLICATION_VND_UMAJIN("application/vnd.umajin"), + APPLICATION_VND_UNITY("application/vnd.unity"), + APPLICATION_VND_UOML_XML("application/vnd.uoml+xml"), + APPLICATION_VND_UPLANET_ALERT("application/vnd.uplanet.alert"), + APPLICATION_VND_UPLANET_ALERT_WBXML("application/vnd.uplanet.alert-wbxml"), + APPLICATION_VND_UPLANET_BEARER_CHOICE("application/vnd.uplanet.bearer-choice"), + APPLICATION_VND_UPLANET_BEARER_CHOICE_WBXML("application/vnd.uplanet.bearer-choice-wbxml"), + APPLICATION_VND_UPLANET_CACHEOP("application/vnd.uplanet.cacheop"), + APPLICATION_VND_UPLANET_CACHEOP_WBXML("application/vnd.uplanet.cacheop-wbxml"), + APPLICATION_VND_UPLANET_CHANNEL("application/vnd.uplanet.channel"), + APPLICATION_VND_UPLANET_CHANNEL_WBXML("application/vnd.uplanet.channel-wbxml"), + APPLICATION_VND_UPLANET_LIST("application/vnd.uplanet.list"), + APPLICATION_VND_UPLANET_LISTCMD("application/vnd.uplanet.listcmd"), + APPLICATION_VND_UPLANET_LISTCMD_WBXML("application/vnd.uplanet.listcmd-wbxml"), + APPLICATION_VND_UPLANET_LIST_WBXML("application/vnd.uplanet.list-wbxml"), + APPLICATION_VND_URI_MAP("application/vnd.uri-map"), + APPLICATION_VND_UPLANET_SIGNAL("application/vnd.uplanet.signal"), + APPLICATION_VND_VALVE_SOURCE_MATERIAL("application/vnd.valve.source.material"), + APPLICATION_VND_VCX("application/vnd.vcx"), + APPLICATION_VND_VD_STUDY("application/vnd.vd-study"), + APPLICATION_VND_VECTORWORKS("application/vnd.vectorworks"), + APPLICATION_VND_VEL_JSON("application/vnd.vel+json"), + APPLICATION_VND_VERAISON_TSM_REPORT_CBOR("application/vnd.veraison.tsm-report+cbor"), + APPLICATION_VND_VERAISON_TSM_REPORT_JSON("application/vnd.veraison.tsm-report+json"), + APPLICATION_VND_VERIFIER_ATTESTATION_JWT("application/vnd.verifier-attestation+jwt"), + APPLICATION_VND_VERIMATRIX_VCAS("application/vnd.verimatrix.vcas"), + APPLICATION_VND_VERITONE_AION_JSON("application/vnd.veritone.aion+json"), + APPLICATION_VND_VERYANT_THIN("application/vnd.veryant.thin"), + APPLICATION_VND_VES_ENCRYPTED("application/vnd.ves.encrypted"), + APPLICATION_VND_VIDSOFT_VIDCONFERENCE("application/vnd.vidsoft.vidconference"), + APPLICATION_VND_VISIO("application/vnd.visio"), + APPLICATION_VND_VISIONARY("application/vnd.visionary"), + APPLICATION_VND_VIVIDENCE_SCRIPTFILE("application/vnd.vividence.scriptfile"), + APPLICATION_VND_VOCALSHAPER_VSP4("application/vnd.vocalshaper.vsp4"), + APPLICATION_VND_VSF("application/vnd.vsf"), + APPLICATION_VND_VUQ("application/vnd.vuq"), + APPLICATION_VND_WANTVERSE("application/vnd.wantverse"), + APPLICATION_VND_WAP_SIC("application/vnd.wap.sic"), + APPLICATION_VND_WAP_SLC("application/vnd.wap.slc"), + APPLICATION_VND_WAP_WBXML("application/vnd.wap.wbxml"), + APPLICATION_VND_WAP_WMLC("application/vnd.wap.wmlc"), + APPLICATION_VND_WAP_WMLSCRIPTC("application/vnd.wap.wmlscriptc"), + APPLICATION_VND_WASMFLOW_WAFL("application/vnd.wasmflow.wafl"), + APPLICATION_VND_WEBTURBO("application/vnd.webturbo"), + APPLICATION_VND_WFA_DPP("application/vnd.wfa.dpp"), + APPLICATION_VND_WFA_P2P("application/vnd.wfa.p2p"), + APPLICATION_VND_WFA_WSC("application/vnd.wfa.wsc"), + APPLICATION_VND_WINDOWS_DEVICEPAIRING("application/vnd.windows.devicepairing"), + APPLICATION_VND_WMAP("application/vnd.wmap"), + APPLICATION_VND_WMC("application/vnd.wmc"), + APPLICATION_VND_WMF_BOOTSTRAP("application/vnd.wmf.bootstrap"), + APPLICATION_VND_WOLFRAM_MATHEMATICA("application/vnd.wolfram.mathematica"), + APPLICATION_VND_WOLFRAM_MATHEMATICA_PACKAGE("application/vnd.wolfram.mathematica.package"), + APPLICATION_VND_WOLFRAM_PLAYER("application/vnd.wolfram.player"), + APPLICATION_VND_WORDLIFT("application/vnd.wordlift"), + APPLICATION_VND_WORDPERFECT("application/vnd.wordperfect"), + APPLICATION_VND_WQD("application/vnd.wqd"), + APPLICATION_VND_WRQ_HP3000_LABELLED("application/vnd.wrq-hp3000-labelled"), + APPLICATION_VND_WT_STF("application/vnd.wt.stf"), + APPLICATION_VND_WV_CSP_XML("application/vnd.wv.csp+xml"), + APPLICATION_VND_WV_CSP_WBXML("application/vnd.wv.csp+wbxml"), + APPLICATION_VND_WV_SSP_XML("application/vnd.wv.ssp+xml"), + APPLICATION_VND_XACML_JSON("application/vnd.xacml+json"), + APPLICATION_VND_XARA("application/vnd.xara"), + APPLICATION_VND_XARIN_CPJ("application/vnd.xarin.cpj"), + APPLICATION_VND_XCDN("application/vnd.xcdn"), + APPLICATION_VND_XECRETS_ENCRYPTED("application/vnd.xecrets-encrypted"), + APPLICATION_VND_XFDL("application/vnd.xfdl"), + APPLICATION_VND_XFDL_WEBFORM("application/vnd.xfdl.webform"), + APPLICATION_VND_XMI_XML("application/vnd.xmi+xml"), + APPLICATION_VND_XMPIE_CPKG("application/vnd.xmpie.cpkg"), + APPLICATION_VND_XMPIE_DPKG("application/vnd.xmpie.dpkg"), + APPLICATION_VND_XMPIE_PLAN("application/vnd.xmpie.plan"), + APPLICATION_VND_XMPIE_PPKG("application/vnd.xmpie.ppkg"), + APPLICATION_VND_XMPIE_XLIM("application/vnd.xmpie.xlim"), + APPLICATION_VND_YAMAHA_HV_DIC("application/vnd.yamaha.hv-dic"), + APPLICATION_VND_YAMAHA_HV_SCRIPT("application/vnd.yamaha.hv-script"), + APPLICATION_VND_YAMAHA_HV_VOICE("application/vnd.yamaha.hv-voice"), + APPLICATION_VND_YAMAHA_OPENSCOREFORMAT_OSFPVG_XML("application/vnd.yamaha.openscoreformat.osfpvg+xml"), + APPLICATION_VND_YAMAHA_OPENSCOREFORMAT("application/vnd.yamaha.openscoreformat"), + APPLICATION_VND_YAMAHA_REMOTE_SETUP("application/vnd.yamaha.remote-setup"), + APPLICATION_VND_YAMAHA_SMAF_AUDIO("application/vnd.yamaha.smaf-audio"), + APPLICATION_VND_YAMAHA_SMAF_PHRASE("application/vnd.yamaha.smaf-phrase"), + APPLICATION_VND_YAMAHA_THROUGH_NGN("application/vnd.yamaha.through-ngn"), + APPLICATION_VND_YAMAHA_TUNNEL_UDPENCAP("application/vnd.yamaha.tunnel-udpencap"), + APPLICATION_VND_YAOWEME("application/vnd.yaoweme"), + APPLICATION_VND_YELLOWRIVER_CUSTOM_MENU("application/vnd.yellowriver-custom-menu"), + APPLICATION_VND_YOUTUBE_YT("application/vnd.youtube.yt"), + APPLICATION_VND_ZOHO_PRESENTATION_SHOW("application/vnd.zoho-presentation.show"), + APPLICATION_VND_ZUL("application/vnd.zul"), + APPLICATION_VND_ZZAZZ_DECK_XML("application/vnd.zzazz.deck+xml"), + APPLICATION_VOICEXML_XML("application/voicexml+xml"), + APPLICATION_VOUCHER_CMS_JSON("application/voucher-cms+json"), + APPLICATION_VOUCHER_JWS_JSON("application/voucher-jws+json"), + APPLICATION_VP("application/vp"), + APPLICATION_VP_COSE("application/vp+cose"), + APPLICATION_VP_JWT("application/vp+jwt"), + APPLICATION_VP_SD_JWT("application/vp+sd-jwt"), + APPLICATION_VQ_RTCPXR("application/vq-rtcpxr"), + APPLICATION_WASM("application/wasm"), + APPLICATION_WATCHERINFO_XML("application/watcherinfo+xml"), + APPLICATION_WEBPUSH_OPTIONS_JSON("application/webpush-options+json"), + APPLICATION_WHOISPP_QUERY("application/whoispp-query"), + APPLICATION_WHOISPP_RESPONSE("application/whoispp-response"), + APPLICATION_WIDGET("application/widget"), + APPLICATION_WITA("application/wita"), + APPLICATION_WORDPERFECT5_1("application/wordperfect5.1"), + APPLICATION_WSDL_XML("application/wsdl+xml"), + APPLICATION_WSPOLICY_XML("application/wspolicy+xml"), + APPLICATION_X_PKI_MESSAGE("application/x-pki-message"), + APPLICATION_X_WWW_FORM_URLENCODED("application/x-www-form-urlencoded"), + APPLICATION_X_X509_CA_CERT("application/x-x509-ca-cert"), + APPLICATION_X_X509_CA_RA_CERT("application/x-x509-ca-ra-cert"), + APPLICATION_X_X509_NEXT_CA_CERT("application/x-x509-next-ca-cert"), + APPLICATION_X400_BP("application/x400-bp"), + APPLICATION_XACML_XML("application/xacml+xml"), + APPLICATION_XCAP_ATT_XML("application/xcap-att+xml"), + APPLICATION_XCAP_CAPS_XML("application/xcap-caps+xml"), + APPLICATION_XCAP_DIFF_XML("application/xcap-diff+xml"), + APPLICATION_XCAP_EL_XML("application/xcap-el+xml"), + APPLICATION_XCAP_ERROR_XML("application/xcap-error+xml"), + APPLICATION_XCAP_NS_XML("application/xcap-ns+xml"), + APPLICATION_XCON_CONFERENCE_INFO_DIFF_XML("application/xcon-conference-info-diff+xml"), + APPLICATION_XCON_CONFERENCE_INFO_XML("application/xcon-conference-info+xml"), + APPLICATION_XENC_XML("application/xenc+xml"), + APPLICATION_XFDF("application/xfdf"), + APPLICATION_XHTML_XML("application/xhtml+xml"), + APPLICATION_XLIFF_XML("application/xliff+xml"), + APPLICATION_XML("application/xml"), + APPLICATION_XML_DTD("application/xml-dtd"), + APPLICATION_XML_EXTERNAL_PARSED_ENTITY("application/xml-external-parsed-entity"), + APPLICATION_XML_PATCH_XML("application/xml-patch+xml"), + APPLICATION_XMPP_XML("application/xmpp+xml"), + APPLICATION_XOP_XML("application/xop+xml"), + APPLICATION_XSLT_XML("application/xslt+xml"), + APPLICATION_XV_XML("application/xv+xml"), + APPLICATION_YAML("application/yaml"), + APPLICATION_YANG("application/yang"), + APPLICATION_YANG_DATA_CBOR("application/yang-data+cbor"), + APPLICATION_YANG_DATA_JSON("application/yang-data+json"), + APPLICATION_YANG_DATA_XML("application/yang-data+xml"), + APPLICATION_YANG_PATCH_JSON("application/yang-patch+json"), + APPLICATION_YANG_PATCH_XML("application/yang-patch+xml"), + APPLICATION_YANG_SID_JSON("application/yang-sid+json"), + APPLICATION_YIN_XML("application/yin+xml"), + APPLICATION_ZIP("application/zip"), + APPLICATION_ZLIB("application/zlib"), + APPLICATION_ZSTD("application/zstd"), + AUDIO_1D_INTERLEAVED_PARITYFEC("audio/1d-interleaved-parityfec"), + AUDIO_32KADPCM("audio/32kadpcm"), + AUDIO_3GPP("audio/3gpp"), + AUDIO_3GPP2("audio/3gpp2"), + AUDIO_AAC("audio/aac"), + AUDIO_AC3("audio/ac3"), + AUDIO_AMR("audio/AMR"), + AUDIO_AMR_WB("audio/AMR-WB"), + AUDIO_AMR_WB_("audio/amr-wb+"), + AUDIO_APTX("audio/aptx"), + AUDIO_ASC("audio/asc"), + AUDIO_ATRAC_ADVANCED_LOSSLESS("audio/ATRAC-ADVANCED-LOSSLESS"), + AUDIO_ATRAC_X("audio/ATRAC-X"), + AUDIO_ATRAC3("audio/ATRAC3"), + AUDIO_BASIC("audio/basic"), + AUDIO_BV16("audio/BV16"), + AUDIO_BV32("audio/BV32"), + AUDIO_CLEARMODE("audio/clearmode"), + AUDIO_CN("audio/CN"), + AUDIO_DAT12("audio/DAT12"), + AUDIO_DLS("audio/dls"), + AUDIO_DSR_ES201108("audio/dsr-es201108"), + AUDIO_DSR_ES202050("audio/dsr-es202050"), + AUDIO_DSR_ES202211("audio/dsr-es202211"), + AUDIO_DSR_ES202212("audio/dsr-es202212"), + AUDIO_DV("audio/DV"), + AUDIO_DVI4("audio/DVI4"), + AUDIO_EAC3("audio/eac3"), + AUDIO_ENCAPRTP("audio/encaprtp"), + AUDIO_EVRC("audio/EVRC"), + AUDIO_EVRC_QCP("audio/EVRC-QCP"), + AUDIO_EVRC0("audio/EVRC0"), + AUDIO_EVRC1("audio/EVRC1"), + AUDIO_EVRCB("audio/EVRCB"), + AUDIO_EVRCB0("audio/EVRCB0"), + AUDIO_EVRCB1("audio/EVRCB1"), + AUDIO_EVRCNW("audio/EVRCNW"), + AUDIO_EVRCNW0("audio/EVRCNW0"), + AUDIO_EVRCNW1("audio/EVRCNW1"), + AUDIO_EVRCWB("audio/EVRCWB"), + AUDIO_EVRCWB0("audio/EVRCWB0"), + AUDIO_EVRCWB1("audio/EVRCWB1"), + AUDIO_EVS("audio/EVS"), + AUDIO_EXAMPLE("audio/example"), + AUDIO_FLAC("audio/flac"), + AUDIO_FLEXFEC("audio/flexfec"), + AUDIO_FWDRED("audio/fwdred"), + AUDIO_G711_0("audio/G711-0"), + AUDIO_G719("audio/G719"), + AUDIO_G7221("audio/G7221"), + AUDIO_G722("audio/G722"), + AUDIO_G723("audio/G723"), + AUDIO_G726_16("audio/G726-16"), + AUDIO_G726_24("audio/G726-24"), + AUDIO_G726_32("audio/G726-32"), + AUDIO_G726_40("audio/G726-40"), + AUDIO_G728("audio/G728"), + AUDIO_G729("audio/G729"), + AUDIO_G7291("audio/G7291"), + AUDIO_G729D("audio/G729D"), + AUDIO_G729E("audio/G729E"), + AUDIO_GSM("audio/GSM"), + AUDIO_GSM_EFR("audio/GSM-EFR"), + AUDIO_GSM_HR_08("audio/GSM-HR-08"), + AUDIO_ILBC("audio/iLBC"), + AUDIO_IP_MR_V2_5("audio/ip-mr_v2.5"), + AUDIO_L8("audio/L8"), + AUDIO_L16("audio/L16"), + AUDIO_L20("audio/L20"), + AUDIO_L24("audio/L24"), + AUDIO_LPC("audio/LPC"), + AUDIO_MATROSKA("audio/matroska"), + AUDIO_MELP("audio/MELP"), + AUDIO_MELP600("audio/MELP600"), + AUDIO_MELP1200("audio/MELP1200"), + AUDIO_MELP2400("audio/MELP2400"), + AUDIO_MHAS("audio/mhas"), + AUDIO_MIDI_CLIP("audio/midi-clip"), + AUDIO_MOBILE_XMF("audio/mobile-xmf"), + AUDIO_MPA("audio/MPA"), + AUDIO_MP4("audio/mp4"), + AUDIO_MP4A_LATM("audio/MP4A-LATM"), + AUDIO_MPA_ROBUST("audio/mpa-robust"), + AUDIO_MPEG("audio/mpeg"), + AUDIO_MPEG4_GENERIC("audio/mpeg4-generic"), + AUDIO_OGG("audio/ogg"), + AUDIO_OPUS("audio/opus"), + AUDIO_PARITYFEC("audio/parityfec"), + AUDIO_PCMA("audio/PCMA"), + AUDIO_PCMA_WB("audio/PCMA-WB"), + AUDIO_PCMU("audio/PCMU"), + AUDIO_PCMU_WB("audio/PCMU-WB"), + AUDIO_PRS_SID("audio/prs.sid"), + AUDIO_QCELP("audio/QCELP"), + AUDIO_RAPTORFEC("audio/raptorfec"), + AUDIO_RED("audio/RED"), + AUDIO_RTP_ENC_AESCM128("audio/rtp-enc-aescm128"), + AUDIO_RTPLOOPBACK("audio/rtploopback"), + AUDIO_RTP_MIDI("audio/rtp-midi"), + AUDIO_RTX("audio/rtx"), + AUDIO_SCIP("audio/scip"), + AUDIO_SMV("audio/SMV"), + AUDIO_SMV0("audio/SMV0"), + AUDIO_SMV_QCP("audio/SMV-QCP"), + AUDIO_SOFA("audio/sofa"), + AUDIO_SOUNDFONT("audio/soundfont"), + AUDIO_SP_MIDI("audio/sp-midi"), + AUDIO_SPEEX("audio/speex"), + AUDIO_T140C("audio/t140c"), + AUDIO_T38("audio/t38"), + AUDIO_TELEPHONE_EVENT("audio/telephone-event"), + AUDIO_TETRA_ACELP("audio/TETRA_ACELP"), + AUDIO_TETRA_ACELP_BB("audio/TETRA_ACELP_BB"), + AUDIO_TONE("audio/tone"), + AUDIO_TSVCIS("audio/TSVCIS"), + AUDIO_UEMCLIP("audio/UEMCLIP"), + AUDIO_ULPFEC("audio/ulpfec"), + AUDIO_USAC("audio/usac"), + AUDIO_VDVI("audio/VDVI"), + AUDIO_VMR_WB("audio/VMR-WB"), + AUDIO_VND_3GPP_IUFP("audio/vnd.3gpp.iufp"), + AUDIO_VND_4SB("audio/vnd.4SB"), + AUDIO_VND_AUDIOKOZ("audio/vnd.audiokoz"), + AUDIO_VND_BLOCKFACT_FACTA("audio/vnd.blockfact.facta"), + AUDIO_VND_CELP("audio/vnd.CELP"), + AUDIO_VND_CISCO_NSE("audio/vnd.cisco.nse"), + AUDIO_VND_CMLES_RADIO_EVENTS("audio/vnd.cmles.radio-events"), + AUDIO_VND_CNS_ANP1("audio/vnd.cns.anp1"), + AUDIO_VND_CNS_INF1("audio/vnd.cns.inf1"), + AUDIO_VND_DECE_AUDIO("audio/vnd.dece.audio"), + AUDIO_VND_DIGITAL_WINDS("audio/vnd.digital-winds"), + AUDIO_VND_DLNA_ADTS("audio/vnd.dlna.adts"), + AUDIO_VND_DOLBY_HEAAC_1("audio/vnd.dolby.heaac.1"), + AUDIO_VND_DOLBY_HEAAC_2("audio/vnd.dolby.heaac.2"), + AUDIO_VND_DOLBY_MLP("audio/vnd.dolby.mlp"), + AUDIO_VND_DOLBY_MPS("audio/vnd.dolby.mps"), + AUDIO_VND_DOLBY_PL2("audio/vnd.dolby.pl2"), + AUDIO_VND_DOLBY_PL2X("audio/vnd.dolby.pl2x"), + AUDIO_VND_DOLBY_PL2Z("audio/vnd.dolby.pl2z"), + AUDIO_VND_DOLBY_PULSE_1("audio/vnd.dolby.pulse.1"), + AUDIO_VND_DRA("audio/vnd.dra"), + AUDIO_VND_DTS("audio/vnd.dts"), + AUDIO_VND_DTS_HD("audio/vnd.dts.hd"), + AUDIO_VND_DTS_UHD("audio/vnd.dts.uhd"), + AUDIO_VND_DVB_FILE("audio/vnd.dvb.file"), + AUDIO_VND_EVERAD_PLJ("audio/vnd.everad.plj"), + AUDIO_VND_HNS_AUDIO("audio/vnd.hns.audio"), + AUDIO_VND_LUCENT_VOICE("audio/vnd.lucent.voice"), + AUDIO_VND_MS_PLAYREADY_MEDIA_PYA("audio/vnd.ms-playready.media.pya"), + AUDIO_VND_NOKIA_MOBILE_XMF("audio/vnd.nokia.mobile-xmf"), + AUDIO_VND_NORTEL_VBK("audio/vnd.nortel.vbk"), + AUDIO_VND_NUERA_ECELP4800("audio/vnd.nuera.ecelp4800"), + AUDIO_VND_NUERA_ECELP7470("audio/vnd.nuera.ecelp7470"), + AUDIO_VND_NUERA_ECELP9600("audio/vnd.nuera.ecelp9600"), + AUDIO_VND_OCTEL_SBC("audio/vnd.octel.sbc"), + AUDIO_VND_PRESONUS_MULTITRACK("audio/vnd.presonus.multitrack"), + AUDIO_VND_QCELP("audio/vnd.qcelp"), + AUDIO_VND_RHETOREX_32KADPCM("audio/vnd.rhetorex.32kadpcm"), + AUDIO_VND_RIP("audio/vnd.rip"), + AUDIO_VND_SEALEDMEDIA_SOFTSEAL_MPEG("audio/vnd.sealedmedia.softseal.mpeg"), + AUDIO_VND_VMX_CVSD("audio/vnd.vmx.cvsd"), + AUDIO_VORBIS("audio/vorbis"), + AUDIO_VORBIS_CONFIG("audio/vorbis-config"), + FONT_COLLECTION("font/collection"), + FONT_OTF("font/otf"), + FONT_SFNT("font/sfnt"), + FONT_TTF("font/ttf"), + FONT_WOFF("font/woff"), + FONT_WOFF2("font/woff2"), + HAPTICS_IVS("haptics/ivs"), + HAPTICS_HJIF("haptics/hjif"), + HAPTICS_HMPG("haptics/hmpg"), + IMAGE_ACES("image/aces"), + IMAGE_APNG("image/apng"), + IMAGE_AVCI("image/avci"), + IMAGE_AVCS("image/avcs"), + IMAGE_AVIF("image/avif"), + IMAGE_BMP("image/bmp"), + IMAGE_CGM("image/cgm"), + IMAGE_DICOM_RLE("image/dicom-rle"), + IMAGE_DPX("image/dpx"), + IMAGE_EMF("image/emf"), + IMAGE_EXAMPLE("image/example"), + IMAGE_FITS("image/fits"), + IMAGE_G3FAX("image/g3fax"), + IMAGE_GIF("image/gif"), + IMAGE_HEIC("image/heic"), + IMAGE_HEIC_SEQUENCE("image/heic-sequence"), + IMAGE_HEIF("image/heif"), + IMAGE_HEIF_SEQUENCE("image/heif-sequence"), + IMAGE_HEJ2K("image/hej2k"), + IMAGE_HSJ2("image/hsj2"), + IMAGE_IEF("image/ief"), + IMAGE_J2C("image/j2c"), + IMAGE_JAII("image/jaii"), + IMAGE_JAIS("image/jais"), + IMAGE_JLS("image/jls"), + IMAGE_JP2("image/jp2"), + IMAGE_JPEG("image/jpeg"), + IMAGE_JPH("image/jph"), + IMAGE_JPHC("image/jphc"), + IMAGE_JPM("image/jpm"), + IMAGE_JPX("image/jpx"), + IMAGE_JXL("image/jxl"), + IMAGE_JXR("image/jxr"), + IMAGE_JXRA("image/jxrA"), + IMAGE_JXRS("image/jxrS"), + IMAGE_JXS("image/jxs"), + IMAGE_JXSC("image/jxsc"), + IMAGE_JXSI("image/jxsi"), + IMAGE_JXSS("image/jxss"), + IMAGE_KTX("image/ktx"), + IMAGE_KTX2("image/ktx2"), + IMAGE_NAPLPS("image/naplps"), + IMAGE_PNG("image/png"), + IMAGE_PRS_BTIF("image/prs.btif"), + IMAGE_PRS_PTI("image/prs.pti"), + IMAGE_PWG_RASTER("image/pwg-raster"), + IMAGE_SVG_XML("image/svg+xml"), + IMAGE_T38("image/t38"), + IMAGE_TIFF("image/tiff"), + IMAGE_TIFF_FX("image/tiff-fx"), + IMAGE_VND_ADOBE_PHOTOSHOP("image/vnd.adobe.photoshop"), + IMAGE_VND_AIRZIP_ACCELERATOR_AZV("image/vnd.airzip.accelerator.azv"), + IMAGE_VND_BLOCKFACT_FACTI("image/vnd.blockfact.facti"), + IMAGE_VND_CLIP("image/vnd.clip"), + IMAGE_VND_CNS_INF2("image/vnd.cns.inf2"), + IMAGE_VND_DECE_GRAPHIC("image/vnd.dece.graphic"), + IMAGE_VND_DJVU("image/vnd.djvu"), + IMAGE_VND_DWG("image/vnd.dwg"), + IMAGE_VND_DXF("image/vnd.dxf"), + IMAGE_VND_DVB_SUBTITLE("image/vnd.dvb.subtitle"), + IMAGE_VND_FASTBIDSHEET("image/vnd.fastbidsheet"), + IMAGE_VND_FPX("image/vnd.fpx"), + IMAGE_VND_FST("image/vnd.fst"), + IMAGE_VND_FUJIXEROX_EDMICS_MMR("image/vnd.fujixerox.edmics-mmr"), + IMAGE_VND_FUJIXEROX_EDMICS_RLC("image/vnd.fujixerox.edmics-rlc"), + IMAGE_VND_GLOBALGRAPHICS_PGB("image/vnd.globalgraphics.pgb"), + IMAGE_VND_MICROSOFT_ICON("image/vnd.microsoft.icon"), + IMAGE_VND_MIX("image/vnd.mix"), + IMAGE_VND_MS_MODI("image/vnd.ms-modi"), + IMAGE_VND_MOZILLA_APNG("image/vnd.mozilla.apng"), + IMAGE_VND_NET_FPX("image/vnd.net-fpx"), + IMAGE_VND_PCO_B16("image/vnd.pco.b16"), + IMAGE_VND_RADIANCE("image/vnd.radiance"), + IMAGE_VND_SEALED_PNG("image/vnd.sealed.png"), + IMAGE_VND_SEALEDMEDIA_SOFTSEAL_GIF("image/vnd.sealedmedia.softseal.gif"), + IMAGE_VND_SEALEDMEDIA_SOFTSEAL_JPG("image/vnd.sealedmedia.softseal.jpg"), + IMAGE_VND_SVF("image/vnd.svf"), + IMAGE_VND_TENCENT_TAP("image/vnd.tencent.tap"), + IMAGE_VND_VALVE_SOURCE_TEXTURE("image/vnd.valve.source.texture"), + IMAGE_VND_WAP_WBMP("image/vnd.wap.wbmp"), + IMAGE_VND_XIFF("image/vnd.xiff"), + IMAGE_VND_ZBRUSH_PCX("image/vnd.zbrush.pcx"), + IMAGE_WEBP("image/webp"), + IMAGE_WMF("image/wmf"), + IMAGE_X_EMF("image/x-emf"), + IMAGE_X_WMF("image/x-wmf"), + MESSAGE_BHTTP("message/bhttp"), + MESSAGE_CPIM("message/CPIM"), + MESSAGE_DELIVERY_STATUS("message/delivery-status"), + MESSAGE_DISPOSITION_NOTIFICATION("message/disposition-notification"), + MESSAGE_EXAMPLE("message/example"), + MESSAGE_EXTERNAL_BODY("message/external-body"), + MESSAGE_FEEDBACK_REPORT("message/feedback-report"), + MESSAGE_GLOBAL("message/global"), + MESSAGE_GLOBAL_DELIVERY_STATUS("message/global-delivery-status"), + MESSAGE_GLOBAL_DISPOSITION_NOTIFICATION("message/global-disposition-notification"), + MESSAGE_GLOBAL_HEADERS("message/global-headers"), + MESSAGE_HTTP("message/http"), + MESSAGE_IMDN_XML("message/imdn+xml"), + MESSAGE_MLS("message/mls"), + MESSAGE_NEWS("message/news"), + MESSAGE_OHTTP_REQ("message/ohttp-req"), + MESSAGE_OHTTP_RES("message/ohttp-res"), + MESSAGE_PARTIAL("message/partial"), + MESSAGE_RFC822("message/rfc822"), + MESSAGE_S_HTTP("message/s-http"), + MESSAGE_SIP("message/sip"), + MESSAGE_SIPFRAG("message/sipfrag"), + MESSAGE_TRACKING_STATUS("message/tracking-status"), + MESSAGE_VND_SI_SIMP("message/vnd.si.simp"), + MESSAGE_VND_WFA_WSC("message/vnd.wfa.wsc"), + MODEL_3MF("model/3mf"), + MODEL_E57("model/e57"), + MODEL_EXAMPLE("model/example"), + MODEL_GLTF_BINARY("model/gltf-binary"), + MODEL_GLTF_JSON("model/gltf+json"), + MODEL_JT("model/JT"), + MODEL_IGES("model/iges"), + MODEL_MESH("model/mesh"), + MODEL_MTL("model/mtl"), + MODEL_OBJ("model/obj"), + MODEL_PRC("model/prc"), + MODEL_STEP("model/step"), + MODEL_STEP_XML("model/step+xml"), + MODEL_STEP_ZIP("model/step+zip"), + MODEL_STEP_XML_ZIP("model/step-xml+zip"), + MODEL_STL("model/stl"), + MODEL_U3D("model/u3d"), + MODEL_VND_BARY("model/vnd.bary"), + MODEL_VND_CLD("model/vnd.cld"), + MODEL_VND_COLLADA_XML("model/vnd.collada+xml"), + MODEL_VND_DWF("model/vnd.dwf"), + MODEL_VND_FLATLAND_3DML("model/vnd.flatland.3dml"), + MODEL_VND_GDL("model/vnd.gdl"), + MODEL_VND_GS_GDL("model/vnd.gs-gdl"), + MODEL_VND_GTW("model/vnd.gtw"), + MODEL_VND_MOML_XML("model/vnd.moml+xml"), + MODEL_VND_MTS("model/vnd.mts"), + MODEL_VND_OPENGEX("model/vnd.opengex"), + MODEL_VND_PARASOLID_TRANSMIT_BINARY("model/vnd.parasolid.transmit.binary"), + MODEL_VND_PARASOLID_TRANSMIT_TEXT("model/vnd.parasolid.transmit.text"), + MODEL_VND_PYTHA_PYOX("model/vnd.pytha.pyox"), + MODEL_VND_ROSETTE_ANNOTATED_DATA_MODEL("model/vnd.rosette.annotated-data-model"), + MODEL_VND_SAP_VDS("model/vnd.sap.vds"), + MODEL_VND_USDA("model/vnd.usda"), + MODEL_VND_USDZ_ZIP("model/vnd.usdz+zip"), + MODEL_VND_VALVE_SOURCE_COMPILED_MAP("model/vnd.valve.source.compiled-map"), + MODEL_VND_VTU("model/vnd.vtu"), + MODEL_VRML("model/vrml"), + MODEL_X3D_VRML("model/x3d-vrml"), + MODEL_X3D_FASTINFOSET("model/x3d+fastinfoset"), + MODEL_X3D_XML("model/x3d+xml"), + MULTIPART_ALTERNATIVE("multipart/alternative"), + MULTIPART_APPLEDOUBLE("multipart/appledouble"), + MULTIPART_BYTERANGES("multipart/byteranges"), + MULTIPART_DIGEST("multipart/digest"), + MULTIPART_ENCRYPTED("multipart/encrypted"), + MULTIPART_EXAMPLE("multipart/example"), + MULTIPART_FORM_DATA("multipart/form-data"), + MULTIPART_HEADER_SET("multipart/header-set"), + MULTIPART_MIXED("multipart/mixed"), + MULTIPART_MULTILINGUAL("multipart/multilingual"), + MULTIPART_PARALLEL("multipart/parallel"), + MULTIPART_RELATED("multipart/related"), + MULTIPART_REPORT("multipart/report"), + MULTIPART_SIGNED("multipart/signed"), + MULTIPART_VND_BINT_MED_PLUS("multipart/vnd.bint.med-plus"), + MULTIPART_VOICE_MESSAGE("multipart/voice-message"), + MULTIPART_X_MIXED_REPLACE("multipart/x-mixed-replace"), + TEXT_1D_INTERLEAVED_PARITYFEC("text/1d-interleaved-parityfec"), + TEXT_CACHE_MANIFEST("text/cache-manifest"), + TEXT_CALENDAR("text/calendar"), + TEXT_CQL("text/cql"), + TEXT_CQL_EXPRESSION("text/cql-expression"), + TEXT_CQL_IDENTIFIER("text/cql-identifier"), + TEXT_CSS("text/css"), + TEXT_CSV("text/csv"), + TEXT_CSV_SCHEMA("text/csv-schema"), + TEXT_DIRECTORY("text/directory"), + TEXT_DNS("text/dns"), + TEXT_ECMASCRIPT("text/ecmascript"), + TEXT_ENCAPRTP("text/encaprtp"), + TEXT_ENRICHED("text/enriched"), + TEXT_EXAMPLE("text/example"), + TEXT_FHIRPATH("text/fhirpath"), + TEXT_FLEXFEC("text/flexfec"), + TEXT_FWDRED("text/fwdred"), + TEXT_GFF3("text/gff3"), + TEXT_GRAMMAR_REF_LIST("text/grammar-ref-list"), + TEXT_HL7V2("text/hl7v2"), + TEXT_HTML("text/html"), + TEXT_JAVASCRIPT("text/javascript"), + TEXT_JCR_CND("text/jcr-cnd"), + TEXT_MARKDOWN("text/markdown"), + TEXT_MIZAR("text/mizar"), + TEXT_N3("text/n3"), + TEXT_ORG("text/org"), + TEXT_PARAMETERS("text/parameters"), + TEXT_PARITYFEC("text/parityfec"), + TEXT_PLAIN("text/plain"), + TEXT_PROVENANCE_NOTATION("text/provenance-notation"), + TEXT_PRS_FALLENSTEIN_RST("text/prs.fallenstein.rst"), + TEXT_PRS_LINES_TAG("text/prs.lines.tag"), + TEXT_PRS_PROP_LOGIC("text/prs.prop.logic"), + TEXT_PRS_TEXI("text/prs.texi"), + TEXT_RAPTORFEC("text/raptorfec"), + TEXT_RED("text/RED"), + TEXT_RFC822_HEADERS("text/rfc822-headers"), + TEXT_RICHTEXT("text/richtext"), + TEXT_RTF("text/rtf"), + TEXT_RTP_ENC_AESCM128("text/rtp-enc-aescm128"), + TEXT_RTPLOOPBACK("text/rtploopback"), + TEXT_RTX("text/rtx"), + TEXT_SGML("text/SGML"), + TEXT_SHACLC("text/shaclc"), + TEXT_SHEX("text/shex"), + TEXT_SPDX("text/spdx"), + TEXT_STRINGS("text/strings"), + TEXT_T140("text/t140"), + TEXT_TAB_SEPARATED_VALUES("text/tab-separated-values"), + TEXT_TROFF("text/troff"), + TEXT_TURTLE("text/turtle"), + TEXT_ULPFEC("text/ulpfec"), + TEXT_URI_LIST("text/uri-list"), + TEXT_VCARD("text/vcard"), + TEXT_VND_A("text/vnd.a"), + TEXT_VND_ABC("text/vnd.abc"), + TEXT_VND_ASCII_ART("text/vnd.ascii-art"), + TEXT_VND_CURL("text/vnd.curl"), + TEXT_VND_DEBIAN_COPYRIGHT("text/vnd.debian.copyright"), + TEXT_VND_DMCLIENTSCRIPT("text/vnd.DMClientScript"), + TEXT_VND_DVB_SUBTITLE("text/vnd.dvb.subtitle"), + TEXT_VND_ESMERTEC_THEME_DESCRIPTOR("text/vnd.esmertec.theme-descriptor"), + TEXT_VND_EXCHANGEABLE("text/vnd.exchangeable"), + TEXT_VND_FAMILYSEARCH_GEDCOM("text/vnd.familysearch.gedcom"), + TEXT_VND_FICLAB_FLT("text/vnd.ficlab.flt"), + TEXT_VND_FLY("text/vnd.fly"), + TEXT_VND_FMI_FLEXSTOR("text/vnd.fmi.flexstor"), + TEXT_VND_GML("text/vnd.gml"), + TEXT_VND_GRAPHVIZ("text/vnd.graphviz"), + TEXT_VND_HANS("text/vnd.hans"), + TEXT_VND_HGL("text/vnd.hgl"), + TEXT_VND_IN3D_3DML("text/vnd.in3d.3dml"), + TEXT_VND_IN3D_SPOT("text/vnd.in3d.spot"), + TEXT_VND_IPTC_NEWSML("text/vnd.IPTC.NewsML"), + TEXT_VND_IPTC_NITF("text/vnd.IPTC.NITF"), + TEXT_VND_LATEX_Z("text/vnd.latex-z"), + TEXT_VND_MOTOROLA_REFLEX("text/vnd.motorola.reflex"), + TEXT_VND_MS_MEDIAPACKAGE("text/vnd.ms-mediapackage"), + TEXT_VND_NET2PHONE_COMMCENTER_COMMAND("text/vnd.net2phone.commcenter.command"), + TEXT_VND_RADISYS_MSML_BASIC_LAYOUT("text/vnd.radisys.msml-basic-layout"), + TEXT_VND_SENX_WARPSCRIPT("text/vnd.senx.warpscript"), + TEXT_VND_SI_URICATALOGUE("text/vnd.si.uricatalogue"), + TEXT_VND_SUN_J2ME_APP_DESCRIPTOR("text/vnd.sun.j2me.app-descriptor"), + TEXT_VND_SOSI("text/vnd.sosi"), + TEXT_VND_TYPST("text/vnd.typst"), + TEXT_VND_TROLLTECH_LINGUIST("text/vnd.trolltech.linguist"), + TEXT_VND_VCF("text/vnd.vcf"), + TEXT_VND_WAP_SI("text/vnd.wap.si"), + TEXT_VND_WAP_SL("text/vnd.wap.sl"), + TEXT_VND_WAP_WML("text/vnd.wap.wml"), + TEXT_VND_WAP_WMLSCRIPT("text/vnd.wap.wmlscript"), + TEXT_VND_ZOO_KCL("text/vnd.zoo.kcl"), + TEXT_VTT("text/vtt"), + TEXT_WGSL("text/wgsl"), + TEXT_XML("text/xml"), + TEXT_XML_EXTERNAL_PARSED_ENTITY("text/xml-external-parsed-entity"), + VIDEO_1D_INTERLEAVED_PARITYFEC("video/1d-interleaved-parityfec"), + VIDEO_3GPP("video/3gpp"), + VIDEO_3GPP2("video/3gpp2"), + VIDEO_3GPP_TT("video/3gpp-tt"), + VIDEO_AV1("video/AV1"), + VIDEO_BMPEG("video/BMPEG"), + VIDEO_BT656("video/BT656"), + VIDEO_CELB("video/CelB"), + VIDEO_DV("video/DV"), + VIDEO_ENCAPRTP("video/encaprtp"), + VIDEO_EVC("video/evc"), + VIDEO_EXAMPLE("video/example"), + VIDEO_FFV1("video/FFV1"), + VIDEO_FLEXFEC("video/flexfec"), + VIDEO_H261("video/H261"), + VIDEO_H263("video/H263"), + VIDEO_H263_1998("video/H263-1998"), + VIDEO_H263_2000("video/H263-2000"), + VIDEO_H264("video/H264"), + VIDEO_H264_RCDO("video/H264-RCDO"), + VIDEO_H264_SVC("video/H264-SVC"), + VIDEO_H265("video/H265"), + VIDEO_H266("video/H266"), + VIDEO_ISO_SEGMENT("video/iso.segment"), + VIDEO_JPEG("video/JPEG"), + VIDEO_JPEG2000("video/jpeg2000"), + VIDEO_JPEG2000_SCL("video/jpeg2000-scl"), + VIDEO_JXSV("video/jxsv"), + VIDEO_LOTTIE_JSON("video/lottie+json"), + VIDEO_MATROSKA("video/matroska"), + VIDEO_MATROSKA_3D("video/matroska-3d"), + VIDEO_MJ2("video/mj2"), + VIDEO_MP1S("video/MP1S"), + VIDEO_MP2P("video/MP2P"), + VIDEO_MP2T("video/MP2T"), + VIDEO_MP4("video/mp4"), + VIDEO_MP4V_ES("video/MP4V-ES"), + VIDEO_MPV("video/MPV"), + VIDEO_MPEG("video/mpeg"), + VIDEO_MPEG4_GENERIC("video/mpeg4-generic"), + VIDEO_NV("video/nv"), + VIDEO_OGG("video/ogg"), + VIDEO_PARITYFEC("video/parityfec"), + VIDEO_POINTER("video/pointer"), + VIDEO_QUICKTIME("video/quicktime"), + VIDEO_RAPTORFEC("video/raptorfec"), + VIDEO_RAW("video/raw"), + VIDEO_RTP_ENC_AESCM128("video/rtp-enc-aescm128"), + VIDEO_RTPLOOPBACK("video/rtploopback"), + VIDEO_RTX("video/rtx"), + VIDEO_SCIP("video/scip"), + VIDEO_SMPTE291("video/smpte291"), + VIDEO_SMPTE292M("video/SMPTE292M"), + VIDEO_ULPFEC("video/ulpfec"), + VIDEO_VC1("video/vc1"), + VIDEO_VC2("video/vc2"), + VIDEO_VND_BLOCKFACT_FACTV("video/vnd.blockfact.factv"), + VIDEO_VND_CCTV("video/vnd.CCTV"), + VIDEO_VND_DECE_HD("video/vnd.dece.hd"), + VIDEO_VND_DECE_MOBILE("video/vnd.dece.mobile"), + VIDEO_VND_DECE_MP4("video/vnd.dece.mp4"), + VIDEO_VND_DECE_PD("video/vnd.dece.pd"), + VIDEO_VND_DECE_SD("video/vnd.dece.sd"), + VIDEO_VND_DECE_VIDEO("video/vnd.dece.video"), + VIDEO_VND_DIRECTV_MPEG("video/vnd.directv.mpeg"), + VIDEO_VND_DIRECTV_MPEG_TTS("video/vnd.directv.mpeg-tts"), + VIDEO_VND_DLNA_MPEG_TTS("video/vnd.dlna.mpeg-tts"), + VIDEO_VND_DVB_FILE("video/vnd.dvb.file"), + VIDEO_VND_FVT("video/vnd.fvt"), + VIDEO_VND_HNS_VIDEO("video/vnd.hns.video"), + VIDEO_VND_IPTVFORUM_1DPARITYFEC_1010("video/vnd.iptvforum.1dparityfec-1010"), + VIDEO_VND_IPTVFORUM_1DPARITYFEC_2005("video/vnd.iptvforum.1dparityfec-2005"), + VIDEO_VND_IPTVFORUM_2DPARITYFEC_1010("video/vnd.iptvforum.2dparityfec-1010"), + VIDEO_VND_IPTVFORUM_2DPARITYFEC_2005("video/vnd.iptvforum.2dparityfec-2005"), + VIDEO_VND_IPTVFORUM_TTSAVC("video/vnd.iptvforum.ttsavc"), + VIDEO_VND_IPTVFORUM_TTSMPEG2("video/vnd.iptvforum.ttsmpeg2"), + VIDEO_VND_MOTOROLA_VIDEO("video/vnd.motorola.video"), + VIDEO_VND_MOTOROLA_VIDEOP("video/vnd.motorola.videop"), + VIDEO_VND_MPEGURL("video/vnd.mpegurl"), + VIDEO_VND_MS_PLAYREADY_MEDIA_PYV("video/vnd.ms-playready.media.pyv"), + VIDEO_VND_NOKIA_INTERLEAVED_MULTIMEDIA("video/vnd.nokia.interleaved-multimedia"), + VIDEO_VND_NOKIA_MP4VR("video/vnd.nokia.mp4vr"), + VIDEO_VND_NOKIA_VIDEOVOIP("video/vnd.nokia.videovoip"), + VIDEO_VND_OBJECTVIDEO("video/vnd.objectvideo"), + VIDEO_VND_PLANAR("video/vnd.planar"), + VIDEO_VND_RADGAMETTOOLS_BINK("video/vnd.radgamettools.bink"), + VIDEO_VND_RADGAMETTOOLS_SMACKER("video/vnd.radgamettools.smacker"), + VIDEO_VND_SEALED_MPEG1("video/vnd.sealed.mpeg1"), + VIDEO_VND_SEALED_MPEG4("video/vnd.sealed.mpeg4"), + VIDEO_VND_SEALED_SWF("video/vnd.sealed.swf"), + VIDEO_VND_SEALEDMEDIA_SOFTSEAL_MOV("video/vnd.sealedmedia.softseal.mov"), + VIDEO_VND_UVVU_MP4("video/vnd.uvvu.mp4"), + VIDEO_VND_YOUTUBE_YT("video/vnd.youtube.yt"), + VIDEO_VND_VIVO("video/vnd.vivo"), + VIDEO_VP8("video/VP8"), + VIDEO_VP9("video/VP9"); +} diff --git a/src/main/kotlin/com/mingliqiye/utils/http/MediaTypeUtils.kt b/src/main/kotlin/com/mingliqiye/utils/http/MediaTypeUtils.kt new file mode 100644 index 0000000..7b6f3d5 --- /dev/null +++ b/src/main/kotlin/com/mingliqiye/utils/http/MediaTypeUtils.kt @@ -0,0 +1,29 @@ +/* + * Copyright 2026 mingliqiye + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ProjectName mingli-utils + * ModuleName mingli-utils.main + * CurrentFile MediaTypeUtils.kt + * LastUpdate 2026-02-27 22:15:03 + * UpdateUser MingLiPro + */ +@file:JvmName("MediaTypeUtils") + +package com.mingliqiye.utils.http + +import okhttp3.MediaType.Companion.toMediaType + + +fun MediaType.okhttp(): okhttp3.MediaType = this.value.toMediaType() diff --git a/src/main/kotlin/com/mingliqiye/utils/http/okhttp/OkHttpUtils.kt b/src/main/kotlin/com/mingliqiye/utils/http/okhttp/OkHttpUtils.kt new file mode 100644 index 0000000..172d38c --- /dev/null +++ b/src/main/kotlin/com/mingliqiye/utils/http/okhttp/OkHttpUtils.kt @@ -0,0 +1,50 @@ +/* + * Copyright 2026 mingliqiye + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ProjectName mingli-utils + * ModuleName mingli-utils.main + * CurrentFile OkHttpUtils.kt + * LastUpdate 2026-02-27 22:16:15 + * UpdateUser MingLiPro + */ +@file:JvmName("OkHttpUtils") + +package com.mingliqiye.utils.http.okhttp + +import com.mingliqiye.utils.http.MediaType +import com.mingliqiye.utils.http.okhttp +import com.mingliqiye.utils.json.api.JSONA +import com.mingliqiye.utils.json.api.JSONA.toJson +import okhttp3.OkHttpClient +import okhttp3.Request +import okhttp3.RequestBody.Companion.toRequestBody +import okhttp3.Response + + +inline fun Response.json() = body.use { + JSONA.parse(it.bytes()) +} + +fun Response.text() = body.use { + String(it.bytes()) +} + +fun OkHttpClient.request() = Request.Builder() +fun Request.Builder.call(okHttpClient: OkHttpClient) = okHttpClient.newCall(this.build()) + +fun Request.Builder.postWithJson(data: Any): Request.Builder { + data.toJson().toRequestBody(MediaType.APPLICATION_JSON.okhttp()) + return this +} diff --git a/src/main/kotlin/com/mingliqiye/utils/i18n/I18N.kt b/src/main/kotlin/com/mingliqiye/utils/i18n/I18N.kt deleted file mode 100644 index 84d8ded..0000000 --- a/src/main/kotlin/com/mingliqiye/utils/i18n/I18N.kt +++ /dev/null @@ -1,964 +0,0 @@ -/* - * Copyright 2026 mingliqiye - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ProjectName mingli-utils - * ModuleName mingli-utils.main - * CurrentFile I18N.kt - * LastUpdate 2026-02-05 22:39:07 - * UpdateUser MingLiPro - */ - -package com.mingliqiye.utils.i18n - -import com.fasterxml.jackson.databind.ObjectMapper -import org.slf4j.Logger - - -object I18N { - - @JvmStatic - private var _Internationalization: Internationalization = Internationalization( - clazz = I18N::class.java, - objectMapper = ObjectMapper(), - isloadSlef = true - ) - - fun setInternationalization(value: Internationalization) { - this._Internationalization = value - } - - fun getInternationalization() = _Internationalization - - @JvmStatic - fun getString(string: String, vararg any: Any): String = _Internationalization.getString(string, *any) - - @JvmStatic - fun getString(string: String): String = _Internationalization.getString(string) - - @JvmStatic - fun getKeyString(key: String): String = _Internationalization.getKeyString(key) - - - fun Logger.infoTranslater(string: String, vararg any: Any) = this.info(getString(string, *any)) - fun Logger.warnTranslater(string: String, vararg any: Any) = this.warn(getString(string, *any)) - fun Logger.debugTranslater(string: String, vararg any: Any) = this.debug(getString(string, *any)) - fun Logger.traceTranslater(string: String, vararg any: Any) = this.trace(getString(string, *any)) - - // 0 个参数 - fun Logger.errorTranslater(string: String, any1: Any) { - this.error(getString(string)) - } - - fun Logger.errorTranslater(string: String) { - this.error(getString(string)) - } - - // 2 个参数 - fun Logger.errorTranslater(string: String, any1: Any, any2: Any) { - this.error(getString(string, any1, any2)) - } - - // 3 个参数 - fun Logger.errorTranslater(string: String, any1: Any, any2: Any, any3: Any) { - this.error(getString(string, any1, any2, any3)) - } - - // 4 个参数 - fun Logger.errorTranslater( - string: String, - any1: Any, - any2: Any, - any3: Any, - any4: Any, - - ) { - this.error(getString(string, any1, any2, any3, any4)) - } - - // 5 个参数 - fun Logger.errorTranslater( - string: String, - any1: Any, - any2: Any, - any3: Any, - any4: Any, - any5: Any, - - ) { - this.error(getString(string, any1, any2, any3, any4, any5)) - } - - // 6 个参数 - fun Logger.errorTranslater( - string: String, - any1: Any, - any2: Any, - any3: Any, - any4: Any, - any5: Any, - any6: Any, - - ) { - this.error(getString(string, any1, any2, any3, any4, any5, any6)) - } - - // 7 个参数 - fun Logger.errorTranslater( - string: String, - any1: Any, - any2: Any, - any3: Any, - any4: Any, - any5: Any, - any6: Any, - any7: Any, - - ) { - this.error(getString(string, any1, any2, any3, any4, any5, any6, any7)) - } - - // 8 个参数 - fun Logger.errorTranslater( - string: String, - any1: Any, - any2: Any, - any3: Any, - any4: Any, - any5: Any, - any6: Any, - any7: Any, - any8: Any, - - ) { - this.error(getString(string, any1, any2, any3, any4, any5, any6, any7, any8)) - } - - // 9 个参数 - fun Logger.errorTranslater( - string: String, - any1: Any, - any2: Any, - any3: Any, - any4: Any, - any5: Any, - any6: Any, - any7: Any, - any8: Any, - any9: Any, - - ) { - this.error(getString(string, any1, any2, any3, any4, any5, any6, any7, any8, any9)) - } - - // 10 个参数 - fun Logger.errorTranslater( - string: String, - any1: Any, - any2: Any, - any3: Any, - any4: Any, - any5: Any, - any6: Any, - any7: Any, - any8: Any, - any9: Any, - any10: Any, - - ) { - this.error(getString(string, any1, any2, any3, any4, any5, any6, any7, any8, any9, any10)) - } - - // 11 个参数 - fun Logger.errorTranslater( - string: String, - any1: Any, any2: Any, any3: Any, any4: Any, any5: Any, - any6: Any, any7: Any, any8: Any, any9: Any, any10: Any, any11: Any, - - ) { - this.error(getString(string, any1, any2, any3, any4, any5, any6, any7, any8, any9, any10, any11)) - } - - // 12 个参数 - fun Logger.errorTranslater( - string: String, - any1: Any, any2: Any, any3: Any, any4: Any, any5: Any, - any6: Any, any7: Any, any8: Any, any9: Any, any10: Any, any11: Any, any12: Any, - - ) { - this.error( - getString(string, any1, any2, any3, any4, any5, any6, any7, any8, any9, any10, any11, any12) - ) - } - - // 13 个参数 - fun Logger.errorTranslater( - string: String, - any1: Any, any2: Any, any3: Any, any4: Any, any5: Any, - any6: Any, any7: Any, any8: Any, any9: Any, any10: Any, any11: Any, any12: Any, any13: Any, - - ) { - this.error( - getString(string, any1, any2, any3, any4, any5, any6, any7, any8, any9, any10, any11, any12, any13), - - ) - } - - // 14 个参数 - fun Logger.errorTranslater( - string: String, - any1: Any, any2: Any, any3: Any, any4: Any, any5: Any, - any6: Any, any7: Any, any8: Any, any9: Any, any10: Any, any11: Any, any12: Any, any13: Any, any14: Any, - - ) { - this.error( - getString( - string, any1, any2, any3, any4, any5, any6, any7, any8, any9, any10, any11, any12, any13, any14 - ) - ) - } - - // 15 个参数 - fun Logger.errorTranslater( - string: String, - any1: Any, - any2: Any, - any3: Any, - any4: Any, - any5: Any, - any6: Any, - any7: Any, - any8: Any, - any9: Any, - any10: Any, - any11: Any, - any12: Any, - any13: Any, - any14: Any, - any15: Any, - - ) { - this.error( - getString( - string, any1, any2, any3, any4, any5, any6, any7, any8, any9, any10, any11, any12, any13, any14, any15 - ) - ) - } - - // 16 个参数 - fun Logger.errorTranslater( - string: String, - any1: Any, - any2: Any, - any3: Any, - any4: Any, - any5: Any, - any6: Any, - any7: Any, - any8: Any, - any9: Any, - any10: Any, - any11: Any, - any12: Any, - any13: Any, - any14: Any, - any15: Any, - any16: Any, - - ) { - this.error( - getString( - string, - any1, - any2, - any3, - any4, - any5, - any6, - any7, - any8, - any9, - any10, - any11, - any12, - any13, - any14, - any15, - any16 - ) - ) - } - - // 17 个参数 - fun Logger.errorTranslater( - string: String, - any1: Any, - any2: Any, - any3: Any, - any4: Any, - any5: Any, - any6: Any, - any7: Any, - any8: Any, - any9: Any, - any10: Any, - any11: Any, - any12: Any, - any13: Any, - any14: Any, - any15: Any, - any16: Any, - any17: Any, - - ) { - this.error( - getString( - string, - any1, - any2, - any3, - any4, - any5, - any6, - any7, - any8, - any9, - any10, - any11, - any12, - any13, - any14, - any15, - any16, - any17 - ) - ) - } - - // 18 个参数 - fun Logger.errorTranslater( - string: String, - any1: Any, - any2: Any, - any3: Any, - any4: Any, - any5: Any, - any6: Any, - any7: Any, - any8: Any, - any9: Any, - any10: Any, - any11: Any, - any12: Any, - any13: Any, - any14: Any, - any15: Any, - any16: Any, - any17: Any, - any18: Any, - - ) { - this.error( - getString( - string, - any1, - any2, - any3, - any4, - any5, - any6, - any7, - any8, - any9, - any10, - any11, - any12, - any13, - any14, - any15, - any16, - any17, - any18 - ) - ) - } - - // 19 个参数 - fun Logger.errorTranslater( - string: String, - any1: Any, - any2: Any, - any3: Any, - any4: Any, - any5: Any, - any6: Any, - any7: Any, - any8: Any, - any9: Any, - any10: Any, - any11: Any, - any12: Any, - any13: Any, - any14: Any, - any15: Any, - any16: Any, - any17: Any, - any18: Any, - any19: Any, - - ) { - this.error( - getString( - string, - any1, - any2, - any3, - any4, - any5, - any6, - any7, - any8, - any9, - any10, - any11, - any12, - any13, - any14, - any15, - any16, - any17, - any18, - any19 - ) - ) - } - - // 20 个参数 - fun Logger.errorTranslater( - string: String, - any1: Any, - any2: Any, - any3: Any, - any4: Any, - any5: Any, - any6: Any, - any7: Any, - any8: Any, - any9: Any, - any10: Any, - any11: Any, - any12: Any, - any13: Any, - any14: Any, - any15: Any, - any16: Any, - any17: Any, - any18: Any, - any19: Any, - any20: Any, - ) { - this.error( - getString( - string, - any1, - any2, - any3, - any4, - any5, - any6, - any7, - any8, - any9, - any10, - any11, - any12, - any13, - any14, - any15, - any16, - any17, - any18, - any19, - any20 - ) - ) - } - - - fun Logger.errorTranslater(string: String, throwable: Throwable) { - this.error(getString(string), throwable) - } - - // 1 个参数 - fun Logger.errorTranslater(string: String, any1: Any, throwable: Throwable) { - this.error(getString(string, any1), throwable) - } - - // 2 个参数 - fun Logger.errorTranslater(string: String, any1: Any, any2: Any, throwable: Throwable) { - this.error(getString(string, any1, any2), throwable) - } - - // 3 个参数 - fun Logger.errorTranslater(string: String, any1: Any, any2: Any, any3: Any, throwable: Throwable) { - this.error(getString(string, any1, any2, any3), throwable) - } - - // 4 个参数 - fun Logger.errorTranslater( - string: String, any1: Any, any2: Any, any3: Any, any4: Any, throwable: Throwable - ) { - this.error(getString(string, any1, any2, any3, any4), throwable) - } - - // 5 个参数 - fun Logger.errorTranslater( - string: String, any1: Any, any2: Any, any3: Any, any4: Any, any5: Any, throwable: Throwable - ) { - this.error(getString(string, any1, any2, any3, any4, any5), throwable) - } - - // 6 个参数 - fun Logger.errorTranslater( - string: String, any1: Any, any2: Any, any3: Any, any4: Any, any5: Any, any6: Any, throwable: Throwable - ) { - this.error(getString(string, any1, any2, any3, any4, any5, any6), throwable) - } - - // 7 个参数 - fun Logger.errorTranslater( - string: String, - any1: Any, - any2: Any, - any3: Any, - any4: Any, - any5: Any, - any6: Any, - any7: Any, - throwable: Throwable - ) { - this.error(getString(string, any1, any2, any3, any4, any5, any6, any7), throwable) - } - - // 8 个参数 - fun Logger.errorTranslater( - string: String, - any1: Any, - any2: Any, - any3: Any, - any4: Any, - any5: Any, - any6: Any, - any7: Any, - any8: Any, - throwable: Throwable - ) { - this.error(getString(string, any1, any2, any3, any4, any5, any6, any7, any8), throwable) - } - - // 9 个参数 - fun Logger.errorTranslater( - string: String, - any1: Any, - any2: Any, - any3: Any, - any4: Any, - any5: Any, - any6: Any, - any7: Any, - any8: Any, - any9: Any, - throwable: Throwable - ) { - this.error(getString(string, any1, any2, any3, any4, any5, any6, any7, any8, any9), throwable) - } - - // 10 个参数 - fun Logger.errorTranslater( - string: String, - any1: Any, - any2: Any, - any3: Any, - any4: Any, - any5: Any, - any6: Any, - any7: Any, - any8: Any, - any9: Any, - any10: Any, - throwable: Throwable - ) { - this.error(getString(string, any1, any2, any3, any4, any5, any6, any7, any8, any9, any10), throwable) - } - - // 11 个参数 - fun Logger.errorTranslater( - string: String, - any1: Any, - any2: Any, - any3: Any, - any4: Any, - any5: Any, - any6: Any, - any7: Any, - any8: Any, - any9: Any, - any10: Any, - any11: Any, - throwable: Throwable - ) { - this.error(getString(string, any1, any2, any3, any4, any5, any6, any7, any8, any9, any10, any11), throwable) - } - - // 12 个参数 - fun Logger.errorTranslater( - string: String, - any1: Any, - any2: Any, - any3: Any, - any4: Any, - any5: Any, - any6: Any, - any7: Any, - any8: Any, - any9: Any, - any10: Any, - any11: Any, - any12: Any, - throwable: Throwable - ) { - this.error( - getString(string, any1, any2, any3, any4, any5, any6, any7, any8, any9, any10, any11, any12), throwable - ) - } - - // 13 个参数 - fun Logger.errorTranslater( - string: String, - any1: Any, - any2: Any, - any3: Any, - any4: Any, - any5: Any, - any6: Any, - any7: Any, - any8: Any, - any9: Any, - any10: Any, - any11: Any, - any12: Any, - any13: Any, - throwable: Throwable - ) { - this.error( - getString(string, any1, any2, any3, any4, any5, any6, any7, any8, any9, any10, any11, any12, any13), - throwable - ) - } - - // 14 个参数 - fun Logger.errorTranslater( - string: String, - any1: Any, - any2: Any, - any3: Any, - any4: Any, - any5: Any, - any6: Any, - any7: Any, - any8: Any, - any9: Any, - any10: Any, - any11: Any, - any12: Any, - any13: Any, - any14: Any, - throwable: Throwable - ) { - this.error( - getString( - string, any1, any2, any3, any4, any5, any6, any7, any8, any9, any10, any11, any12, any13, any14 - ), throwable - ) - } - - // 15 个参数 - fun Logger.errorTranslater( - string: String, - any1: Any, - any2: Any, - any3: Any, - any4: Any, - any5: Any, - any6: Any, - any7: Any, - any8: Any, - any9: Any, - any10: Any, - any11: Any, - any12: Any, - any13: Any, - any14: Any, - any15: Any, - throwable: Throwable - ) { - this.error( - getString( - string, any1, any2, any3, any4, any5, any6, any7, any8, any9, any10, any11, any12, any13, any14, any15 - ), throwable - ) - } - - // 16 个参数 - fun Logger.errorTranslater( - string: String, - any1: Any, - any2: Any, - any3: Any, - any4: Any, - any5: Any, - any6: Any, - any7: Any, - any8: Any, - any9: Any, - any10: Any, - any11: Any, - any12: Any, - any13: Any, - any14: Any, - any15: Any, - any16: Any, - throwable: Throwable - ) { - this.error( - getString( - string, - any1, - any2, - any3, - any4, - any5, - any6, - any7, - any8, - any9, - any10, - any11, - any12, - any13, - any14, - any15, - any16 - ), throwable - ) - } - - // 17 个参数 - fun Logger.errorTranslater( - string: String, - any1: Any, - any2: Any, - any3: Any, - any4: Any, - any5: Any, - any6: Any, - any7: Any, - any8: Any, - any9: Any, - any10: Any, - any11: Any, - any12: Any, - any13: Any, - any14: Any, - any15: Any, - any16: Any, - any17: Any, - throwable: Throwable - ) { - this.error( - getString( - string, - any1, - any2, - any3, - any4, - any5, - any6, - any7, - any8, - any9, - any10, - any11, - any12, - any13, - any14, - any15, - any16, - any17 - ), throwable - ) - } - - // 18 个参数 - fun Logger.errorTranslater( - string: String, - any1: Any, - any2: Any, - any3: Any, - any4: Any, - any5: Any, - any6: Any, - any7: Any, - any8: Any, - any9: Any, - any10: Any, - any11: Any, - any12: Any, - any13: Any, - any14: Any, - any15: Any, - any16: Any, - any17: Any, - any18: Any, - throwable: Throwable - ) { - this.error( - getString( - string, - any1, - any2, - any3, - any4, - any5, - any6, - any7, - any8, - any9, - any10, - any11, - any12, - any13, - any14, - any15, - any16, - any17, - any18 - ), throwable - ) - } - - // 19 个参数 - fun Logger.errorTranslater( - string: String, - any1: Any, - any2: Any, - any3: Any, - any4: Any, - any5: Any, - any6: Any, - any7: Any, - any8: Any, - any9: Any, - any10: Any, - any11: Any, - any12: Any, - any13: Any, - any14: Any, - any15: Any, - any16: Any, - any17: Any, - any18: Any, - any19: Any, - throwable: Throwable - ) { - this.error( - getString( - string, - any1, - any2, - any3, - any4, - any5, - any6, - any7, - any8, - any9, - any10, - any11, - any12, - any13, - any14, - any15, - any16, - any17, - any18, - any19 - ), throwable - ) - } - - // 20 个参数 - fun Logger.errorTranslater( - string: String, - any1: Any, - any2: Any, - any3: Any, - any4: Any, - any5: Any, - any6: Any, - any7: Any, - any8: Any, - any9: Any, - any10: Any, - any11: Any, - any12: Any, - any13: Any, - any14: Any, - any15: Any, - any16: Any, - any17: Any, - any18: Any, - any19: Any, - any20: Any, - throwable: Throwable - ) { - this.error( - getString( - string, - any1, - any2, - any3, - any4, - any5, - any6, - any7, - any8, - any9, - any10, - any11, - any12, - any13, - any14, - any15, - any16, - any17, - any18, - any19, - any20 - ), throwable - ) - } - - -} diff --git a/src/main/kotlin/com/mingliqiye/utils/i18n/Internationalization.kt b/src/main/kotlin/com/mingliqiye/utils/i18n/Internationalization.kt deleted file mode 100644 index dc1446b..0000000 --- a/src/main/kotlin/com/mingliqiye/utils/i18n/Internationalization.kt +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright 2026 mingliqiye - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ProjectName mingli-utils - * ModuleName mingli-utils.main - * CurrentFile Internationalization.kt - * LastUpdate 2026-02-06 08:47:26 - * UpdateUser MingLiPro - */ - -package com.mingliqiye.utils.i18n - -import com.fasterxml.jackson.databind.JsonNode -import com.fasterxml.jackson.databind.ObjectMapper -import com.mingliqiye.utils.logger.MingLiLoggerFactory -import org.slf4j.Logger -import java.net.URL -import java.util.* - -class Internationalization { - var clazz: Class<*> - var objectMapper: ObjectMapper - var locale: Locale - var backLocale: Locale - val langPath: String - val thisName: String - val thisBackName: String - private var log: Logger = MingLiLoggerFactory.getLogger() - - - constructor( - clazz: Class<*>, - objectMapper: ObjectMapper, - locale: Locale = Locale.getDefault(), - backLocale: Locale = Locale.US, - langPath: String = "/lang", - isloadSlef: Boolean = false - ) { - this.clazz = clazz - this.objectMapper = objectMapper - this.locale = locale - this.backLocale = backLocale - this.langPath = langPath - thisName = getLanguageName(locale) - thisBackName = getLanguageName(backLocale) - readJson("/assets/mingli-utils/lang/${thisName}.json", Internationalization::class.java, thisName) - if (!isloadSlef) { - if (!readJson(fileName = "$langPath/${thisName}.json", lang = thisName)) { - log.warn(getString("com.mingliqiye.utils.i18n.readjson.error", "$langPath/${thisName}.json")) - } - } - if (thisName != thisBackName) { - readJson("/assets/mingli-utils/lang/${thisBackName}.json", Internationalization::class.java, thisBackName) - if (!isloadSlef) { - if (!readJson(fileName = "$langPath/${thisBackName}.json", lang = thisBackName)) { - log.warn(getString("com.mingliqiye.utils.i18n.readjson.error", "$langPath/${thisBackName}.json")) - } - } - } - } - - fun getString(string: String, vararg any: Any): String { - return getString(string).format(*any) - } - - fun getString(string: String): String { - return getKeyString(string) - } - - fun getKeyString(key: String): String { - val s = localesData[thisName]?.get(key) ?: localesData[thisBackName]?.get(key) - if (s == null) { - return key - } - return s - } - - fun getLanguageName(locale: Locale): String = - if (locale.country == null || locale.language == null) locale.country + locale.language else locale.language + '_' + locale.country - - constructor( - clazz: Class<*>, - objectMapper: ObjectMapper, - ) : this( - locale = Locale.getDefault(), clazz = clazz, objectMapper = objectMapper - ) - - constructor( - clazz: Class<*>, objectMapper: ObjectMapper, langPath: String = "/lang" - ) : this( - locale = Locale.getDefault(), clazz = clazz, langPath = langPath, objectMapper = objectMapper - ) - - val localesData: MutableMap> = mutableMapOf() - - fun getlangFile( - clazzd: Class<*>, fileName: String - ): URL? { - return clazzd.getResource(fileName) - } - - fun readJson( - fileName: String, clazzd: Class<*> = clazz, lang: String - ): Boolean { - val byteArray: ByteArray? = getlangFile(clazzd, fileName)?.openStream()?.use { it.readBytes() } - if (byteArray == null) return false - val node: JsonNode = objectMapper.readTree(byteArray) - if (node.isArray) return false - if (node.isEmpty) return false - var m = localesData[lang] - if (m == null) { - m = mutableMapOf() - localesData[lang] = m - } - readJsonNode(node, "", m) - return true - } - - fun readJsonNode(node: JsonNode, path: String, map: MutableMap) { - val fields = node.properties().iterator() - while (fields.hasNext()) { - val (k, v) = fields.next() - val pathName = if (path.isEmpty()) path + k else "$path.$k" - if (v.isTextual) { - map[pathName] = v.asText() - } else if (v.isObject) { - readJsonNode(v, pathName, map) - } - } - } - -} diff --git a/src/main/kotlin/com/mingliqiye/utils/io/InputStreamUtils.kt b/src/main/kotlin/com/mingliqiye/utils/io/InputStreamUtils.kt index 7265ec2..424b876 100644 --- a/src/main/kotlin/com/mingliqiye/utils/io/InputStreamUtils.kt +++ b/src/main/kotlin/com/mingliqiye/utils/io/InputStreamUtils.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025 mingliqiye + * Copyright 2026 mingliqiye * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ * ProjectName mingli-utils * ModuleName mingli-utils.main * CurrentFile InputStreamUtils.kt - * LastUpdate 2025-09-15 17:26:34 + * LastUpdate 2026-03-11 08:46:40 * UpdateUser MingLiPro */ @file:JvmName("InputStreamUtils") @@ -28,23 +28,16 @@ import java.io.OutputStream import java.nio.charset.Charset -fun InputStream.readAllText(charset: Charset = Charsets.UTF_8): String { - return this.readAllBytes().toString(charset) -} - -fun InputStream.readAllBytes(): ByteArray { - return this.readBytes() -} +fun InputStream.readAllText(charset: Charset = Charsets.UTF_8) = this.readAllBytes().toString(charset) fun InputStream.exportBytes(out: OutputStream) { out.write(this.readAllBytes()) out.flush() } -fun InputStream.readToList(): List { - return this.readBytes().toList() -} - - +fun InputStream.readToList(): List = this.readBytes().toList() +@Suppress("EXTENSION_SHADOWED_BY_MEMBER") +@JvmName("readInputStreamAllBytes") +fun InputStream.readAllBytes(): ByteArray = this.readBytes() diff --git a/src/main/kotlin/com/mingliqiye/utils/io/IO.kt b/src/main/kotlin/com/mingliqiye/utils/io/SIO.kt similarity index 66% rename from src/main/kotlin/com/mingliqiye/utils/io/IO.kt rename to src/main/kotlin/com/mingliqiye/utils/io/SIO.kt index 8165627..0ea21da 100644 --- a/src/main/kotlin/com/mingliqiye/utils/io/IO.kt +++ b/src/main/kotlin/com/mingliqiye/utils/io/SIO.kt @@ -15,8 +15,8 @@ * * ProjectName mingli-utils * ModuleName mingli-utils.main - * CurrentFile IO.kt - * LastUpdate 2026-02-06 13:21:33 + * CurrentFile SIO.kt + * LastUpdate 2026-02-27 12:36:11 * UpdateUser MingLiPro */ @@ -29,46 +29,134 @@ import org.slf4j.Logger import java.io.OutputStream import java.io.PrintStream +/** + * 已弃用的IO对象,所有方法都委托给SIO对象 + * @deprecated 请使用SIO对象替代 + */ +@Deprecated("This IO is deprecated. reName SIO", replaceWith = ReplaceWith("SIO"), level = DeprecationLevel.WARNING) +object IO { + /** + * 打印多个参数,使用空格分隔 + * @param args 要打印的参数数组 + */ + @JvmStatic + fun print(vararg args: Any?) = SIO.print(*args) + + /** + * 打印多个参数并换行,使用空格分隔 + * @param args 要打印的参数数组 + */ + @JvmStatic + fun println(vararg args: Any?) = SIO.println(*args) + + /** + * 打印多个参数并换行,指定分隔符 + * @param sp 分隔符 + * @param args 要打印的参数数组 + */ + @JvmStatic + fun printlnA(sp: String, vararg args: Any?) = SIO.printlnA(sp, *args) + + /** + * 打印多个参数,指定分隔符 + * @param sp 分隔符,默认为空字符串 + * @param args 要打印的参数数组 + */ + @JvmStatic + fun printA(sp: String = "", vararg args: Any?) = SIO.printA(sp, *args) + + /** + * 重定向 System.out 到 INFO 级别日志 + */ + @JvmStatic + fun redirectOutToInfo() = SIO.redirectOutToInfo() + + /** + * 重定向 System.err 到 ERROR 级别 + */ + @JvmStatic + fun redirectErrToError() = SIO.redirectErrToError() + + /** + * 完全重定向(包括第三方库的输出) + */ + @JvmStatic + fun redirectAll() = SIO.redirectAll() + + /** + * 恢复原始输出流 + */ + @JvmStatic + fun restore() = SIO.restore() +} + /** * IO工具类,提供打印功能和系统输出流重定向到日志的功能 */ -object IO { +object SIO { + /** + * 扩展函数:将字节数组以十六进制格式打印,每两个字符用空格分隔 + * @return 原始字节数组 + */ @JvmStatic fun ByteArray.println(): ByteArray { this.toHexString().chunked(2).println() return this } + /** + * 扩展函数:将列表以花括号格式打印,元素间用逗号分隔 + * @return 原始列表 + */ @JvmStatic fun List.println(): List { println("{" + ",".join(this) + "}") return this } + /** + * 扩展函数:将数组以花括号格式打印,元素间用逗号分隔 + * @return 原始数组 + */ @JvmStatic fun Array.println(): Array { println("{" + ",".join(this) + "}") return this } + /** + * 扩展函数:打印任意对象并返回该对象 + * @return 原始对象 + */ @JvmStatic fun T.println(): T { println(this) return this } + /** + * 原始标准输出流的备份 + */ @JvmStatic - var originalOut: PrintStream = System.out + val originalOut: PrintStream = System.out + /** + * 原始错误输出流的备份 + */ @JvmStatic - var originalErr: PrintStream = System.err - + val originalErr: PrintStream = System.err + /** + * 用于记录标准输出的日志记录器 + */ @JvmStatic val outLog: Logger = MingLiLoggerFactory.getLogger("out") + /** + * 用于记录错误输出的日志记录器 + */ @JvmStatic val errLog: Logger = MingLiLoggerFactory.getLogger("err") @@ -119,10 +207,11 @@ object IO { kotlin.io.print(sb) } + /** + * 重定向 System.out 到 INFO 级别日志 + * 创建自定义PrintStream,将输出内容缓冲并记录到INFO级别日志中 + */ @JvmStatic - /** - * 重定向 System.out 到 INFO 级别日志 - */ fun redirectOutToInfo() { val outLogger = PrintStream(object : OutputStream() { private val buffer = StringBuilder() @@ -169,10 +258,11 @@ object IO { System.setOut(outLogger) } + /** + * 重定向 System.err 到 ERROR 级别 + * 创建自定义PrintStream,将错误输出内容缓冲并记录到ERROR级别日志中 + */ @JvmStatic - /** - * 重定向 System.err 到 ERROR 级别 - */ fun redirectErrToError() { val errLogger = PrintStream(object : OutputStream() { private val buffer = StringBuilder() @@ -219,19 +309,21 @@ object IO { System.setErr(errLogger) } + /** + * 完全重定向(包括第三方库的输出) + * 同时重定向标准输出和错误输出到对应的日志级别 + */ @JvmStatic - /** - * 完全重定向(包括第三方库的输出) - */ fun redirectAll() { redirectOutToInfo() redirectErrToError() } + /** + * 恢复原始输出流 + * 将System.out和System.err恢复到原始状态 + */ @JvmStatic - /** - * 恢复原始输出流 - */ fun restore() { System.setOut(originalOut) System.setErr(originalErr) diff --git a/src/main/kotlin/com/mingliqiye/utils/json/Jackson3JsonApi.kt b/src/main/kotlin/com/mingliqiye/utils/json/Jackson3JsonApi.kt new file mode 100644 index 0000000..cd5cfe1 --- /dev/null +++ b/src/main/kotlin/com/mingliqiye/utils/json/Jackson3JsonApi.kt @@ -0,0 +1,217 @@ +/* + * Copyright 2026 mingliqiye + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ProjectName mingli-utils + * ModuleName mingli-utils.main + * CurrentFile Jackson3JsonApi.kt + * LastUpdate 2026-03-11 08:46:40 + * UpdateUser MingLiPro + */ + +package com.mingliqiye.utils.json + +import com.mingliqiye.utils.exception.JsonException +import com.mingliqiye.utils.json.api.base.JsonApi +import com.mingliqiye.utils.json.api.type.JsonTypeReference +import com.mingliqiye.utils.json.converters.base.BaseJsonConverter +import com.mingliqiye.utils.json.converters.base.getJackson3Module +import tools.jackson.core.type.TypeReference +import tools.jackson.databind.JsonNode +import tools.jackson.databind.ObjectMapper +import tools.jackson.databind.node.ObjectNode +import java.lang.reflect.Type + +class Jackson3JsonApi : JsonApi { + + var get: () -> ObjectMapper + var set: (ObjectMapper) -> Unit + + private var _prObjectMapper: ObjectMapper? = null + + + private var objectMapper: ObjectMapper + get() = get() + set(value) = set(value) + + constructor(objectMapper: ObjectMapper) { + _prObjectMapper = objectMapper + get = { _prObjectMapper!! } + set = { _prObjectMapper = it } + } + + constructor( + get: () -> ObjectMapper, + set: (ObjectMapper) -> Unit, + ) { + this.get = get + this.set = set + } + + override fun parse(json: String, clazz: Class): T { + try { + return objectMapper.readValue(json, clazz) + } catch (e: Exception) { + throw JsonException("Failed to parse JSON to ${clazz.simpleName}", e) + } + } + + override fun parse(json: String, type: JsonTypeReference): T { + try { + return objectMapper.readValue(json, object : TypeReference() { + override fun getType(): Type = type.type + }) + } catch (e: Exception) { + throw JsonException("Failed to parse JSON to type: $type", e) + } + } + + override fun format(obj: Any): String { + try { + return objectMapper.writeValueAsString(obj) + } catch (e: Exception) { + throw JsonException("Failed to format object to JSON: ${obj.javaClass.simpleName}", e) + } + } + + override fun formatPretty(obj: Any): String { + try { + return objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(obj) + } catch (e: Exception) { + throw JsonException("Failed to format object to pretty JSON: ${obj.javaClass.simpleName}", e) + } + } + + override fun isValidJson(json: String): Boolean { + return try { + objectMapper.readTree(json) + true + } catch (e: Exception) { + false + } + } + + override fun merge(vararg jsons: String): String { + try { + if (jsons.isEmpty()) return "{}" + + val resultNode = objectMapper.createObjectNode() + + for (json in jsons) { + val node = objectMapper.readTree(json) + if (node is ObjectNode) { + resultNode.setAll(node) + } else { + throw JsonException("Cannot merge non-object JSON: $json") + } + } + + return objectMapper.writeValueAsString(resultNode) + } catch (e: Exception) { + throw JsonException("Failed to merge JSON objects", e) + } + } + + override fun getNodeValue(json: String, path: String): String? { + try { + val rootNode = objectMapper.readTree(json) + val node = rootNode.at(path) + + return if (node.isMissingNode || node.isNull) { + null + } else { + node.asString() + } + } catch (e: Exception) { + throw JsonException("Failed to get node value at path: $path", e) + } + } + + override fun updateNodeValue(json: String, path: String, newValue: Any): String { + try { + val rootNode = objectMapper.readTree(json) + + // 处理 JSON Pointer 路径 + val pathParts = path.split("/").filter { it.isNotEmpty() } + + if (pathParts.isEmpty()) { + // 替换整个根节点 + return objectMapper.writeValueAsString(newValue) + } + + when (val parentNode = findParentNode(rootNode, pathParts)) { + is ObjectNode -> { + val fieldName = pathParts.last() + val valueNode = objectMapper.valueToTree(newValue) + parentNode.replace(fieldName, valueNode) + } + + else -> { + throw JsonException("Cannot update node: parent is not an object node at path: $path") + } + } + + return objectMapper.writeValueAsString(rootNode) + } catch (e: Exception) { + throw JsonException("Failed to update node value at path: $path", e) + } + } + + override fun convert(source: Any, destinationClass: Class): D { + try { + return objectMapper.convertValue(source, destinationClass) + } catch (e: Exception) { + throw JsonException( + "Failed to convert from ${source.javaClass.simpleName} to ${destinationClass.simpleName}", + e + ) + } + } + + override fun convert( + source: Any, + destinationType: JsonTypeReference, + ): D { + try { + return objectMapper.convertValue(source, object : TypeReference() { + override fun getType(): Type = destinationType.type + }) + } catch (e: Exception) { + throw JsonException("Failed to convert from ${source.javaClass.simpleName} to type: $destinationType", e) + } + } + + + // 辅助方法:查找父节点 + private fun findParentNode(root: JsonNode, pathParts: List): JsonNode { + var current: JsonNode = root + + // 遍历到最后一个元素之前(即找到父节点) + for (i in 0 until pathParts.size - 1) { + val part = pathParts[i] + current = when { + part.matches(Regex("\\d+")) -> current.get(part.toInt()) + else -> current.get(part) + } ?: throw JsonException("Path not found: ${pathParts.subList(0, i + 1).joinToString("/")}") + } + + return current + } + + override fun addJsonConverter(c: BaseJsonConverter<*, *>) { + val mapperBuilder = Jackson3ApiJavaHelper.rebuild(objectMapper) + mapperBuilder.addModule(c.getJackson3Module()) + this.objectMapper = mapperBuilder.build() + } +} diff --git a/src/main/kotlin/com/mingliqiye/utils/json/api/JSONA.kt b/src/main/kotlin/com/mingliqiye/utils/json/api/JSONA.kt index e4e731f..60b8899 100644 --- a/src/main/kotlin/com/mingliqiye/utils/json/api/JSONA.kt +++ b/src/main/kotlin/com/mingliqiye/utils/json/api/JSONA.kt @@ -16,7 +16,7 @@ * ProjectName mingli-utils * ModuleName mingli-utils.main * CurrentFile JSONA.kt - * LastUpdate 2026-02-05 10:34:30 + * LastUpdate 2026-02-26 14:14:18 * UpdateUser MingLiPro */ @@ -28,6 +28,7 @@ import com.mingliqiye.utils.json.api.base.JsonApi import com.mingliqiye.utils.json.api.type.JsonTypeReference import com.mingliqiye.utils.json.api.type.listType import com.mingliqiye.utils.json.converters.base.BaseJsonConverter +import com.mingliqiye.utils.json.converters.base.getJsonConverter import java.io.File import java.io.InputStream import java.io.OutputStream @@ -71,7 +72,7 @@ object JSONA { * @param T 继承自JsonApi的具体实现类 */ inline fun setJsonApi() { - setJsonApi(T::class.java.newInstance() as JsonApi) + setJsonApi(T::class.java.getConstructor().newInstance() as JsonApi) } /** @@ -127,14 +128,6 @@ object JSONA { @JvmStatic fun format(obj: Any): String = getJsonApi().format(obj) - /** - * 将对象格式化为带Unicode转义的JSON字符串 - * - * @param obj 待格式化的对象 - * @return 格式化后的带Unicode转义的JSON字符串 - */ - @JvmStatic - fun formatUnicode(obj: Any): String = getJsonApi().formatPrettyUnicode(obj) /** * 从文件路径解析JSON为指定类型的对象 @@ -291,24 +284,6 @@ object JSONA { @JvmStatic fun formatPrettyBytes(obj: Any): ByteArray = getJsonApi().formatPrettyBytes(obj) - /** - * 将对象格式化为带Unicode转义的美化JSON字符串 - * - * @param obj 待格式化的对象 - * @return 格式化后的带Unicode转义的美化JSON字符串 - */ - @JvmStatic - fun formatPrettyUnicode(obj: Any): String = getJsonApi().formatPrettyUnicode(obj) - - /** - * 将对象格式化为带Unicode转义的美化JSON字节数组 - * - * @param obj 待格式化的对象 - * @return 格式化后的带Unicode转义的美化JSON字节数组 - */ - @JvmStatic - fun formatPrettyUnicodeBytes(obj: Any): ByteArray = getJsonApi().formatPrettyUnicodeBytes(obj) - /** * 将对象格式化为美化格式的JSON字符串并写入文件 * @@ -345,41 +320,6 @@ object JSONA { @JvmStatic fun formatPretty(obj: Any, stream: OutputStream) = getJsonApi().formatPretty(obj, stream) - /** - * 将对象格式化为带Unicode转义的美化JSON字符串并写入文件 - * - * @param obj 待格式化的对象 - * @param file 文件路径 - */ - @JvmStatic - fun formatPrettyUnicode(obj: Any, file: String) = getJsonApi().formatPrettyUnicode(obj, file) - - /** - * 将对象格式化为带Unicode转义的美化JSON字符串并写入文件 - * - * @param obj 待格式化的对象 - * @param file Path对象 - */ - @JvmStatic - fun formatPrettyUnicode(obj: Any, file: Path) = getJsonApi().formatPrettyUnicode(obj, file) - - /** - * 将对象格式化为带Unicode转义的美化JSON字符串并写入文件 - * - * @param obj 待格式化的对象 - * @param file File对象 - */ - @JvmStatic - fun formatPrettyUnicode(obj: Any, file: File) = getJsonApi().formatPrettyUnicode(obj, file) - - /** - * 将对象格式化为带Unicode转义的美化JSON字符串并写入输出流 - * - * @param obj 待格式化的对象 - * @param stream OutputStream对象 - */ - @JvmStatic - fun formatPrettyUnicode(obj: Any, stream: OutputStream) = getJsonApi().formatPrettyUnicode(obj, stream) /** * 将对象格式化为JSON字节数组 @@ -390,14 +330,6 @@ object JSONA { @JvmStatic fun formatBytes(obj: Any): ByteArray = getJsonApi().formatBytes(obj) - /** - * 将对象格式化为带Unicode转义的JSON字节数组 - * - * @param obj 待格式化的对象 - * @return 格式化后的带Unicode转义的JSON字节数组 - */ - @JvmStatic - fun formatUnicodeBytes(obj: Any): ByteArray = getJsonApi().formatUnicodeBytes(obj) /** * 将对象格式化为JSON字符串并写入文件 @@ -435,41 +367,6 @@ object JSONA { @JvmStatic fun format(obj: Any, stream: OutputStream) = getJsonApi().format(obj, stream) - /** - * 将对象格式化为带Unicode转义的JSON字符串并写入文件 - * - * @param obj 待格式化的对象 - * @param file 文件路径 - */ - @JvmStatic - fun formatUnicode(obj: Any, file: String) = getJsonApi().formatUnicode(obj, file) - - /** - * 将对象格式化为带Unicode转义的JSON字符串并写入文件 - * - * @param obj 待格式化的对象 - * @param file Path对象 - */ - @JvmStatic - fun formatUnicode(obj: Any, file: Path) = getJsonApi().formatUnicode(obj, file) - - /** - * 将对象格式化为带Unicode转义的JSON字符串并写入文件 - * - * @param obj 待格式化的对象 - * @param file File对象 - */ - @JvmStatic - fun formatUnicode(obj: Any, file: File) = getJsonApi().formatUnicode(obj, file) - - /** - * 将对象格式化为带Unicode转义的JSON字符串并写入输出流 - * - * @param obj 待格式化的对象 - * @param stream OutputStream对象 - */ - @JvmStatic - fun formatUnicode(obj: Any, stream: OutputStream) = getJsonApi().formatUnicode(obj, stream) /** * 将JSON字符串解析为指定元素类型的List集合 @@ -627,8 +524,7 @@ object JSONA { * * @param T 继承自BaseJsonConverter的具体实现类 */ - inline fun > addJsonConverter() = - addJsonConverter(T::class.java.newInstance()) + inline fun > addJsonConverter() = addJsonConverter(getJsonConverter()) inline fun String.parseJson() = parse(this) @@ -639,6 +535,9 @@ object JSONA { fun Any.toJson() = format(this) + @JvmStatic fun jacksonKotlinObjectMapper(): ObjectMapper = ObjectMapper().jacksonKotlinObjectMapper() + + @JvmStatic fun ObjectMapper.jacksonKotlinObjectMapper(): ObjectMapper = this.registerModule(kotlinModule()) } diff --git a/src/main/kotlin/com/mingliqiye/utils/json/api/JacksonJsonApi.kt b/src/main/kotlin/com/mingliqiye/utils/json/api/JacksonJsonApi.kt index 319d244..383d4d5 100644 --- a/src/main/kotlin/com/mingliqiye/utils/json/api/JacksonJsonApi.kt +++ b/src/main/kotlin/com/mingliqiye/utils/json/api/JacksonJsonApi.kt @@ -16,7 +16,7 @@ * ProjectName mingli-utils * ModuleName mingli-utils.main * CurrentFile JacksonJsonApi.kt - * LastUpdate 2026-02-05 14:41:27 + * LastUpdate 2026-03-11 08:46:40 * UpdateUser MingLiPro */ @@ -32,6 +32,7 @@ import com.mingliqiye.utils.exception.JsonException import com.mingliqiye.utils.json.api.base.JsonApi import com.mingliqiye.utils.json.api.type.JsonTypeReference import com.mingliqiye.utils.json.converters.base.BaseJsonConverter +import com.mingliqiye.utils.json.converters.base.getJacksonModule /** * 基于Jackson的JSON处理实现类,提供JSON字符串解析、格式化、合并、节点操作等功能。 @@ -110,7 +111,7 @@ class JacksonJsonApi : JsonApi { } } - override fun formatUnicode(obj: Any): String { + fun formatUnicode(obj: Any): String { return try { objectMapper.writer().with(JsonGenerator.Feature.ESCAPE_NON_ASCII).writeValueAsString(obj) } catch (e: Exception) { @@ -135,7 +136,7 @@ class JacksonJsonApi : JsonApi { } } - override fun formatPrettyUnicode(obj: Any): String { + fun formatPrettyUnicode(obj: Any): String { return try { objectMapper.writerWithDefaultPrettyPrinter().with(JsonGenerator.Feature.ESCAPE_NON_ASCII) .writeValueAsString(obj) diff --git a/src/main/kotlin/com/mingliqiye/utils/json/api/base/JsonApi.kt b/src/main/kotlin/com/mingliqiye/utils/json/api/base/JsonApi.kt index 4b9cfc7..b6ecc46 100644 --- a/src/main/kotlin/com/mingliqiye/utils/json/api/base/JsonApi.kt +++ b/src/main/kotlin/com/mingliqiye/utils/json/api/base/JsonApi.kt @@ -16,7 +16,7 @@ * ProjectName mingli-utils * ModuleName mingli-utils.main * CurrentFile JsonApi.kt - * LastUpdate 2026-02-04 21:00:48 + * LastUpdate 2026-03-11 08:46:40 * UpdateUser MingLiPro */ @@ -25,6 +25,7 @@ package com.mingliqiye.utils.json.api.base import com.mingliqiye.utils.json.api.type.JsonTypeReference import com.mingliqiye.utils.json.api.type.listType import com.mingliqiye.utils.json.converters.base.BaseJsonConverter +import com.mingliqiye.utils.json.converters.base.getJsonConverter import java.io.* import java.nio.file.Files import java.nio.file.Path @@ -111,7 +112,7 @@ interface JsonApi { * @return 解析后的Map集合 */ inline fun JsonApi.parseMap( - json: String + json: String, ): MutableMap = parseMap(json, K::class.java, V::class.java) @@ -133,7 +134,7 @@ interface JsonApi { */ @JvmStatic inline fun > JsonApi.addJsonConverter() { - addJsonConverter(T::class.java.newInstance()) + addJsonConverter(getJsonConverter()) } } @@ -166,8 +167,6 @@ interface JsonApi { */ fun format(obj: Any): String - fun formatUnicode(obj: Any): String - /** * 从文件路径读取JSON并解析为指定类型对象 * @@ -333,7 +332,7 @@ interface JsonApi { * @return 解析后的对象实例或默认值 **/ fun parse( - json: String, type: JsonTypeReference, defaultValue: T + json: String, type: JsonTypeReference, defaultValue: T, ): T { return try { parse(json, type) @@ -354,12 +353,6 @@ interface JsonApi { return formatPretty(obj)!!.toByteArray() } - fun formatPrettyUnicode(obj: Any): String - - fun formatPrettyUnicodeBytes(obj: Any): ByteArray { - return formatPrettyUnicode(obj)!!.toByteArray() - } - fun formatPretty(obj: Any, file: String) { formatPretty(obj, Paths.get(file)) } @@ -378,30 +371,8 @@ interface JsonApi { stream.write(formatPrettyBytes(obj)) } - fun formatPrettyUnicode(obj: Any, file: String) { - formatPrettyUnicode(obj, Paths.get(file)) - } - - fun formatPrettyUnicode(obj: Any, file: Path) { - formatPrettyUnicode(obj, file.toFile()) - } - - fun formatPrettyUnicode(obj: Any, file: File) { - FileOutputStream(file).use { fos -> - formatPrettyUnicode(obj, fos) - } - } - - fun formatPrettyUnicode(obj: Any, stream: OutputStream) { - stream.write(formatPrettyUnicodeBytes(obj)) - } - fun formatBytes(obj: Any): ByteArray { - return format(obj)!!.toByteArray() - } - - fun formatUnicodeBytes(obj: Any): ByteArray { - return formatUnicode(obj)!!.toByteArray() + return format(obj).toByteArray() } fun format(obj: Any, file: String) { @@ -422,23 +393,6 @@ interface JsonApi { stream.write(formatPrettyBytes(obj)) } - fun formatUnicode(obj: Any, file: String) { - formatUnicode(obj, Paths.get(file)) - } - - fun formatUnicode(obj: Any, file: Path) { - formatUnicode(obj, file.toFile()) - } - - fun formatUnicode(obj: Any, file: File) { - FileOutputStream(file).use { fos -> - formatUnicode(obj, fos) - } - } - - fun formatUnicode(obj: Any, stream: OutputStream) { - stream.write(formatPrettyUnicodeBytes(obj)) - } /** * 将JSON字符串解析为指定元素类型的List集合 @@ -463,7 +417,7 @@ interface JsonApi { * @return 解析后的Map集合 */ fun parseMap( - json: String, keyType: Class, valueType: Class + json: String, keyType: Class, valueType: Class, ): MutableMap { val mapType: JsonTypeReference> = object : JsonTypeReference>() {} return parse>(json, mapType) diff --git a/src/main/kotlin/com/mingliqiye/utils/json/api/type/TypeReference.kt b/src/main/kotlin/com/mingliqiye/utils/json/api/type/TypeReference.kt index f96b554..2bfa600 100644 --- a/src/main/kotlin/com/mingliqiye/utils/json/api/type/TypeReference.kt +++ b/src/main/kotlin/com/mingliqiye/utils/json/api/type/TypeReference.kt @@ -16,16 +16,16 @@ * ProjectName mingli-utils * ModuleName mingli-utils.main * CurrentFile TypeReference.kt - * LastUpdate 2026-02-04 21:00:48 + * LastUpdate 2026-02-26 14:11:35 * UpdateUser MingLiPro */ package com.mingliqiye.utils.json.api.type import com.mingliqiye.utils.string.join -import sun.reflect.generics.reflectiveObjects.WildcardTypeImpl import java.lang.reflect.ParameterizedType import java.lang.reflect.Type +import java.lang.reflect.WildcardType class TypeReference( val rawClass: Type, @@ -40,23 +40,37 @@ class TypeReference( override fun getOwnerType(): Type? = null - override fun toString(): String = "${getRawString(rawType)}<${ - ",".join(typeArguments, TypeReference::getRawString) + override fun toString(): String = "${getRawString(rawClass)}<${ + ",".join(typeArguments) { getRawString(it) } }>" companion object { - fun getRawString(s: Any): String { - if (s is Class<*>) { - return s.name + fun getRawString(type: Type): String { + return when (type) { + is Class<*> -> type.name + is WildcardType -> { + val upperBounds = type.upperBounds + val lowerBounds = type.lowerBounds + when { + upperBounds.isNotEmpty() && upperBounds[0] != Any::class.java -> { + "? extends ${getRawString(upperBounds[0])}" + } + + lowerBounds.isNotEmpty() -> { + "? super ${getRawString(lowerBounds[0])}" + } + + else -> "?" + } + } + + is ParameterizedType -> { + of(type).toString() + } + + else -> type.typeName } - if (s is WildcardTypeImpl) { - return getRawString(s.upperBounds[0]) - } - if (s is ParameterizedType) { - return of(s).toString() - } - return s.toString() } inline fun of(): TypeReference { @@ -64,13 +78,17 @@ class TypeReference( } fun of(type: Type): TypeReference { - if (type is Class<*>) { - return TypeReference(type) + return when (type) { + is Class<*> -> TypeReference(type) + is ParameterizedType -> TypeReference(type.rawType, *type.actualTypeArguments) + is WildcardType -> { + // 处理通配符类型,返回上界类型 + val upperBound = type.upperBounds.firstOrNull() ?: Any::class.java + TypeReference(upperBound) + } + + else -> throw IllegalStateException("无法获取类型: $type") } - if (type is ParameterizedType) { - return TypeReference(type.rawType, *type.actualTypeArguments) - } - throw IllegalStateException("无法获取类型: $type") } } } diff --git a/src/main/kotlin/com/mingliqiye/utils/json/converters/base/AnnotationGetter.kt b/src/main/kotlin/com/mingliqiye/utils/json/converters/base/AnnotationGetter.kt index 747c563..504d562 100644 --- a/src/main/kotlin/com/mingliqiye/utils/json/converters/base/AnnotationGetter.kt +++ b/src/main/kotlin/com/mingliqiye/utils/json/converters/base/AnnotationGetter.kt @@ -16,7 +16,7 @@ * ProjectName mingli-utils * ModuleName mingli-utils.main * CurrentFile AnnotationGetter.kt - * LastUpdate 2026-02-06 16:57:45 + * LastUpdate 2026-03-11 08:46:40 * UpdateUser MingLiPro */ @@ -73,6 +73,7 @@ interface AnnotationGetter { * @param clazz 目标注解类型的Class对象。 * @return 如果annotation的类型与clazz一致,则返回annotation转换为T类型的实例;否则返回null。 */ + @Suppress("UNCHECKED_CAST") override fun get(clazz: Class): T? = if (annotation.javaClass == clazz) annotation as T else null } diff --git a/src/main/kotlin/com/mingliqiye/utils/json/converters/base/BaseJsonConverter.kt b/src/main/kotlin/com/mingliqiye/utils/json/converters/base/BaseJsonConverter.kt index 0c92f26..5fc564a 100644 --- a/src/main/kotlin/com/mingliqiye/utils/json/converters/base/BaseJsonConverter.kt +++ b/src/main/kotlin/com/mingliqiye/utils/json/converters/base/BaseJsonConverter.kt @@ -16,7 +16,7 @@ * ProjectName mingli-utils * ModuleName mingli-utils.main * CurrentFile BaseJsonConverter.kt - * LastUpdate 2026-02-08 01:22:35 + * LastUpdate 2026-02-26 15:59:35 * UpdateUser MingLiPro */ @@ -31,4 +31,4 @@ package com.mingliqiye.utils.json.converters.base * @param F 源类型,表示需要被转换的数据类型。 * @param T 目标类型,表示转换后的数据类型。 */ -interface BaseJsonConverter : JackSonJsonConverter +interface BaseJsonConverter : JsonConverter diff --git a/src/main/kotlin/com/mingliqiye/utils/json/converters/base/JackJson3Deserializer.kt b/src/main/kotlin/com/mingliqiye/utils/json/converters/base/JackJson3Deserializer.kt new file mode 100644 index 0000000..955d926 --- /dev/null +++ b/src/main/kotlin/com/mingliqiye/utils/json/converters/base/JackJson3Deserializer.kt @@ -0,0 +1,62 @@ +/* + * Copyright 2026 mingliqiye + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ProjectName mingli-utils + * ModuleName mingli-utils.main + * CurrentFile JackJson3Deserializer.kt + * LastUpdate 2026-02-26 13:02:52 + * UpdateUser MingLiPro + */ + +package com.mingliqiye.utils.json.converters.base + +import tools.jackson.core.JsonParser +import tools.jackson.core.JsonToken +import tools.jackson.databind.BeanProperty +import tools.jackson.databind.DeserializationContext +import tools.jackson.databind.ValueDeserializer + + +class JackJson3Deserializer( + val property: BeanProperty? = null, + val jsonConverter: JsonConverter +) : ValueDeserializer() { + + override fun deserialize( + p: JsonParser, + ctxt: DeserializationContext? + ): F? { + if (p.currentToken() == JsonToken.VALUE_NULL) return null + return jsonConverter.deConvert(p.readValueAs(jsonConverter.getToClass()), object : AnnotationGetter { + override fun get(clazz: Class): T? = property?.getAnnotation(clazz) + }) + } + + /** + * 上下文感知方法:设置当前属性信息。 + * + * @param ctxt 反序列化上下文,可选参数。 + * @param property 当前属性信息。 + * @return 返回当前反序列化器实例。 + */ + override fun createContextual( + ctxt: DeserializationContext?, + property: BeanProperty? + ): JackJson3Deserializer { + return JackJson3Deserializer(property, jsonConverter) + } + + +} diff --git a/src/main/kotlin/com/mingliqiye/utils/json/converters/base/JackJson3Serializer.kt b/src/main/kotlin/com/mingliqiye/utils/json/converters/base/JackJson3Serializer.kt new file mode 100644 index 0000000..bbc969c --- /dev/null +++ b/src/main/kotlin/com/mingliqiye/utils/json/converters/base/JackJson3Serializer.kt @@ -0,0 +1,66 @@ +/* + * Copyright 2026 mingliqiye + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ProjectName mingli-utils + * ModuleName mingli-utils.main + * CurrentFile JackJson3Serializer.kt + * LastUpdate 2026-02-26 13:04:18 + * UpdateUser MingLiPro + */ + +package com.mingliqiye.utils.json.converters.base + +import tools.jackson.databind.BeanProperty +import tools.jackson.databind.SerializationContext +import tools.jackson.databind.ValueSerializer +import java.math.BigDecimal +import java.math.BigInteger + +class JackJson3Serializer( + val property: BeanProperty? = null, + val jsonConverter: JsonConverter +) : ValueSerializer() { + + /** + * 序列化方法:将源对象转换为目标对象,并根据目标对象的类型写入 JSON。 + * + * @param value 源对象,可能为 null。 + * @param gen JSON 生成器,用于写入 JSON 数据。 + * @param provider 序列化提供者,可选参数。 + */ + override fun serialize(value: F, gen: tools.jackson.core.JsonGenerator, ctxt: SerializationContext) { + val data: T? = jsonConverter.convert(value, object : AnnotationGetter { + override fun get(clazz: Class): T? = property?.getAnnotation(clazz) + }) + when (data) { + null -> gen.writeNull() + is String -> gen.writeString(data) + is Long -> gen.writeNumber(data) + is Short -> gen.writeNumber(data) + is Byte -> gen.writeNumber(data.toShort()) + is Int -> gen.writeNumber(data) + is BigDecimal -> gen.writeNumber(data) + is BigInteger -> gen.writeNumber(data) + is Float -> gen.writeNumber(data) + is Double -> gen.writeNumber(data) + is Boolean -> gen.writeBoolean(data) + else -> throw IllegalArgumentException("not sport data type ${data.javaClass} $data") + } + } + + override fun createContextual(ctxt: SerializationContext?, property: BeanProperty?): ValueSerializer<*> { + return JackJson3Serializer(property, jsonConverter) + } +} diff --git a/src/main/kotlin/com/mingliqiye/utils/json/converters/base/JackJsonSerializer.kt b/src/main/kotlin/com/mingliqiye/utils/json/converters/base/JackJsonSerializer.kt index a96d9c9..63c964c 100644 --- a/src/main/kotlin/com/mingliqiye/utils/json/converters/base/JackJsonSerializer.kt +++ b/src/main/kotlin/com/mingliqiye/utils/json/converters/base/JackJsonSerializer.kt @@ -16,7 +16,7 @@ * ProjectName mingli-utils * ModuleName mingli-utils.main * CurrentFile JackJsonSerializer.kt - * LastUpdate 2026-02-08 02:27:52 + * LastUpdate 2026-02-26 12:55:57 * UpdateUser MingLiPro */ diff --git a/src/main/kotlin/com/mingliqiye/utils/json/converters/base/JackSonJsonConverter.kt b/src/main/kotlin/com/mingliqiye/utils/json/converters/base/JackSonJsonConverter.kt deleted file mode 100644 index 7214231..0000000 --- a/src/main/kotlin/com/mingliqiye/utils/json/converters/base/JackSonJsonConverter.kt +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2026 mingliqiye - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ProjectName mingli-utils - * ModuleName mingli-utils.main - * CurrentFile JackSonJsonConverter.kt - * LastUpdate 2026-02-08 02:28:49 - * UpdateUser MingLiPro - */ - -package com.mingliqiye.utils.json.converters.base - -import com.fasterxml.jackson.databind.ObjectMapper -import com.fasterxml.jackson.databind.module.SimpleModule - -interface JackSonJsonConverter : JsonConverter { - - companion object { - /** - * 扩展ObjectMapper,用于注册指定类型的模块。 - * - * 此函数通过反射创建指定类型的实例,并调用其getJacksonModule方法来获取Jackson模块, - * 然后将该模块注册到当前ObjectMapper实例中。 - * - * @param T 必须继承自BaseJsonConverter的泛型类型。 - * @return 返回注册了模块后的ObjectMapper实例。 - */ - inline fun > ObjectMapper.addJsonConverter(): ObjectMapper = - this.registerModule(getJsonConverter().getJacksonModule()) - - @JvmStatic - fun > ObjectMapper.addJsonConverter(clazz: Class): ObjectMapper = - this.registerModule(getJsonConverter(clazz).getJacksonModule()) - } - - /** - * 创建并返回一个 Jackson 模块,该模块包含自定义的序列化器和反序列化器。 - * - * @return 配置了自定义序列化器和反序列化器的 SimpleModule 对象。 - */ - fun getJacksonModule(): SimpleModule = - SimpleModule("${getFromClass().name}To${getToClass().name}") - .addSerializer(getFromClass(), JackJsonSerializer(null, this)) - .addDeserializer(getFromClass(), JackJsonDeserializer(null, this)) -} diff --git a/src/main/kotlin/com/mingliqiye/utils/json/converters/base/JsonConverterUtils.kt b/src/main/kotlin/com/mingliqiye/utils/json/converters/base/JsonConverterUtils.kt index 9ea6890..77aa00b 100644 --- a/src/main/kotlin/com/mingliqiye/utils/json/converters/base/JsonConverterUtils.kt +++ b/src/main/kotlin/com/mingliqiye/utils/json/converters/base/JsonConverterUtils.kt @@ -16,7 +16,7 @@ * ProjectName mingli-utils * ModuleName mingli-utils.main * CurrentFile JsonConverterUtils.kt - * LastUpdate 2026-02-07 22:33:09 + * LastUpdate 2026-02-26 16:01:49 * UpdateUser MingLiPro */ @file:JvmName("JsonConverterUtils") @@ -49,6 +49,7 @@ fun getClass(type: Type?): Class<*>? { inline fun > getJsonConverter(): T = getJsonConverter(T::class.java) +@Suppress("UNCHECKED_CAST") fun > getJsonConverter(clazz: Class): T { try { return clazz.getDeclaredMethod( @@ -59,3 +60,25 @@ fun > getJsonConverter(clazz: Class): T { throw e } } + +fun > com.fasterxml.jackson.databind.ObjectMapper.addJsonConverter(clazz: Class): com.fasterxml.jackson.databind.ObjectMapper = + this.registerModule(getJsonConverter(clazz).getJacksonModule()) + +@JvmName("inline_addJsonConverter") +inline fun > com.fasterxml.jackson.databind.ObjectMapper.addJsonConverter(): com.fasterxml.jackson.databind.ObjectMapper = + this.registerModule(getJsonConverter(T::class.java).getJacksonModule()) + +/** + * 创建并返回一个 Jackson 模块,该模块包含自定义的序列化器和反序列化器。 + * + * @return 配置了自定义序列化器和反序列化器的 SimpleModule 对象。 + */ +fun JsonConverter.getJacksonModule(): com.fasterxml.jackson.databind.module.SimpleModule = + com.fasterxml.jackson.databind.module.SimpleModule("${getFromClass().name}To${getToClass().name}") + .addSerializer(getFromClass(), JackJsonSerializer(null, this)) + .addDeserializer(getFromClass(), JackJsonDeserializer(null, this)) + +fun JsonConverter.getJackson3Module(): tools.jackson.databind.module.SimpleModule = + tools.jackson.databind.module.SimpleModule("${getFromClass().name}To${getToClass().name}") + .addSerializer(getFromClass(), JackJson3Serializer(null, this)) + .addDeserializer(getFromClass(), JackJson3Deserializer(null, this)) diff --git a/src/main/kotlin/com/mingliqiye/utils/map/Maps.kt b/src/main/kotlin/com/mingliqiye/utils/map/Maps.kt index 146565a..ac6b737 100644 --- a/src/main/kotlin/com/mingliqiye/utils/map/Maps.kt +++ b/src/main/kotlin/com/mingliqiye/utils/map/Maps.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025 mingliqiye + * Copyright 2026 mingliqiye * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ * ProjectName mingli-utils * ModuleName mingli-utils.main * CurrentFile Maps.kt - * LastUpdate 2025-09-15 08:33:24 + * LastUpdate 2026-03-11 08:46:40 * UpdateUser MingLiPro */ @@ -40,6 +40,10 @@ fun newHashMap(size: Int): HashMap { return HashMap(size) } +fun newHashMap(): HashMap { + return HashMap() +} + fun newHashMap(vararg elements: Map.Entry): HashMap { val map = HashMap() for (element in elements) { diff --git a/src/main/kotlin/com/mingliqiye/utils/metadata/MetaData.kt b/src/main/kotlin/com/mingliqiye/utils/metadata/MetaData.kt index 23b5c8a..fe36a01 100644 --- a/src/main/kotlin/com/mingliqiye/utils/metadata/MetaData.kt +++ b/src/main/kotlin/com/mingliqiye/utils/metadata/MetaData.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025 mingliqiye + * Copyright 2026 mingliqiye * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ * ProjectName mingli-utils * ModuleName mingli-utils.main * CurrentFile MetaData.kt - * LastUpdate 2025-09-20 10:45:43 + * LastUpdate 2026-03-11 08:46:40 * UpdateUser MingLiPro */ @file:JvmName("MetaData") @@ -40,16 +40,6 @@ fun getMetaData(): Map { }.filter { it != null }.collect(toMap({ it!!.first }, { it!!.second })) } -class MingliUtilsMetaData { - var buildTime: String = "" - var groupId: String = "" - var artifactId: String = "" - var version: String = "" - var buildJdkVersion: String = "" - var author: String = "" - var website: String = "" -} - val mingliUtilsMetaData: MingliUtilsMetaData by lazy { val metaData = getMetaData() MingliUtilsMetaData().apply { diff --git a/src/main/kotlin/com/mingliqiye/utils/metadata/MingliUtilsMetaData.kt b/src/main/kotlin/com/mingliqiye/utils/metadata/MingliUtilsMetaData.kt new file mode 100644 index 0000000..d63ba01 --- /dev/null +++ b/src/main/kotlin/com/mingliqiye/utils/metadata/MingliUtilsMetaData.kt @@ -0,0 +1,33 @@ +/* + * Copyright 2026 mingliqiye + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ProjectName mingli-utils + * ModuleName mingli-utils.main + * CurrentFile MingliUtilsMetaData.kt + * LastUpdate 2026-03-11 08:46:40 + * UpdateUser MingLiPro + */ + +package com.mingliqiye.utils.metadata + +class MingliUtilsMetaData { + var buildTime: String = "" + var groupId: String = "" + var artifactId: String = "" + var version: String = "" + var buildJdkVersion: String = "" + var author: String = "" + var website: String = "" +} diff --git a/src/main/kotlin/com/mingliqiye/utils/reflect/kotlin/KotlinReflect.kt b/src/main/kotlin/com/mingliqiye/utils/reflect/kotlin/KotlinReflect.kt new file mode 100644 index 0000000..d367614 --- /dev/null +++ b/src/main/kotlin/com/mingliqiye/utils/reflect/kotlin/KotlinReflect.kt @@ -0,0 +1,263 @@ +/* + * Copyright 2026 mingliqiye + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ProjectName mingli-utils + * ModuleName mingli-utils.main + * CurrentFile KotlinReflect.kt + * LastUpdate 2026-03-11 08:16:32 + * UpdateUser MingLiPro + */ + +@file:JvmName("KotlinReflect") + +package com.mingliqiye.utils.reflect.kotlin + +import kotlin.reflect.KClass +import kotlin.reflect.KFunction +import kotlin.reflect.KType +import kotlin.reflect.full.* +import kotlin.reflect.jvm.isAccessible + +/** + * 获取实例的 KClass + */ +inline fun T.kClass(): KClass = T::class + +/** + * 获取实例的 Java Class + */ +inline fun T.kClassJava(): Class = T::class.java + +/** + * 创建实例(通过无参构造函数) + */ +inline fun createInstance(): T = T::class.createInstance() + +/** + * 创建实例(通过主构造函数,提供参数) + */ +inline fun createInstance(vararg args: Any?): T? { + val kClass = T::class + val constructor = kClass.primaryConstructor + return constructor?.let { + it.isAccessible = true + it.call(*args) + } +} + +/** + * 获取所有父类(包括接口) + */ +inline fun T.superClasses(): Collection> = T::class.allSuperclasses + +/** + * 判断是否是某个类的子类 + */ +inline fun T.isSubclassOf(): Boolean = T::class.isSubclassOf(S::class) + +/** + * 获取伴生对象实例 + */ +inline fun T.companion(): Any? = T::class.companionObject?.objectInstance + +/** + * 获取对象的所有属性名 + */ +inline fun T.propertyNames(): List = T::class.memberProperties.map { it.name } + +/** + * 获取属性值 + */ +inline fun T.getPropertyValue(name: String): Any? { + val property = T::class.memberProperties.find { it.name == name } + return if (property != null) { + property.isAccessible = true + property.get(this) + } else null +} + +/** + * 设置属性值(仅适用于 var 属性) + */ +inline fun T.setPropertyValue(name: String, value: Any?): Boolean { + val property = T::class.memberProperties.find { it.name == name } + return if (property is kotlin.reflect.KMutableProperty<*>) { + property.isAccessible = true + property.setter.call(this, value) + true + } else false +} + +/** + * 批量获取属性值 + */ +inline fun T.getPropertyValues(vararg names: String): Map { + val properties = T::class.memberProperties + return names.associateWith { name -> + properties.find { it.name == name }?.let { + it.isAccessible = true + it.get(this) + } + } +} + +/** + * 获取所有属性及其值 + */ +inline fun T.getAllPropertyValues(): Map { + return T::class.memberProperties.associate { prop -> + prop.isAccessible = true + prop.name to prop.get(this) + } +} + +/** + * 调用对象的方法 + */ +inline fun T.callMethod(name: String, vararg args: Any?): Any? { + val function = T::class.functions.find { it.name == name } + return function?.let { + it.isAccessible = true + it.call(this, *args) + } +} + +/** + * 调用静态方法(通过伴生对象) + */ +inline fun T.callStaticMethod(name: String, vararg args: Any?): Any? { + val companion = T::class.companionObject?.objectInstance + val function = companion?.let { + it::class.functions.find { func -> func.name == name } + } + return function?.let { + it.isAccessible = true + it.call(companion, *args) + } +} + +/** + * 获取所有方法名 + */ +inline fun T.methodNames(): List = T::class.functions.map { it.name } + +/** + * 检查类是否有特定注解 + */ +inline fun T.hasAnnotation(): Boolean = T::class.hasAnnotation() + +/** + * 获取所有带有特定注解的属性 + */ +inline fun T.propertiesWithAnnotation(): List { + return T::class.memberProperties.filter { it.hasAnnotation() }.map { it.name } +} + +/** + * 获取所有带有特定注解的方法 + */ +inline fun T.methodsWithAnnotation(): List { + return T::class.functions.filter { it.hasAnnotation() }.map { it.name } +} + +/** + * 获取泛型类型参数 + */ +inline fun T.genericType(): KType = T::class.starProjectedType + +/** + * 检查类型是否匹配 + */ +inline fun T.isInstanceOf(instance: Any): Boolean = T::class.isInstance(instance) + +// ==================== Java 互操作 ==================== + +/** + * 获取对应的 Java 方法 + */ +inline fun T.getJavaMethod(name: String, vararg paramTypes: Class<*>): java.lang.reflect.Method? { + return T::class.java.getDeclaredMethod(name, *paramTypes).apply { + isAccessible = true + } +} + +/** + * 获取对应的 Java 字段 + */ +inline fun T.getJavaField(name: String): java.lang.reflect.Field? { + return T::class.java.getDeclaredField(name).apply { + isAccessible = true + } +} + +/** + * 调用 Java 方法 + */ +inline fun T.callJavaMethod(name: String, vararg args: Any?): Any? { + val method = T::class.java.methods.find { it.name == name } + return method?.let { + it.isAccessible = true + it.invoke(this, *args) + } +} + +/** + * 获取所有构造函数 + */ +inline fun T.constructors(): List> = T::class.constructors.toList() + +/** + * 通过构造函数索引创建实例 + */ +inline fun createInstanceByIndex(index: Int, vararg args: Any?): T? { + val constructors = T::class.constructors.toList() + return if (index < constructors.size) { + constructors[index].apply { isAccessible = true }.call(*args) + } else null +} + +/** + * 比较两个对象的属性值 + */ +inline fun T.compareWith(other: T, vararg properties: String): Map> { + val result = mutableMapOf>() + val props = T::class.memberProperties.associateBy { it.name } + + properties.forEach { propName -> + props[propName]?.let { prop -> + prop.isAccessible = true + result[propName] = Pair(prop.get(this), prop.get(other)) + } + } + return result +} + +/** + * 获取单例对象实例(适用于 object 声明) + */ +inline fun getSingletonInstance(): T? { + return (T::class.objectInstance as? T) +} + +/** + * 检查是否是单例对象 + */ +inline fun T.isSingleton(): Boolean = T::class.objectInstance != null + +/** + * 获取类的所有扩展函数 + */ +inline fun T.extensionFunctions(): Collection> = + T::class.declaredMemberExtensionFunctions diff --git a/src/main/kotlin/com/mingliqiye/utils/require/Require.kt b/src/main/kotlin/com/mingliqiye/utils/require/Require.kt index 0533a05..bad6eaa 100644 --- a/src/main/kotlin/com/mingliqiye/utils/require/Require.kt +++ b/src/main/kotlin/com/mingliqiye/utils/require/Require.kt @@ -16,160 +16,182 @@ * ProjectName mingli-utils * ModuleName mingli-utils.main * CurrentFile Require.kt - * LastUpdate 2026-02-06 08:27:44 + * LastUpdate 2026-02-24 09:03:42 * UpdateUser MingLiPro */ package com.mingliqiye.utils.require -import com.mingliqiye.utils.exception.InternalServerErrorException import com.mingliqiye.utils.logger.MingLiLoggerFactory import org.slf4j.Logger import java.lang.reflect.Constructor import kotlin.contracts.ExperimentalContracts import kotlin.contracts.contract +import kotlin.reflect.KClass /** - * 工具对象,用于提供条件检查功能。 - * 支持抛出自定义异常、延迟消息构造以及日志记录等功能。 + * 条件检查工具对象,提供多种重载的require方法用于参数验证和异常抛出 + * 支持自定义异常类型、延迟消息构造和日志记录功能 */ -class Require(val defaultException: Class) { +object Require { + @JvmStatic + var logger: Logger? = MingLiLoggerFactory.getLogger() - companion object { - @JvmStatic - val RequireLayz by lazy { - Require(IllegalArgumentException::class.java) + @JvmStatic + var isLogError = true + + /** + * 检查条件是否满足,如果不满足则抛出指定类型的异常 + * @param value 要检查的布尔条件 + * @param throwable 异常类型Class对象 + * @param layzMessage 延迟消息构造器 + */ + @JvmStatic + @OptIn(ExperimentalContracts::class) + fun require(value: Boolean, throwable: Class, layzMessage: RequireLayzMessageConstructor) { + contract { + returns() implies value } - - @JvmStatic - val RequireHttpLayz by lazy { - Require(InternalServerErrorException::class.java) - } - - @JvmStatic - var logger: Logger? = MingLiLoggerFactory.getLogger() - - @JvmStatic - var isLogError = true - - /** - * 检查给定条件是否为真。如果为假,则使用延迟消息构造器生成异常并抛出。 - * - * @param value 需要检查的布尔值。 - * @param throwable 异常类型。 - * @param layzMessage 延迟消息构造器。 - */ - @OptIn(ExperimentalContracts::class) - fun require(value: Boolean, throwable: Class, layzMessage: RequireLayzMessageConstructor) { - contract { - returns() implies value - } - require(value, layzMessage.call(), throwable) - } - - /** - * 检查给定条件是否为真。如果为假,则使用延迟异常构造器生成异常并抛出。 - * - * @param value 需要检查的布尔值。 - * @param layzThrowable 延迟异常构造器。 - */ - @JvmStatic - @OptIn(ExperimentalContracts::class) - fun require(value: Boolean, layzThrowable: RequireLayzExceptionConstructor) { - contract { - returns() implies value - } - if (!value) throwThrowable(layzThrowable.call()) - } - - /** - * 检查给定条件是否为真。如果为假,则根据指定的异常类型和消息生成异常并抛出。 - * - * @param value 需要检查的布尔值。 - * @param message 异常消息。 - * @param throwable 异常类型。 - */ - @JvmStatic - @OptIn(ExperimentalContracts::class) - fun require(value: Boolean, message: String, throwable: Class) { - contract { - returns() implies value - } - if (!value) throwThrowable(getExceptionConstructor(throwable).newInstance(message)) - } - - /** - * 抛出指定的异常,并在启用日志记录时记录错误信息。 - * - * @param throwable 需要抛出的异常。 - */ - @JvmStatic - fun throwThrowable(throwable: Throwable) { - if (isLogError && logger != null) logger!!.error(throwable.message, throwable) - throw throwable - } - - /** - * 检查给定条件是否为真。如果为假,则根据指定的异常类型抛出异常。 - * - * @param value 需要检查的布尔值。 - * @param message 异常消息。 - * @param T 异常类型。 - */ - @OptIn(ExperimentalContracts::class) - @JvmName("__inline_Require") - inline fun require(value: Boolean, message: String) { - contract { - returns() implies value - } - require(value, message, T::class.java) - } - - /** - * 检查给定条件是否为真。如果为假,则根据指定的异常类型和延迟消息构造器生成异常并抛出。 - * - * @param value 需要检查的布尔值。 - * @param layzMessage 延迟消息构造器。 - * @param T 异常类型。 - */ - @OptIn(ExperimentalContracts::class) - @JvmName("__inline_Require") - inline fun require(value: Boolean, layzMessage: RequireLayzMessageConstructor) { - contract { - returns() implies value - } - if (!value) throwThrowable(getExceptionConstructor().newInstance(layzMessage.call())) - } - - /** - * 获取指定异常类型的构造函数(带字符串参数)。 - * - * @param T 异常类型。 - * @return 异常类型的构造函数。 - */ - @JvmName("__inline_GetExceptionConstructor") - inline fun getExceptionConstructor(): Constructor = - getExceptionConstructor(T::class.java) - - /** - * 获取指定异常类型的构造函数(带字符串参数)。 - * - * @param throwable 异常类型。 - * @return 异常类型的构造函数。 - */ - - @JvmStatic - @JvmName("__GetExceptionConstructor") - fun getExceptionConstructor(throwable: Class): Constructor = - throwable.getConstructor(String::class.java) + require(value, layzMessage.call(), throwable) } /** - * 检查给定条件是否为真。如果为假,则抛出 [IllegalArgumentException] 异常。 - * - * @param value 需要检查的布尔值。 + * 检查条件是否满足,如果不满足则抛出指定类型的异常 + * @param value 要检查的布尔条件 + * @param throwable 异常类型KClass对象 + * @param layzMessage 延迟消息构造器 + */ + @JvmStatic + @OptIn(ExperimentalContracts::class) + fun require(value: Boolean, throwable: KClass, layzMessage: RequireLayzMessageConstructor) { + contract { + returns() implies value + } + require(value, throwable.java, layzMessage) + } + + /** + * 检查条件是否满足,如果不满足则抛出延迟构造的异常 + * @param value 要检查的布尔条件 + * @param layzThrowable 延迟异常构造器 + */ + @JvmStatic + @OptIn(ExperimentalContracts::class) + fun require(value: Boolean, layzThrowable: RequireLayzExceptionConstructor) { + contract { + returns() implies value + } + if (!value) throwThrowable(layzThrowable.call()) + } + + /** + * 检查条件是否满足,如果不满足则抛出指定消息和类型的异常 + * @param value 要检查的布尔条件 + * @param message 异常消息 + * @param throwable 异常类型Class对象 + */ + @JvmStatic + @OptIn(ExperimentalContracts::class) + fun require(value: Boolean, message: String, throwable: Class) { + contract { + returns() implies value + } + if (!value) throwThrowable(getExceptionConstructor(throwable).newInstance(message)) + } + + /** + * 检查条件是否满足,如果不满足则抛出指定消息和类型的异常 + * @param value 要检查的布尔条件 + * @param message 异常消息 + * @param throwable 异常类型KClass对象 + */ + @JvmStatic + @OptIn(ExperimentalContracts::class) + fun require(value: Boolean, message: String, throwable: KClass) { + contract { + returns() implies value + } + require(value, message, throwable.java) + } + + /** + * 抛出异常并在启用日志时记录错误信息 + * @param throwable 要抛出的异常对象 + */ + @JvmStatic + fun throwThrowable(throwable: Throwable) { + if (isLogError && logger != null) logger!!.error(throwable.message, throwable) + throw throwable + } + + /** + * 内联函数版本的条件检查,支持泛型异常类型 + * @param T 异常类型 + * @param value 要检查的布尔条件 + * @param message 异常消息 */ @OptIn(ExperimentalContracts::class) + @JvmName("__inline_Require") + @JvmStatic + inline fun require(value: Boolean, message: String) { + contract { + returns() implies value + } + require(value, message, T::class.java) + } + + /** + * 内联函数版本的条件检查,支持泛型异常类型和延迟消息构造 + * @param T 异常类型 + * @param value 要检查的布尔条件 + * @param layzMessage 延迟消息构造器 + */ + @OptIn(ExperimentalContracts::class) + @JvmName("__inline_Require") + @JvmStatic + inline fun require(value: Boolean, layzMessage: RequireLayzMessageConstructor) { + contract { + returns() implies value + } + if (!value) throwThrowable(getExceptionConstructor().newInstance(layzMessage.call())) + } + + /** + * 获取指定异常类型的构造函数(内联泛型版本) + * @param T 异常类型 + * @return 异常类型的构造函数 + */ + @JvmName("__inline_GetExceptionConstructor") + @JvmStatic + inline fun getExceptionConstructor(): Constructor = + getExceptionConstructor(T::class.java) + + /** + * 获取指定异常类型的构造函数 + * @param throwable 异常类型Class对象 + * @return 异常类型的构造函数 + */ + @JvmStatic + @JvmName("__GetExceptionConstructor") + fun getExceptionConstructor(throwable: Class): Constructor = + throwable.getConstructor(String::class.java) + + /** + * 获取指定异常类型的构造函数 + * @param throwable 异常类型KClass对象 + * @return 异常类型的构造函数 + */ + @JvmStatic + @JvmName("__GetExceptionConstructor") + fun getExceptionConstructor(throwable: KClass): Constructor = + getExceptionConstructor(throwable.java) + + /** + * 基础条件检查方法,不满足条件时抛出IllegalArgumentException + * @param value 要检查的布尔条件 + */ + @OptIn(ExperimentalContracts::class) + @JvmStatic fun require(value: Boolean) { contract { returns() implies value @@ -178,30 +200,30 @@ class Require(val defaultException: Class) { } /** - * 检查给定条件是否为真。如果为假,则使用延迟消息构造器生成 [IllegalArgumentException] 并抛出。 - * - * @param value 需要检查的布尔值。 - * @param layzMessage 延迟消息构造器。 + * 使用延迟消息构造器进行条件检查,不满足时抛出IllegalArgumentException + * @param value 要检查的布尔条件 + * @param layzMessage 延迟消息构造器 */ @OptIn(ExperimentalContracts::class) + @JvmStatic fun requireLayzMessage(value: Boolean, layzMessage: RequireLayzMessageConstructor) { contract { returns() implies value } - require(value, defaultException, layzMessage) + require(value, IllegalArgumentException::class.java, layzMessage) } /** - * 检查给定条件是否为真。如果为假,则抛出 [IllegalArgumentException] 异常。 - * - * @param value 需要检查的布尔值。 - * @param message 异常消息。 + * 带消息的条件检查方法,不满足条件时抛出IllegalArgumentException + * @param value 要检查的布尔条件 + * @param message 异常消息 */ @OptIn(ExperimentalContracts::class) + @JvmStatic fun require(value: Boolean, message: String) { contract { returns() implies value } - if (!value) throwThrowable(getExceptionConstructor(defaultException).newInstance(message)) + if (!value) throwThrowable(getExceptionConstructor(IllegalArgumentException::class.java).newInstance(message)) } } diff --git a/src/main/kotlin/com/mingliqiye/utils/springboot/annotation/ApplicationDestroyedRunner.kt b/src/main/kotlin/com/mingliqiye/utils/springboot/annotation/ApplicationDestroyedRunner.kt new file mode 100644 index 0000000..7b90037 --- /dev/null +++ b/src/main/kotlin/com/mingliqiye/utils/springboot/annotation/ApplicationDestroyedRunner.kt @@ -0,0 +1,28 @@ +/* + * Copyright 2026 mingliqiye + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ProjectName mingli-utils + * ModuleName mingli-utils.main + * CurrentFile ApplicationDestroyedRunner.kt + * LastUpdate 2026-03-10 09:04:02 + * UpdateUser MingLiPro + */ + +package com.mingliqiye.utils.springboot.annotation + +@Target(AnnotationTarget.FUNCTION) +annotation class ApplicationDestroyedRunner( + val order: Int = Int.MIN_VALUE +) diff --git a/src/main/kotlin/com/mingliqiye/utils/springboot/annotation/ApplicationStartedRunner.kt b/src/main/kotlin/com/mingliqiye/utils/springboot/annotation/ApplicationStartedRunner.kt new file mode 100644 index 0000000..991a2f5 --- /dev/null +++ b/src/main/kotlin/com/mingliqiye/utils/springboot/annotation/ApplicationStartedRunner.kt @@ -0,0 +1,28 @@ +/* + * Copyright 2026 mingliqiye + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ProjectName mingli-utils + * ModuleName mingli-utils.main + * CurrentFile ApplicationStartedRunner.kt + * LastUpdate 2026-03-11 08:46:40 + * UpdateUser MingLiPro + */ + +package com.mingliqiye.utils.springboot.annotation + +@Target(AnnotationTarget.FUNCTION) +annotation class ApplicationStartedRunner( + val order: Int = Int.MIN_VALUE, +) diff --git a/src/main/kotlin/com/mingliqiye/utils/springboot/annotation/Listener.kt b/src/main/kotlin/com/mingliqiye/utils/springboot/annotation/Listener.kt new file mode 100644 index 0000000..1d06c02 --- /dev/null +++ b/src/main/kotlin/com/mingliqiye/utils/springboot/annotation/Listener.kt @@ -0,0 +1,32 @@ +/* + * Copyright 2026 mingliqiye + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ProjectName mingli-utils + * ModuleName mingli-utils.main + * CurrentFile Listener.kt + * LastUpdate 2026-03-10 09:04:02 + * UpdateUser MingLiPro + */ + +package com.mingliqiye.utils.springboot.annotation + +import org.springframework.core.annotation.AliasFor +import org.springframework.stereotype.Component + +@Component +annotation class Listener( + @get:AliasFor(annotation = Component::class) + val value: String = "" +) diff --git a/src/main/kotlin/com/mingliqiye/utils/springboot/autoconfigure/AutoConfiguration.kt b/src/main/kotlin/com/mingliqiye/utils/springboot/autoconfigure/AutoConfiguration.kt index 646bb14..9e26b16 100644 --- a/src/main/kotlin/com/mingliqiye/utils/springboot/autoconfigure/AutoConfiguration.kt +++ b/src/main/kotlin/com/mingliqiye/utils/springboot/autoconfigure/AutoConfiguration.kt @@ -16,116 +16,27 @@ * ProjectName mingli-utils * ModuleName mingli-utils.main * CurrentFile AutoConfiguration.kt - * LastUpdate 2026-02-06 15:15:46 + * LastUpdate 2026-03-10 09:04:30 * UpdateUser MingLiPro */ package com.mingliqiye.utils.springboot.autoconfigure -import com.mingliqiye.utils.i18n.I18N -import com.mingliqiye.utils.i18n.I18N.infoTranslater -import com.mingliqiye.utils.logger.MingLiLoggerFactory -import com.mingliqiye.utils.system.computerName -import com.mingliqiye.utils.system.getPid -import com.mingliqiye.utils.system.jdkVersion -import com.mingliqiye.utils.system.userName -import com.mingliqiye.utils.time.DateTime -import com.mingliqiye.utils.time.Formatter +import org.springframework.boot.autoconfigure.AutoConfiguration import org.springframework.context.annotation.ComponentScan -import java.io.IOException /** * 自动配置类,用于Spring Boot应用启动时加载相关组件和打印启动横幅。 * * 该类通过@ComponentScan注解扫描指定包下的Bean,并在初始化时打印包含系统信息的启动横幅。 */ -@org.springframework.boot.autoconfigure.AutoConfiguration +@AutoConfiguration @ComponentScan( "com.mingliqiye.utils.springboot.bean", - "com.mingliqiye.utils.springboot.converters" + "com.mingliqiye.utils.springboot.converters", + "com.mingliqiye.utils.springboot.listener", ) open class AutoConfiguration { - private val log = MingLiLoggerFactory.getLogger("MingliUtils-AutoConfiguration") - - companion object { - /** - * 启动横幅字符串,包含艺术字体和占位符。 - */ - private const val BANNER = - " | $$\\ $$\\ $$\\ $$\\ $$\\ $$$$$$$$\\ $$$$$$\\ \n" + - "| $$$\\ $$$ |$$ | $$ | $$ |\\__$$ __|$$ __$$\\ \n" + - "| $$$$\\ $$$$ |$$ | $$ | $$ | $$ | $$ / \\__| \n" + - "| $$\\$$\\$$ $$ |$$ | $$ | $$ | $$ | \\$$$$$$\\ \n" + - "| $$ \\$$$ $$ |$$ | $$ | $$ | $$ | \\____$$\\ \n" + - "| $$ |\\$ /$$ |$$ | $$ | $$ | $$ | $$\\ $$ | \n" + - "| $$ | \\_/ $$ |$$$$$$$$\\\\$$$$$$ | $$ | \\$$$$$$ \n" + - "| \\__| \\__|\\________|\\______/ \\__| \\______/ \n|\n" - - /** - * 打印启动横幅,包含系统元数据(如JDK版本、进程ID、计算机名等)。 - * - * 该方法从资源文件中读取元数据,并将其格式化后追加到横幅中进行输出。 - * 如果读取资源失败,则仅打印默认横幅。 - */ - fun printBanner() { - val bannerBuilder = StringBuilder(BANNER) - - // 尝试从资源文件中读取元数据并拼接到横幅中 - try { - val inputStream = AutoConfiguration::class.java.getResourceAsStream("/META-INF/meta-data") ?: return - inputStream.use { stream -> - var readlen: Int - val buffer = ByteArray(1024) - val metaData = StringBuilder() - - // 逐块读取资源文件内容 - while (stream.read(buffer).also { readlen = it } != -1) { - metaData.append(String(buffer, 0, readlen)) - } - - // 解析元数据并添加额外的系统信息 - val da = metaData.toString().split("\n").toMutableList() - da.add("${I18N.getString("com.mingliqiye.utils.springboot.autoconfigure.AutoConfiguration.jdkRuntime")}=$jdkVersion") - da.add("${I18N.getString("com.mingliqiye.utils.springboot.autoconfigure.AutoConfiguration.pid")}=$getPid") - da.add("${I18N.getString("com.mingliqiye.utils.springboot.autoconfigure.AutoConfiguration.computerName")}=$computerName") - da.add("${I18N.getString("com.mingliqiye.utils.springboot.autoconfigure.AutoConfiguration.userName")}=$userName") - da.add( - "${I18N.getString("com.mingliqiye.utils.springboot.autoconfigure.AutoConfiguration.time")}=" + DateTime.now() - .format(Formatter.STANDARD_DATETIME_MILLISECOUND7, false) - ) - - // 格式化每条元数据并追加到横幅中 - da.forEach { s: String -> - val d = s.trim { it <= ' ' }.split("=".toRegex(), 2).toTypedArray() - if (d.size >= 2) { - val content = "| -> " + I18N.getString(d[0]) + ": " + d[1] - val targetLength = 56 - if (content.length < targetLength) { - bannerBuilder.append( - String.format( - "%-${targetLength}s\n", - content - ) - ) - } else { - bannerBuilder - .append(content, 0, targetLength) - .append("|\n") - } - } - } - } - } catch (e: IOException) { - // 捕获IO异常并打印堆栈跟踪 - e.printStackTrace() - } - - // 输出最终构建的横幅 - println("") - println(bannerBuilder.toString().trim()) - println("") - } - } /** * 初始化块,在类实例化时执行。 @@ -133,7 +44,6 @@ open class AutoConfiguration { * 调用printBanner方法打印启动横幅,并记录日志表示自动配置成功。 */ init { - printBanner() - log.infoTranslater("com.mingliqiye.utils.springboot.autoconfigure.AutoConfiguration.bean") + com.mingliqiye.utils.main.Main.printb() } } diff --git a/src/main/kotlin/com/mingliqiye/utils/springboot/autoconfigure/Jackson3AutoConfiguration.kt b/src/main/kotlin/com/mingliqiye/utils/springboot/autoconfigure/Jackson3AutoConfiguration.kt new file mode 100644 index 0000000..56bb856 --- /dev/null +++ b/src/main/kotlin/com/mingliqiye/utils/springboot/autoconfigure/Jackson3AutoConfiguration.kt @@ -0,0 +1,50 @@ +/* + * Copyright 2026 mingliqiye + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ProjectName mingli-utils + * ModuleName mingli-utils.main + * CurrentFile Jackson3AutoConfiguration.kt + * LastUpdate 2026-03-11 08:46:40 + * UpdateUser MingLiPro + */ + +package com.mingliqiye.utils.springboot.autoconfigure; + +import com.mingliqiye.utils.json.converters.DateTimeJsonConverter +import com.mingliqiye.utils.json.converters.UUIDJsonConverter +import com.mingliqiye.utils.json.converters.base.getJackson3Module +import com.mingliqiye.utils.logger.MingLiLoggerFactory +import org.springframework.boot.autoconfigure.AutoConfigureAfter +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass +import org.springframework.boot.jackson.autoconfigure.JsonMapperBuilderCustomizer +import org.springframework.context.annotation.Bean + +@ConditionalOnClass(name = ["tools.jackson.databind.json.JsonMapper", "org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration"]) +@AutoConfigureAfter(name = ["org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration"]) +open class Jackson3AutoConfiguration { + + private val logger = MingLiLoggerFactory.getLogger() + + @Bean + open fun myJsonMapperCustomizer(): JsonMapperBuilderCustomizer { + return JsonMapperBuilderCustomizer { builder -> + builder + .addModule(UUIDJsonConverter.getJsonConverter().getJackson3Module()) + .addModule(DateTimeJsonConverter.getJsonConverter().getJackson3Module()) + }.also { + logger.info("MingliUtils Jackson3 Serializers created") + } + } +} diff --git a/src/main/kotlin/com/mingliqiye/utils/springboot/autoconfigure/Jackson3JsonApiAutoConfiguration.kt b/src/main/kotlin/com/mingliqiye/utils/springboot/autoconfigure/Jackson3JsonApiAutoConfiguration.kt new file mode 100644 index 0000000..5b66610 --- /dev/null +++ b/src/main/kotlin/com/mingliqiye/utils/springboot/autoconfigure/Jackson3JsonApiAutoConfiguration.kt @@ -0,0 +1,58 @@ +/* + * Copyright 2026 mingliqiye + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ProjectName mingli-utils + * ModuleName mingli-utils.main + * CurrentFile Jackson3JsonApiAutoConfiguration.kt + * LastUpdate 2026-02-26 14:24:33 + * UpdateUser MingLiPro + */ + +package com.mingliqiye.utils.springboot.autoconfigure + +import com.mingliqiye.utils.exception.JsonException +import com.mingliqiye.utils.json.Jackson3JsonApi +import com.mingliqiye.utils.json.api.JSONA +import com.mingliqiye.utils.json.api.base.JsonApi +import com.mingliqiye.utils.logger.MingLiLoggerFactory +import org.springframework.boot.autoconfigure.AutoConfigureAfter +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean +import org.springframework.context.annotation.Bean +import tools.jackson.databind.json.JsonMapper + +@ConditionalOnClass(name = ["tools.jackson.databind.json.JsonMapper", "org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration"]) +@AutoConfigureAfter(name = ["com.mingliqiye.utils.springboot.autoconfigure.Jackson3AutoConfiguration"]) +open class Jackson3JsonApiAutoConfiguration { + private val logger = MingLiLoggerFactory.getLogger() + + @Bean + @ConditionalOnMissingBean + open fun jsonApi(jsonMapper: JsonMapper): JsonApi { + return Jackson3JsonApi( + get = { jsonMapper }, + set = { throw JsonException("JSON API set method is not allowed.") }).also { + logger.info("JsonApi Bean Auto Configuration Success") + try { + JSONA.getJsonApi() + } catch (_: NullPointerException) { + JSONA.setJsonApi(it) + logger.info( + "JSONA Using {}", it.javaClass.name + ) + } + } + } +} diff --git a/src/main/kotlin/com/mingliqiye/utils/springboot/autoconfigure/JacksonAutoConfiguration.kt b/src/main/kotlin/com/mingliqiye/utils/springboot/autoconfigure/JacksonAutoConfiguration.kt index eadfbe4..506bedc 100644 --- a/src/main/kotlin/com/mingliqiye/utils/springboot/autoconfigure/JacksonAutoConfiguration.kt +++ b/src/main/kotlin/com/mingliqiye/utils/springboot/autoconfigure/JacksonAutoConfiguration.kt @@ -16,20 +16,19 @@ * ProjectName mingli-utils * ModuleName mingli-utils.main * CurrentFile JacksonAutoConfiguration.kt - * LastUpdate 2026-02-08 01:29:21 + * LastUpdate 2026-03-11 08:46:40 * UpdateUser MingLiPro */ package com.mingliqiye.utils.springboot.autoconfigure import com.fasterxml.jackson.databind.ObjectMapper -import com.mingliqiye.utils.i18n.I18N.infoTranslater import com.mingliqiye.utils.json.api.JSONA import com.mingliqiye.utils.json.api.JacksonJsonApi import com.mingliqiye.utils.json.api.base.JsonApi import com.mingliqiye.utils.json.converters.DateTimeJsonConverter import com.mingliqiye.utils.json.converters.UUIDJsonConverter -import com.mingliqiye.utils.json.converters.base.JackSonJsonConverter.Companion.addJsonConverter +import com.mingliqiye.utils.json.converters.base.addJsonConverter import com.mingliqiye.utils.logger.MingLiLoggerFactory import org.slf4j.Logger import org.springframework.boot.autoconfigure.AutoConfigureAfter @@ -77,10 +76,10 @@ open class JacksonAutoConfiguration(objectMapper: ObjectMapper) { * 注册自定义的 UUID 和 DateTime JSON 转换器模块到 ObjectMapper 中。 */ init { - log.infoTranslater("com.mingliqiye.utils.springboot.autoconfigure.JsonApiAutoConfiguration.jacksonserializers") objectMapper .addJsonConverter() .addJsonConverter() + log.info("MingliUtils Jackson Serializers created") } /* @@ -95,14 +94,13 @@ open class JacksonAutoConfiguration(objectMapper: ObjectMapper) { @ConditionalOnMissingBean open fun jsonApi(objectMapper: ObjectMapper): JsonApi { return JacksonJsonApi(objectMapper).also { - log.infoTranslater("com.mingliqiye.utils.springboot.autoconfigure.JsonApiAutoConfiguration.jsonapiconfiged") + log.info("JsonApi Bean Auto Configuration Success") try { JSONA.getJsonApi() } catch (_: NullPointerException) { JSONA.setJsonApi(it) - log.infoTranslater( - "com.mingliqiye.utils.springboot.autoconfigure.JsonApiAutoConfiguration.jsonause", - it.javaClass.name + log.info( + "JSONA Using {}", it.javaClass.name ) } } diff --git a/src/main/kotlin/com/mingliqiye/utils/springboot/autoconfigure/Okhttp3AutoConfiguration.kt b/src/main/kotlin/com/mingliqiye/utils/springboot/autoconfigure/Okhttp3AutoConfiguration.kt new file mode 100644 index 0000000..2db566a --- /dev/null +++ b/src/main/kotlin/com/mingliqiye/utils/springboot/autoconfigure/Okhttp3AutoConfiguration.kt @@ -0,0 +1,72 @@ +/* + * Copyright 2026 mingliqiye + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ProjectName mingli-utils + * ModuleName mingli-utils.main + * CurrentFile Okhttp3AutoConfiguration.kt + * LastUpdate 2026-02-27 17:40:32 + * UpdateUser MingLiPro + */ + +package com.mingliqiye.utils.springboot.autoconfigure + +import com.mingliqiye.utils.logger.MingLiLoggerFactory +import org.slf4j.Logger +import org.springframework.beans.factory.annotation.Autowired +import org.springframework.boot.autoconfigure.AutoConfiguration +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass +import org.springframework.context.annotation.Bean +import org.springframework.context.event.ContextClosedEvent +import org.springframework.context.event.EventListener + +@AutoConfiguration +@ConditionalOnClass(name = ["okhttp3.OkHttpClient"]) +open class Okhttp3AutoConfiguration { + + private var okHttpClient: okhttp3.OkHttpClient? = null + + val log: Logger = MingLiLoggerFactory.getLogger() + + @Autowired(required = false) + open var userDefinedBuilder: okhttp3.OkHttpClient.Builder? = null + + open fun initOkHttpClient() { + if (userDefinedBuilder == null) { + okHttpClient = okhttp3.OkHttpClient() + } else { + userDefinedBuilder!!.build() + } + } + + @Bean + open fun okHttpClient(): okhttp3.OkHttpClient { + if (okHttpClient == null) { + initOkHttpClient() + } + log.info("OkHttpClient initialized (using ${if (userDefinedBuilder != null) "user-defined" else "default"} builder)") + return okHttpClient!! + } + + + @EventListener(ContextClosedEvent::class) + open fun handleContextClosed() { + if (okHttpClient != null) { + log.info("Context closed, cleaning up OkHttpClient...") + okHttpClient?.dispatcher?.executorService?.shutdown() + okHttpClient?.connectionPool?.evictAll() + okHttpClient?.dispatcher?.executorService?.shutdownNow() + } + } +} diff --git a/src/main/kotlin/com/mingliqiye/utils/springboot/bean/SpringBeanUtils.kt b/src/main/kotlin/com/mingliqiye/utils/springboot/bean/SpringBeanUtils.kt index 741d4f3..0f7ddb6 100644 --- a/src/main/kotlin/com/mingliqiye/utils/springboot/bean/SpringBeanUtils.kt +++ b/src/main/kotlin/com/mingliqiye/utils/springboot/bean/SpringBeanUtils.kt @@ -16,7 +16,7 @@ * ProjectName mingli-utils * ModuleName mingli-utils.main * CurrentFile SpringBeanUtils.kt - * LastUpdate 2026-02-04 16:50:39 + * LastUpdate 2026-02-26 14:09:02 * UpdateUser MingLiPro */ @@ -40,7 +40,7 @@ class SpringBeanUtils : ApplicationContextAware { private var applicationContext: ApplicationContext? = null @Throws(BeansException::class) - inline fun getBean() = getBean(T::class.java) + inline fun getBean() = getBean(T::class.java) /** * 根据Bean名称获取Bean实例 @@ -64,7 +64,7 @@ class SpringBeanUtils : ApplicationContextAware { */ @JvmStatic @Throws(BeansException::class) - fun getBean(clazz: Class): T { + fun getBean(clazz: Class): T { return applicationContext!!.getBean(clazz) } @@ -78,7 +78,7 @@ class SpringBeanUtils : ApplicationContextAware { */ @JvmStatic @Throws(BeansException::class) - fun getBean(name: String, clazz: Class): T { + fun getBean(name: String, clazz: Class): T { return applicationContext!!.getBean(name, clazz) } } diff --git a/src/main/kotlin/com/mingliqiye/utils/springboot/listener/ApplicationListener.kt b/src/main/kotlin/com/mingliqiye/utils/springboot/listener/ApplicationListener.kt new file mode 100644 index 0000000..8b34202 --- /dev/null +++ b/src/main/kotlin/com/mingliqiye/utils/springboot/listener/ApplicationListener.kt @@ -0,0 +1,105 @@ +/* + * Copyright 2026 mingliqiye + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ProjectName mingli-utils + * ModuleName mingli-utils.main + * CurrentFile ApplicationListener.kt + * LastUpdate 2026-03-11 08:20:37 + * UpdateUser MingLiPro + */ + +package com.mingliqiye.utils.springboot.listener + + +import com.mingliqiye.utils.logger.MingLiLoggerFactory +import com.mingliqiye.utils.springboot.annotation.ApplicationDestroyedRunner +import com.mingliqiye.utils.springboot.annotation.ApplicationStartedRunner +import com.mingliqiye.utils.springboot.annotation.Listener +import org.springframework.beans.factory.ListableBeanFactory +import org.springframework.boot.context.event.ApplicationStartedEvent +import org.springframework.context.event.ContextClosedEvent +import org.springframework.context.event.EventListener + + +@Listener +class ApplicationListener { + + val runningMap = HashMap>() + + companion object { + private val log = MingLiLoggerFactory.getLogger() + } + + fun init(applicationContext: ListableBeanFactory) { + runningMap.clear() + for (beanName in applicationContext.beanDefinitionNames) { + val bean: Any = applicationContext.getBean(beanName) + val beanClass: Class<*> = bean.javaClass + if (beanClass.getName().startsWith("org.springframework")) { + continue + } + for (method in beanClass.getDeclaredMethods()) { + val annotation: Any = + method.getAnnotation(ApplicationStartedRunner::class.java) ?: method.getAnnotation( + ApplicationDestroyedRunner::class.java + ) ?: continue + var order: Int + var key: Class + when (annotation) { + is ApplicationStartedRunner -> { + order = annotation.order + key = ApplicationStartedRunner::class.java + } + + is ApplicationDestroyedRunner -> { + order = annotation.order + key = ApplicationDestroyedRunner::class.java + } + + else -> continue + } + log.debug("ApplicationListener Scaned [{} - {}] order: {} ", bean.javaClass.name, method, order) + val d = runningMap.getOrPut(key.name) { + ArrayList() + } + d.add( + ApplicationRunnerData( + beanName = beanName, order = order, bean = bean, method = method + ) + ) + } + } + runningMap.forEach { (string, data) -> + data.sortWith(compareBy(ApplicationRunnerData::order)) + } + } + + @EventListener(ApplicationStartedEvent::class) + fun applicationStarted(event: ApplicationStartedEvent) { + init(event.applicationContext) + runningMap[ApplicationStartedRunner::class.java.name]?.forEach { + log.debug("Started Event Running {} {} {} - {}", it.beanName, it.bean, it.method, it.order) + it.run() + } + } + + @EventListener(ContextClosedEvent::class) + fun applicationClosed() { + runningMap[ApplicationDestroyedRunner::class.java.name]?.forEach { + log.debug("Closed Event Running {} {} {} - {}", it.beanName, it.bean, it.method, it.order) + it.run() + } + } +} diff --git a/src/main/kotlin/com/mingliqiye/utils/springboot/listener/ApplicationRunnerData.kt b/src/main/kotlin/com/mingliqiye/utils/springboot/listener/ApplicationRunnerData.kt new file mode 100644 index 0000000..bdef2b7 --- /dev/null +++ b/src/main/kotlin/com/mingliqiye/utils/springboot/listener/ApplicationRunnerData.kt @@ -0,0 +1,33 @@ +/* + * Copyright 2026 mingliqiye + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ProjectName mingli-utils + * ModuleName mingli-utils.main + * CurrentFile ApplicationRunnerData.kt + * LastUpdate 2026-03-10 09:10:50 + * UpdateUser MingLiPro + */ + +package com.mingliqiye.utils.springboot.listener + +import java.lang.reflect.Method + +data class ApplicationRunnerData( + val beanName: String, val order: Int, val bean: Any, val method: Method +) { + fun run() { + method.invoke(bean) + } +} diff --git a/src/main/kotlin/com/mingliqiye/utils/string/StringUtils.kt b/src/main/kotlin/com/mingliqiye/utils/string/StringUtils.kt index 60792ec..bbcc622 100644 --- a/src/main/kotlin/com/mingliqiye/utils/string/StringUtils.kt +++ b/src/main/kotlin/com/mingliqiye/utils/string/StringUtils.kt @@ -16,15 +16,14 @@ * ProjectName mingli-utils * ModuleName mingli-utils.main * CurrentFile StringUtils.kt - * LastUpdate 2026-02-06 08:35:07 + * LastUpdate 2026-03-11 08:46:40 * UpdateUser MingLiPro */ @file:JvmName("StringUtils") package com.mingliqiye.utils.string -import com.mingliqiye.utils.base.BASE16 -import com.mingliqiye.utils.i18n.I18N.warnTranslater +import com.mingliqiye.utils.base.code.Base16 import com.mingliqiye.utils.logger.MingLiLoggerFactory import com.mingliqiye.utils.objects.isNull import java.net.URLDecoder @@ -100,13 +99,13 @@ fun format(str: String, vararg args: Any?): String { // 检查参数数量 val placeholderCount = matches.count() if (placeholderCount != args.size) { - log.warnTranslater( - "com.mingliqiye.utils.string.StringUtils.format.warn.placeholder", + log.warn( + "Placeholder Count: {}, Argument Count: {}", placeholderCount, args.size ) - log.warnTranslater("com.mingliqiye.utils.string.StringUtils.format.warn.template", str) - log.warnTranslater( - "com.mingliqiye.utils.string.StringUtils.format.warn.arguments", + log.warn("Template: {}", str) + log.warn( + "Arguments: [{}]", ", ".join(args) { if (it.isNull()) return@join "null:null" "${it.javaClass.simpleName}:$it" @@ -287,14 +286,14 @@ fun String.hmacSHA256String(keyS: String): String { val key = keyS.toByteArray() instance.init(SecretKeySpec(key, 0, key.size, "HmacSHA256")) val bytes = instance.doFinal(this.toByteArray()) - return BASE16.encode(bytes) + return Base16.encode(bytes) } fun String.md5String(): String { val instance = MessageDigest.getInstance("MD5") instance.update(this.toByteArray()) val bytes = instance.digest() - return BASE16.encode(bytes) + return Base16.encode(bytes) } fun String.hmacMd5String(keyS: String): String { @@ -302,5 +301,5 @@ fun String.hmacMd5String(keyS: String): String { val key = keyS.toByteArray() instance.init(SecretKeySpec(key, 0, key.size, "HmacSHA256")) val bytes = instance.doFinal(this.toByteArray()) - return BASE16.encode(bytes) + return Base16.encode(bytes) } diff --git a/src/main/kotlin/com/mingliqiye/utils/system/SystemUtil.kt b/src/main/kotlin/com/mingliqiye/utils/system/SystemUtil.kt index 2add6d8..7516b6d 100644 --- a/src/main/kotlin/com/mingliqiye/utils/system/SystemUtil.kt +++ b/src/main/kotlin/com/mingliqiye/utils/system/SystemUtil.kt @@ -16,7 +16,7 @@ * ProjectName mingli-utils * ModuleName mingli-utils.main * CurrentFile SystemUtil.kt - * LastUpdate 2026-01-31 20:47:59 + * LastUpdate 2026-03-11 08:44:41 * UpdateUser MingLiPro */ @file:JvmName("SystemUtils") @@ -454,6 +454,6 @@ fun loadProtocol(clazz: Class<*>? = null): String { protocol = resource!!.protocol return protocol.let { isLoadprotocol = true - return@let it + it } } diff --git a/src/main/kotlin/com/mingliqiye/utils/thread/ThreadUtils.kt b/src/main/kotlin/com/mingliqiye/utils/thread/ThreadUtils.kt index f942b88..79a1204 100644 --- a/src/main/kotlin/com/mingliqiye/utils/thread/ThreadUtils.kt +++ b/src/main/kotlin/com/mingliqiye/utils/thread/ThreadUtils.kt @@ -16,7 +16,7 @@ * ProjectName mingli-utils * ModuleName mingli-utils.main * CurrentFile ThreadUtils.kt - * LastUpdate 2026-01-31 20:48:19 + * LastUpdate 2026-02-09 20:14:22 * UpdateUser MingLiPro */ @@ -35,7 +35,7 @@ object ThreadUtils { * @return 当前线程的名称字符串 */ @JvmStatic - var name: String + var currentThreadName: String get() = Thread.currentThread().name set(s) { Thread.currentThread().name = s diff --git a/src/main/kotlin/com/mingliqiye/utils/time/DateTime.kt b/src/main/kotlin/com/mingliqiye/utils/time/DateTime.kt index a274873..d953716 100644 --- a/src/main/kotlin/com/mingliqiye/utils/time/DateTime.kt +++ b/src/main/kotlin/com/mingliqiye/utils/time/DateTime.kt @@ -16,27 +16,19 @@ * ProjectName mingli-utils * ModuleName mingli-utils.main * CurrentFile DateTime.kt - * LastUpdate 2026-02-04 21:54:04 + * LastUpdate 2026-03-07 11:02:42 * UpdateUser MingLiPro */ package com.mingliqiye.utils.time -import com.mingliqiye.utils.jna.FILETIME_EPOCH_OFFSET -import com.mingliqiye.utils.jna.NANOS_PER_100NS -import com.mingliqiye.utils.jna.WinKernel32Api -import com.mingliqiye.utils.jna.getWinKernel32Apis -import com.mingliqiye.utils.logger.MingLiLoggerFactory -import com.mingliqiye.utils.system.isWindows -import com.mingliqiye.utils.system.javaVersionAsInteger -import org.slf4j.Logger +import io.swagger.v3.oas.annotations.media.Schema import java.io.Serializable import java.time.LocalDateTime import java.time.ZoneId import java.time.format.DateTimeFormatter import java.time.temporal.ChronoUnit import java.util.* -import kotlin.time.ExperimentalTime import kotlin.time.Instant @@ -55,33 +47,17 @@ import kotlin.time.Instant * @see ZoneId * @see Instant */ +@Schema( + name = "DateTime", + description = "DateTime", + type = "string", + format = "date-time" +) class DateTime private constructor( private var localDateTime: LocalDateTime, private val zoneId: ZoneId = ZoneId.systemDefault() ) : Serializable { companion object { - private val WIN_KERNEL_32_API: WinKernel32Api? = if (javaVersionAsInteger == 8 && isWindows) { - val log: Logger = MingLiLoggerFactory.getLogger("mingli-utils DateTime") - val a = getWinKernel32Apis() - - if (a.size > 1) { - log.warn("Multiple Size:{} WinKernel32Api implementations found.", a.size) - a.forEach { api -> - log.warn("Found WinKernel32Api: {}", api.javaClass.name) - } - } - - if (a.isEmpty()) { - log.warn("No WinKernel32Api implementation found. Use Jdk1.8 LocalDateTime") - null - } else { - log.info("Found and Use WinKernel32Api: {}", a[a.size - 1].javaClass.name) - a[a.size - 1] - } - } else { - null - } - /** * 获取当前时间的 DateTime 实例。 * 如果运行在 Java 1.8 环境下,则通过 WinKernel32 获取高精度时间。 @@ -90,11 +66,6 @@ class DateTime private constructor( */ @JvmStatic fun now(): DateTime { - if (WIN_KERNEL_32_API != null) { - return DateTime( - WIN_KERNEL_32_API.getTime().atZone(ZoneId.systemDefault()).toLocalDateTime() - ) - } return DateTime(LocalDateTime.now()) } @@ -266,27 +237,6 @@ class DateTime private constructor( return DateTime(LocalDateTime.of(year, month, day, hour, minute)) } - /** - * 将 FILETIME 转换为 LocalDateTime。 - * - * @param fileTime FILETIME 时间戳(100纳秒单位自1601年1月1日起) - * @return 转换后的 LocalDateTime 实例 - */ - @OptIn(ExperimentalTime::class) - @JvmStatic - fun fileTimeToLocalDateTime(fileTime: Long): LocalDateTime { - // 1. 将 FILETIME (100ns间隔 since 1601) 转换为 Unix 时间戳 (纳秒 since 1970) - val unixNanos = (fileTime + FILETIME_EPOCH_OFFSET) * NANOS_PER_100NS - - // 2. 从纳秒时间戳创建 Instant - val instant = java.time.Instant.ofEpochSecond( - unixNanos / 1_000_000_000L, unixNanos % 1_000_000_000L - ) - - // 3. 转换为系统默认时区的 LocalDateTime - return instant.atZone(ZoneId.systemDefault()).toLocalDateTime() - } - /** * 根据年、月、日、时、分、秒创建 DateTime 实例 * diff --git a/src/main/kotlin/com/mingliqiye/utils/time/DateTimeOffset.kt b/src/main/kotlin/com/mingliqiye/utils/time/DateTimeOffset.kt index 15e9b7a..060274d 100644 --- a/src/main/kotlin/com/mingliqiye/utils/time/DateTimeOffset.kt +++ b/src/main/kotlin/com/mingliqiye/utils/time/DateTimeOffset.kt @@ -16,46 +16,120 @@ * ProjectName mingli-utils * ModuleName mingli-utils.main * CurrentFile DateTimeOffset.kt - * LastUpdate 2026-02-04 21:54:04 + * LastUpdate 2026-02-27 11:04:05 * UpdateUser MingLiPro */ package com.mingliqiye.utils.time import java.time.temporal.ChronoUnit +import java.util.concurrent.TimeUnit /** - * 时间位移 类 + * 表示一个时间偏移量的类,用于封装时间单位和偏移值。 * - * @author MingLiPro + * @property offsetType 时间单位类型,使用 [ChronoUnit] 表示。 + * @property offset 偏移量的数值。 */ class DateTimeOffset private constructor( - val offsetType: ChronoUnit, val offset: Long + val offsetType: ChronoUnit, + val offset: Long ) { companion object { /** - * 创建一个新的DateTimeOffset实例 + * 将 [ChronoUnit] 扩展为创建 [DateTimeOffset] 实例的函数。 * - * @param offsetType 偏移量的单位类型,指定偏移量的计算单位 - * @param offset 偏移量的数值,可以为正数、负数或零 - * @return 返回一个新的DateTimeOffset对象,包含指定的偏移量信息 + * @param offset 偏移量的长整型数值。 + * @return 返回一个新的 [DateTimeOffset] 实例。 */ @JvmStatic - fun of(offsetType: ChronoUnit, offset: Long): DateTimeOffset { - return DateTimeOffset(offsetType, offset) - } + @JvmName("of") + fun ChronoUnit.toDateTimeOffset(offset: Long) = DateTimeOffset(this, offset) /** - * 创建一个 DateTimeOffset 实例 + * 将 [ChronoUnit] 扩展为创建 [DateTimeOffset] 实例的函数。 * - * @param offset 偏移量数值 - * @param offsetType 偏移量的时间单位类型 - * @return 返回一个新的 DateTimeOffset 实例 + * @param offset 偏移量的整型数值。 + * @return 返回一个新的 [DateTimeOffset] 实例。 */ @JvmStatic - fun of(offset: Long, offsetType: ChronoUnit): DateTimeOffset { - return DateTimeOffset(offsetType, offset) + @JvmName("of") + fun ChronoUnit.toDateTimeOffset(offset: Int) = DateTimeOffset(this, offset.toLong()) + + /** + * 将 [TimeUnit] 扩展为创建 [DateTimeOffset] 实例的函数。 + * + * @param offset 偏移量的长整型数值。 + * @return 返回一个新的 [DateTimeOffset] 实例。 + */ + @JvmStatic + @JvmName("of") + fun TimeUnit.toDateTimeOffset(offset: Long) = DateTimeOffset(this.toChronoUnit(), offset) + + /** + * 将 [TimeUnit] 扩展为创建 [DateTimeOffset] 实例的函数。 + * + * @param offset 偏移量的整型数值。 + * @return 返回一个新的 [DateTimeOffset] 实例。 + */ + @JvmStatic + @JvmName("of") + fun TimeUnit.toDateTimeOffset(offset: Int) = DateTimeOffset(this.toChronoUnit(), offset.toLong()) + + /** + * 创建 [DateTimeOffset] 实例的静态工厂方法。 + * + * @param offset 偏移量的长整型数值。 + * @param offsetType 时间单位类型,使用 [ChronoUnit] 表示。 + * @return 返回一个新的 [DateTimeOffset] 实例。 + */ + @JvmStatic + fun of(offset: Long, offsetType: ChronoUnit) = offsetType.toDateTimeOffset(offset) + + /** + * 创建 [DateTimeOffset] 实例的静态工厂方法。 + * + * @param offset 偏移量的整型数值。 + * @param offsetType 时间单位类型,使用 [ChronoUnit] 表示。 + * @return 返回一个新的 [DateTimeOffset] 实例。 + */ + @JvmStatic + fun of(offset: Int, offsetType: ChronoUnit) = offsetType.toDateTimeOffset(offset) + + /** + * 创建 [DateTimeOffset] 实例的静态工厂方法。 + * + * @param offset 偏移量的长整型数值。 + * @param offsetType 时间单位类型,使用 [TimeUnit] 表示。 + * @return 返回一个新的 [DateTimeOffset] 实例。 + */ + @JvmStatic + fun of(offset: Long, offsetType: TimeUnit) = offsetType.toDateTimeOffset(offset) + + /** + * 创建 [DateTimeOffset] 实例的静态工厂方法。 + * + * @param offset 偏移量的整型数值。 + * @param offsetType 时间单位类型,使用 [TimeUnit] 表示。 + * @return 返回一个新的 [DateTimeOffset] 实例。 + */ + @JvmStatic + fun of(offset: Int, offsetType: TimeUnit) = offsetType.toDateTimeOffset(offset) + + @Suppress("EXTENSION_SHADOWED_BY_MEMBER") + @JvmStatic + @JvmName("TimeUnitToChronoUnit") + fun TimeUnit.toChronoUnit(): ChronoUnit { + return when (this) { + TimeUnit.NANOSECONDS -> ChronoUnit.NANOS + TimeUnit.MICROSECONDS -> ChronoUnit.MICROS + TimeUnit.MILLISECONDS -> ChronoUnit.MILLIS + TimeUnit.SECONDS -> ChronoUnit.SECONDS + TimeUnit.MINUTES -> ChronoUnit.MINUTES + TimeUnit.HOURS -> ChronoUnit.HOURS + TimeUnit.DAYS -> ChronoUnit.DAYS + } } } } diff --git a/src/main/kotlin/com/mingliqiye/utils/uuid/UUID.kt b/src/main/kotlin/com/mingliqiye/utils/uuid/UUID.kt index 4ef0295..7b4d100 100644 --- a/src/main/kotlin/com/mingliqiye/utils/uuid/UUID.kt +++ b/src/main/kotlin/com/mingliqiye/utils/uuid/UUID.kt @@ -16,30 +16,45 @@ * ProjectName mingli-utils * ModuleName mingli-utils.main * CurrentFile UUID.kt - * LastUpdate 2026-02-06 14:33:24 + * LastUpdate 2026-03-07 11:02:29 * UpdateUser MingLiPro */ package com.mingliqiye.utils.uuid -import com.mingliqiye.utils.base.* -import com.mingliqiye.utils.io.IO.println +import com.mingliqiye.utils.array.copyTo +import com.mingliqiye.utils.base.BaseCodec +import com.mingliqiye.utils.base.BaseType +import com.mingliqiye.utils.base.code.Base256 +import com.mingliqiye.utils.base.code.Base64 +import com.mingliqiye.utils.base.code.Base91 import com.mingliqiye.utils.random.randomByte import com.mingliqiye.utils.random.secureRandom import com.mingliqiye.utils.system.macAddressBytes import com.mingliqiye.utils.time.DateTime import com.mingliqiye.utils.time.DateTimeOffset +import com.mingliqiye.utils.time.DateTimeOffset.Companion.toDateTimeOffset +import io.swagger.v3.oas.annotations.media.Schema import java.io.Serializable +import java.math.BigInteger import java.nio.ByteBuffer import java.security.MessageDigest import java.time.temporal.ChronoUnit +import java.util.concurrent.atomic.AtomicLong import java.util.UUID as JUUID /** * UUID 类用于生成和操作不同版本的 UUID(通用唯一标识符)。 * 支持 UUID 的序列化、转换、解析和时间/版本信息提取。 + * V8 请开发者自己实现 */ +@Schema( + name = "UUID", + description = "UUID", + type = "string", + format = "uuid" +) class UUID : Serializable { private val data: ByteArray private val mostSigBits: Long @@ -48,6 +63,11 @@ class UUID : Serializable { companion object { + + private var lastTimestamp = 0L + private var clockSequence = secureRandom.nextInt(0x3FFF + 1) + private val clockSeqHolder = AtomicLong(0) + /** * 预期 UUID 字符串中连字符的位置数组。 */ @@ -63,17 +83,35 @@ class UUID : Serializable { @JvmStatic fun ofBase64ShortString(baseShortString: String): UUID { - return UUID(BASE64.decode(baseShortString)) + return UUID(Base64.decode(baseShortString)) } @JvmStatic fun ofBase256ShortString(baseShortString: String): UUID { - return UUID(BASE256.decode(baseShortString)) + return UUID(Base256.decode(baseShortString)) } @JvmStatic fun ofBase91ShortString(baseShortString: String): UUID { - return UUID(BASE91.decode(baseShortString)) + return UUID(Base91.decode(baseShortString)) + } + + @JvmStatic + fun getV8( + customA: ByteArray, // 6字节 + customB: ByteArray, // 2字节 前4位被替换位版本号 + customC: ByteArray, // 8字节, 前2位被替换位变体 + ): UUID { + require(customA.size == 6) { "customA 必须是6字节" } + require(customB.size == 2) { "customB 必须是2字节" } + require(customC.size == 8) { "customC 必须是8字节" } + val rbyte = ByteArray(16) + customA.copyTo(rbyte, 0, 0, 6) + customB.copyTo(rbyte, 0, 6, 2) + customC.copyTo(rbyte, 0, 8, 8) + rbyte[6] = (rbyte[6].toInt() and 0x0F or 0x80).toByte() + rbyte[8] = (rbyte[8].toInt() and 0x3F or 0x80).toByte() + return UUID(rbyte) } /** @@ -85,18 +123,47 @@ class UUID : Serializable { @JvmStatic fun getV1(): UUID { val time = DateTime.now().add(DateTimeOffset.of(UUID_EPOCH_OFFSET, ChronoUnit.DAYS)).to100NanoTime() - val timeLow = (time and 0xFFFFFFFFL).toInt() val timeMid = ((time shr 32) and 0xFFFFL).toShort() val timeHighAndVersion = (((time shr 48) and 0x0FFFL) or 0x1000L).toShort() - val clockSeq = (secureRandom.nextInt(16384)) and 0x3FFF + val clockSeq: Long = if (time == lastTimestamp) { + clockSeqHolder.addAndGet(1) + } else { + clockSeqHolder.set(0) + lastTimestamp = time + 0 + } + val byteBuffer = ByteBuffer.wrap(ByteArray(16)) + byteBuffer.putInt(timeLow) + byteBuffer.putShort(timeMid) + byteBuffer.putShort(timeHighAndVersion) + byteBuffer.putShort((clockSeq and 0x3FFF).toShort()) + byteBuffer.put(macAddressBytes) + + return UUID(byteBuffer.array()) + } + + @JvmStatic + fun getV1RandomMac(): UUID { + val time = DateTime.now().add(DateTimeOffset.of(UUID_EPOCH_OFFSET, ChronoUnit.DAYS)).to100NanoTime() + val timeLow = (time and 0xFFFFFFFFL).toInt() + val timeMid = ((time shr 32) and 0xFFFFL).toShort() + val timeHighAndVersion = (((time shr 48) and 0x0FFFL) or 0x1000L).toShort() + val clockSeq: Long = if (time == lastTimestamp) { + clockSeqHolder.addAndGet(1) + } else { + clockSeqHolder.set(0) + lastTimestamp = time + 0 + } + lastTimestamp = time val byteBuffer = ByteBuffer.wrap(ByteArray(16)) byteBuffer.putInt(timeLow) byteBuffer.putShort(timeMid) byteBuffer.putShort(timeHighAndVersion) - byteBuffer.putShort(clockSeq.toShort()) - byteBuffer.put(macAddressBytes) + byteBuffer.putShort((clockSeq and 0x3FFF).toShort()) + byteBuffer.put(randomByte(6)) return UUID(byteBuffer.array()) } @@ -109,10 +176,8 @@ class UUID : Serializable { @JvmStatic fun getV4(): UUID { val randomBytes = randomByte(16) - randomBytes[6] = (randomBytes[6].toInt() and 0x0F).toByte() - randomBytes[6] = (randomBytes[6].toInt() or 0x40).toByte() - randomBytes[8] = (randomBytes[8].toInt() and 0x3F).toByte() - randomBytes[8] = (randomBytes[8].toInt() or 0x80).toByte() + randomBytes[6] = (randomBytes[6].toInt() and 0x0F or 0x40).toByte() + randomBytes[8] = (randomBytes[8].toInt() and 0x3F or 0x80).toByte() return UUID(randomBytes) } @@ -161,8 +226,7 @@ class UUID : Serializable { */ @JvmStatic fun getV6(): UUID { - val timestamp = DateTime.now() - .add(DateTimeOffset.of(UUID_EPOCH_OFFSET, ChronoUnit.DAYS)) + val timestamp = DateTime.now().add(DateTimeOffset.of(UUID_EPOCH_OFFSET, ChronoUnit.DAYS)) .to100NanoTime() and 0x0FFFFFFFFFFFFFFFL val timeHigh = (timestamp ushr 12) and 0xFFFFFFFFFFFFL val timeMid = timestamp and 0x0FFFL @@ -278,8 +342,7 @@ class UUID : Serializable { return UUID( ByteArray( 16 - ) { 0xFF.toByte() } - ) + ) { 0xFF.toByte() }) } /** @@ -292,8 +355,7 @@ class UUID : Serializable { return UUID( ByteArray( 16 - ) { 0x00.toByte() } - ) + ) { 0x00.toByte() }) } /** @@ -574,8 +636,6 @@ class UUID : Serializable { if (this === other) return true return when (other) { is UUID -> { - this.println() - other.println() this.data.contentEquals(other.data) } @@ -645,40 +705,29 @@ class UUID : Serializable { 1 -> { val timestamp = ((mostSigBits and 0x0FFFL) shl 48 or (((mostSigBits shr 16) and 0x0FFFFL) shl 32) or (mostSigBits ushr 32)) - val timestampBigInt = java.math.BigInteger.valueOf(timestamp) - val nanosecondsBigInt = timestampBigInt.multiply(java.math.BigInteger.valueOf(100L)) - val divisor = java.math.BigInteger.valueOf(1_000_000_000L) + val timestampBigInt = BigInteger.valueOf(timestamp) + val nanosecondsBigInt = timestampBigInt.multiply(BigInteger.valueOf(100L)) + val divisor = BigInteger.valueOf(1_000_000_000L) val seconds = nanosecondsBigInt.divide(divisor) val nanos = nanosecondsBigInt.remainder(divisor) return DateTime.of(seconds.toLong(), nanos.toLong()) - .sub(DateTimeOffset.of(ChronoUnit.DAYS, UUID_EPOCH_OFFSET)) + .sub(ChronoUnit.DAYS.toDateTimeOffset(UUID_EPOCH_OFFSET)) } 6 -> { - val timeHigh = ( - ((data[0].toLong() and 0xFF) shl 40) or - ((data[1].toLong() and 0xFF) shl 32) or - ((data[2].toLong() and 0xFF) shl 24) or - ((data[3].toLong() and 0xFF) shl 16) or - ((data[4].toLong() and 0xFF) shl 8) or - (data[5].toLong() and 0xFF) - ) + val timeHigh = + (((data[0].toLong() and 0xFF) shl 40) or ((data[1].toLong() and 0xFF) shl 32) or ((data[2].toLong() and 0xFF) shl 24) or ((data[3].toLong() and 0xFF) shl 16) or ((data[4].toLong() and 0xFF) shl 8) or (data[5].toLong() and 0xFF)) val timeMidAndVersion = ((data[6].toInt() and 0xFF) shl 8) or (data[7].toInt() and 0xFF) val timeMid = timeMidAndVersion and 0x0FFF val hundredNanosSinceUuidEpoch = (timeHigh shl 12) or timeMid.toLong() val seconds = hundredNanosSinceUuidEpoch / 10_000_000 val nanos = (hundredNanosSinceUuidEpoch % 10_000_000) * 100 - return DateTime.of(seconds, nanos).sub(DateTimeOffset.of(ChronoUnit.DAYS, UUID_EPOCH_OFFSET)) + return DateTime.of(seconds, nanos).sub(ChronoUnit.DAYS.toDateTimeOffset(UUID_EPOCH_OFFSET)) } 7 -> { val times = - (data[0].toLong() and 0xFF shl 40) or - (data[1].toLong() and 0xFF shl 32) or - (data[2].toLong() and 0xFF shl 24) or - (data[3].toLong() and 0xFF shl 16) or - (data[4].toLong() and 0xFF shl 8) or - (data[5].toLong() and 0xFF) + (data[0].toLong() and 0xFF shl 40) or (data[1].toLong() and 0xFF shl 32) or (data[2].toLong() and 0xFF shl 24) or (data[3].toLong() and 0xFF shl 16) or (data[4].toLong() and 0xFF shl 8) or (data[5].toLong() and 0xFF) return DateTime.of(times) } @@ -698,15 +747,15 @@ class UUID : Serializable { } fun getBase64ShortString(): String { - return BASE64.encode(data).substring(0, 22) + return Base64.encode(data).substring(0, 22) } fun getBase91ShortString(): String { - return BASE91.encode(data) + return Base91.encode(data) } fun getBase256ShortString(): String { - return BASE256.encode(data) + return Base256.encode(data) } /** diff --git a/src/main/resources/META-INF/meta-data b/src/main/resources/META-INF/meta-data index d5e33d9..f65167e 100644 --- a/src/main/resources/META-INF/meta-data +++ b/src/main/resources/META-INF/meta-data @@ -1,7 +1,7 @@ -com.mingliqiye.utils.springboot.autoconfigure.AutoConfiguration.buildTime=$buildTime -com.mingliqiye.utils.springboot.autoconfigure.AutoConfiguration.groupId=$GROUPSID -com.mingliqiye.utils.springboot.autoconfigure.AutoConfiguration.artifactId=$ARTIFACTID -com.mingliqiye.utils.springboot.autoconfigure.AutoConfiguration.version=$VERSIONS -com.mingliqiye.utils.springboot.autoconfigure.AutoConfiguration.buildJdkVersion=$JDKVERSIONS -com.mingliqiye.utils.springboot.autoconfigure.AutoConfiguration.author=MingLiPro -com.mingliqiye.utils.springboot.autoconfigure.AutoConfiguration.website=https://mingli-utils.mingliqiye.com +buildTime=$buildTime +groupId=$GROUPSID +artifactId=$ARTIFACTID +version=$VERSIONS +buildJdkVersion=$JDKVERSIONS +author=MingLiPro +website=https://mingli-utils.mingliqiye.com diff --git a/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index 343fd55..6414688 100644 --- a/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -16,9 +16,12 @@ # ProjectName mingli-utils # ModuleName mingli-utils.main # CurrentFile org.springframework.boot.autoconfigure.AutoConfiguration.imports -# LastUpdate 2026-02-04 16:47:27 +# LastUpdate 2026-02-27 17:39:55 # UpdateUser MingLiPro # com.mingliqiye.utils.springboot.autoconfigure.AutoConfiguration com.mingliqiye.utils.springboot.autoconfigure.JacksonAutoConfiguration +com.mingliqiye.utils.springboot.autoconfigure.Jackson3AutoConfiguration +com.mingliqiye.utils.springboot.autoconfigure.Jackson3JsonApiAutoConfiguration +com.mingliqiye.utils.springboot.autoconfigure.Okhttp3AutoConfiguration diff --git a/src/main/resources/assets/mingli-utils/lang/en_US.json b/src/main/resources/assets/mingli-utils/lang/en_US.json deleted file mode 100644 index 7124897..0000000 --- a/src/main/resources/assets/mingli-utils/lang/en_US.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "com.mingliqiye.utils": { - "i18n": { - "readjson": { - "error": "Failed to load language file %s" - } - }, - "springboot.autoconfigure": { - "AutoConfiguration": { - "jdkRuntime": "JDK Runtime Environment Version", - "pid": "Process PID", - "computerName": "Computer Name", - "userName": "User Name", - "time": "Current Time", - "buildTime": "Build Time", - "groupId": "Group ID", - "artifactId": "Artifact ID", - "version": "Version", - "buildJdkVersion": "Build JDK Version", - "author": "Author", - "website": "Official Website", - "bean": "MingliUtils Auto Configuration Bean Success" - }, - "JsonApiAutoConfiguration": { - "jsonause": "JSONA Using %s", - "jsonapiconfiged": "JsonApi Bean Auto Configuration Success", - "jacksonserializers": "MingliUtils Jackson Serializers created" - } - }, - "string": { - "StringUtils": { - "format": { - "warn": { - "placeholder": "Placeholder Count: %s, Argument Count: %s", - "template": "Template: %s", - "arguments": "Arguments: [%s]" - } - } - } - } - } -} diff --git a/src/main/resources/assets/mingli-utils/lang/zh_CN.json b/src/main/resources/assets/mingli-utils/lang/zh_CN.json deleted file mode 100644 index 528916f..0000000 --- a/src/main/resources/assets/mingli-utils/lang/zh_CN.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "com.mingliqiye.utils": { - "i18n": { - "readjson": { - "error": "加载语言文件失败 %s" - } - }, - "springboot.autoconfigure": { - "AutoConfiguration": { - "jdkRuntime": "Jdk运行环境版本", - "pid": "程序Pid", - "computerName": "计算机名", - "userName": "用户名", - "time": "当前时间", - "buildTime": "编译时间", - "groupId": "组Id", - "artifactId": "组件Id", - "version": "版本", - "buildJdkVersion": "编译Jdk版本", - "author": "作者", - "website": "官方网址", - "bean": "MingliUtils 自动配置 Bean 成功" - }, - "JsonApiAutoConfiguration": { - "jsonause": "JSONA 使用 %s", - "jsonapiconfiged": "JsonApi Bean 自动配置成功", - "jacksonserializers": "MingliUtils Jackson 序列化器注册成功" - } - }, - "string": { - "StringUtils": { - "format": { - "warn": { - "placeholder": "占位符数量: %s, 参数数量: %s", - "template": "模板: %s", - "arguments": "参数: [%s]" - } - } - } - } - } -} diff --git a/src/test/kotlin/com/mingliqiye/utils/BaseTest.kt b/src/test/kotlin/com/mingliqiye/utils/BaseTest.kt deleted file mode 100644 index bff6822..0000000 --- a/src/test/kotlin/com/mingliqiye/utils/BaseTest.kt +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2026 mingliqiye - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ProjectName mingli-utils - * ModuleName mingli-utils.test - * CurrentFile BaseTest.kt - * LastUpdate 2026-02-08 03:05:52 - * UpdateUser MingLiPro - */ - -package com.mingliqiye.utils - -import com.mingliqiye.utils.base.code.* -import com.mingliqiye.utils.uuid.UUID -import org.junit.jupiter.api.Test - - -class BaseTest { - @Test - fun testBase2() { - val uuid = UUID.getV7() - val s = Base2.encode(uuid.toBytes()) - assert(uuid == UUID.of(Base2.decode(s))) - } - - @Test - fun testBase10() { - val uuid = UUID.getV7() - val s = Base10.encode(uuid.toBytes()) - assert(uuid == UUID.of(Base10.decode(s))) - } - - @Test - fun testBase16() { - val uuid = UUID.getV7() - val s = Base16.encode(uuid.toBytes()) - assert(uuid == UUID.of(Base16.decode(s))) - } - - @Test - fun testBase91() { - val uuid = UUID.getV7() - val s = Base91.encode(uuid.toBytes()) - assert(uuid == UUID.of(Base91.decode(s))) - } - - @Test - fun testBase256() { - val uuid = UUID.getV7() - val s = Base256.encode(uuid.toBytes()) - assert(uuid == UUID.of(Base256.decode(s))) - } -} diff --git a/src/test/kotlin/com/mingliqiye/utils/JsonTest.kt b/src/test/kotlin/com/mingliqiye/utils/JsonTest.kt deleted file mode 100644 index b68f222..0000000 --- a/src/test/kotlin/com/mingliqiye/utils/JsonTest.kt +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright 2026 mingliqiye - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ProjectName mingli-utils - * ModuleName mingli-utils.test - * CurrentFile JsonTest.kt - * LastUpdate 2026-02-08 02:29:27 - * UpdateUser MingLiPro - */ - -package com.mingliqiye.utils - -import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper -import com.fasterxml.jackson.module.kotlin.readValue -import com.mingliqiye.utils.annotation.UUIDJsonFormat -import com.mingliqiye.utils.array.toHexString -import com.mingliqiye.utils.base.BaseType -import com.mingliqiye.utils.io.IO.println -import com.mingliqiye.utils.json.api.JSONA -import com.mingliqiye.utils.json.api.JacksonJsonApi -import com.mingliqiye.utils.json.converters.DateTimeJsonConverter -import com.mingliqiye.utils.json.converters.UUIDJsonConverter -import com.mingliqiye.utils.json.converters.base.JackSonJsonConverter.Companion.addJsonConverter -import com.mingliqiye.utils.json.converters.base.getJsonConverter -import com.mingliqiye.utils.logger.MingLiLoggerFactory -import com.mingliqiye.utils.string.formatd -import com.mingliqiye.utils.uuid.UUID -import com.mingliqiye.utils.uuid.UUIDFormatType -import com.mingliqiye.utils.uuid.mysqlToUuid -import com.mingliqiye.utils.uuid.uuidToMysql -import org.junit.jupiter.api.Assertions.assertEquals -import org.junit.jupiter.api.Test - -class JsonTest { - @Test - fun testJSONA() { - - JSONA.setJsonApi( - JacksonJsonApi( - JSONA.jacksonKotlinObjectMapper() - ) - ) - JSONA.addJsonConverter() - JSONA.addJsonConverter() - - "{} {} {} {}".formatd("0", 1).println() - } - - @Test - fun testBANNER() { - val log = MingLiLoggerFactory.getLogger() - com.mingliqiye.utils.springboot.autoconfigure.AutoConfiguration.printBanner() - } - - @Test - fun testMysqld() { - val v = UUID.of("c3efb797-0323-11f1-8791-3aff070ec47d") - val ba = uuidToMysql(v.toBytes()) - val ca = mysqlToUuid(ba) - assertEquals( - "11F10323C3EFB79787913AFF070EC47D", - ba.toHexString().println() - ) - assertEquals( - "C3EFB797032311F187913AFF070EC47D", - ca.toHexString().println() - ) - } - - @Test - fun testGson2() { - getJsonConverter() - getJsonConverter() - } - - @Test - fun testGson() { - - val obm = jacksonObjectMapper() - .addJsonConverter() - .addJsonConverter() - - obm.readValue>>>( - obm.writeValueAsString( - AC(c = CC(b = ZZ(b = UUID.getV7()))) - ).println() - ).println() - } -} - -data class AC( - var a: String = "AC", - @field:UUIDJsonFormat( - base = BaseType.BASE256, - value = UUIDFormatType.UPPER_NO_SPACE - ) - var uuid: UUID = UUID.getV4(), - var b: BC = BC(), - var c: T -) - -data class BC( - var a: String = "BC", -) - -data class CC( - var a: String = "BC", - var b: T -) - - -data class ZZ( - var a: String = "ZZ", - @field:UUIDJsonFormat( - base = BaseType.BASE256, - value = UUIDFormatType.UPPER_NO_SPACE - ) - var b: T -)