diff --git a/.circleci/config.yml b/.circleci/config.yml index e6c4f38..77889be 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,52 +4,41 @@ defaults: &defaults environment: JVM_OPTS: -Xmx3200m TERM: dumb - CI: true + CI_NAME: "CircleCI" -defaults_gradle: &defaults_gradle +defaults_gradle: &defaults_bld steps: - checkout - - restore_cache: - keys: - - gradle-dependencies-{{ checksum "build.gradle.kts" }} - # fallback to using the latest cache if no exact match is found - - gradle-dependencies- - run: - name: Gradle Dependencies - command: ./gradlew dependencies - - save_cache: - paths: ~/.m2 - key: gradle-dependencies-{{ checksum "build.gradle.kts" }} + name: Download the bld dependencies + command: ./bld download - run: - name: Run All Checks - command: ./gradlew check - - store_artifacts: - path: build/reports/ - destination: reports - - store_test_results: - path: build/reports/ + name: Compile source with bld + command: ./bld compile + - run: + name: Run tests with bld + command: ./bld test jobs: - build_gradle_jdk18: + bld_jdk17: <<: *defaults docker: - - image: cimg/openjdk:18.0 + - image: cimg/openjdk:17.0 - <<: *defaults_gradle + <<: *defaults_bld - build_gradle_jdk11: + bld_jdk20: <<: *defaults docker: - - image: cimg/openjdk:11.0 + - image: cimg/openjdk:20.0 - <<: *defaults_gradle + <<: *defaults_bld workflows: version: 2 - gradle: - jobs: - - build_gradle_jdk11 - - build_gradle_jdk18 - + bld: + jobs: + - bld_jdk17 + - bld_jdk20 diff --git a/.github/workflows/bld.yml b/.github/workflows/bld.yml new file mode 100644 index 0000000..98772a8 --- /dev/null +++ b/.github/workflows/bld.yml @@ -0,0 +1,52 @@ +name: bld-ci + +on: [ push, pull_request, workflow_dispatch ] + +jobs: + build-bld-project: + runs-on: ubuntu-latest + + env: + COVERAGE_SDK: "17" + + strategy: + matrix: + java-version: [ 17, 20 ] + + steps: + - name: Checkout source repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up JDK ${{ matrix.java-version }} + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: ${{ matrix.java-version }} + + - name: Grant bld execute permission + run: chmod +x bld + + - name: Download the bld dependencies + run: ./bld download + + - name: Compile source with bld + run: ./bld compile + + - name: Run tests with bld + env: + AKISMET_BLOG: ${{ secrets.AKISMET_BLOG }} + AKISMET_API_KEY: ${{ secrets.AKISMET_API_KEY }} + run: ./bld jacoco + + - name: Remove pom.xml + if: success() && matrix.java-version == env.COVERAGE_SDK + run: rm -rf pom.xml + + - name: SonarCloud Scan + uses: sonarsource/sonarcloud-github-action@master + if: success() && matrix.java-version == env.COVERAGE_SDK + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml deleted file mode 100644 index 193e95b..0000000 --- a/.github/workflows/gradle.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: gradle-ci - -on: [ push, pull_request, workflow_dispatch ] - -jobs: - build: - runs-on: ubuntu-latest - - env: - GRADLE_OPTS: "-Dorg.gradle.jvmargs=-XX:MaxMetaspaceSize=512m" - SONAR_JDK: "17" - - strategy: - matrix: - java-version: [ 11, 17, 20 ] - - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Set up JDK ${{ matrix.java-version }} - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: ${{ matrix.java-version }} - - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - - name: Cache SonarCloud packages - if: matrix.java-version == env.SONAR_JDK - uses: actions/cache@v3 - with: - path: ~/.sonar/cache - key: ${{ runner.os }}-sonar - restore-keys: ${{ runner.os }}-sonar - - - name: Test with Gradle - uses: gradle/gradle-build-action@v2 - env: - AKISMET_BLOG: ${{ secrets.AKISMET_BLOG }} - AKISMET_API_KEY: ${{ secrets.AKISMET_API_KEY }} - with: - arguments: build check --stacktrace - - - name: SonarCloud - if: success() && matrix.java-version == env.SONAR_JDK - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: ./gradlew sonar --info diff --git a/.gitignore b/.gitignore index ac52a18..1808834 100644 --- a/.gitignore +++ b/.gitignore @@ -1,84 +1,61 @@ -!.vscode/extensions.json -!.vscode/launch.json -!.vscode/settings.json -!.vscode/tasks.json -*.class -*.code-workspace -*.ctxt -*.iws -*.log -*.nar -*.rar -*.sublime-* -*.tar.gz -*.zip -.DS_Store -.classpath .gradle -.history -.kobalt -.mtj.tmp/ -.mvn/timing.properties -.mvn/wrapper/maven-wrapper.jar -.nb-gradle -.project -.scannerwork -.settings -.vscode/* -/**/.idea/$CACHE_FILE$ -/**/.idea/$PRODUCT_WORKSPACE_FILE$ -/**/.idea/**/caches/build_file_checksums.ser -/**/.idea/**/contentModel.xml -/**/.idea/**/dataSources.ids -/**/.idea/**/dataSources.local.xml -/**/.idea/**/dataSources/ -/**/.idea/**/dbnavigator.xml -/**/.idea/**/dictionaries -/**/.idea/**/dynamic.xml -/**/.idea/**/gradle.xml -/**/.idea/**/httpRequests -/**/.idea/**/libraries -/**/.idea/**/mongoSettings.xml -/**/.idea/**/replstate.xml -/**/.idea/**/shelf -/**/.idea/**/shelf/ -/**/.idea/**/sonarlint* -/**/.idea/**/sqlDataSources.xml -/**/.idea/**/tasks.xml -/**/.idea/**/uiDesigner.xml -/**/.idea/**/usage.statistics.xml -/**/.idea/**/workspace.xml -/**/.idea_modules/ -Thumbs.db -__pycache__ +.DS_Store +build +lib/bld/** +!lib/bld/bld-wrapper.jar +!lib/bld/bld-wrapper.properties +lib/compile/ +lib/runtime/ +lib/standalone/ +lib/test/ + +# IDEA ignores + +# User-specific +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin atlassian-ide-plugin.xml -bin/ -build/ -cmake-build-*/ -com_crashlytics_export_strings.xml -crashlytics-build.properties -crashlytics.properties -dependency-reduced-pom.xml -deploy/ -dist/ -ehthumbs.db -fabric.properties -gen/ -hs_err_pid* -kobaltBuild -kobaltw*-test -lib/kotlin* -libs/ + +# Cursive Clojure plugin +.idea/replstate.xml + +# SonarLint plugin +.idea/sonarlint/ + +# Editor-based Rest Client +.idea/httpRequests + +bin +deploy +target local.properties -out/ -pom.xml.asc -pom.xml.next -pom.xml.releaseBackup -pom.xml.tag -pom.xml.versionsBackup -proguard-project.txt -project.properties -release.properties -target/ -test-output -venv + diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1601b0b..052df48 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,31 +1,11 @@ -image: gradle:8-jdk11 - -variables: - GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.jvmargs=-XX:MaxMetaspaceSize=512m" - -before_script: - - export GRADLE_USER_HOME=`pwd`/.gradle +image: openjdk:17 stages: - - build - test -build: - stage: build - script: gradle --build-cache assemble - cache: - key: "$CI_COMMIT_REF_NAME" - policy: push - paths: - - build - - .gradle - test: stage: test - script: gradle check - cache: - key: "$CI_COMMIT_REF_NAME" - policy: pull - paths: - - build - - .gradle + script: + - ./bld download + - ./bld compile + - ./bld test diff --git a/.idea/app.iml b/.idea/app.iml new file mode 100644 index 0000000..2c1fe21 --- /dev/null +++ b/.idea/app.iml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/bld.iml b/.idea/bld.iml new file mode 100644 index 0000000..e63e11e --- /dev/null +++ b/.idea/bld.iml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml deleted file mode 100644 index 3ad4dc5..0000000 --- a/.idea/codeStyles/Project.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml deleted file mode 100644 index 79ee123..0000000 --- a/.idea/codeStyles/codeStyleConfig.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml deleted file mode 100644 index fb7f4a8..0000000 --- a/.idea/compiler.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/copyright/BSD_3.xml b/.idea/copyright/BSD_3.xml new file mode 100644 index 0000000..ee0e59a --- /dev/null +++ b/.idea/copyright/BSD_3.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/copyright/Erik_s_Copyright_Notice.xml b/.idea/copyright/Erik_s_Copyright_Notice.xml deleted file mode 100644 index 9accf79..0000000 --- a/.idea/copyright/Erik_s_Copyright_Notice.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml index 1419e40..3203074 100644 --- a/.idea/copyright/profiles_settings.xml +++ b/.idea/copyright/profiles_settings.xml @@ -1,3 +1,3 @@ - + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml index 8ff795e..1e01b48 100644 --- a/.idea/inspectionProfiles/Project_Default.xml +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -1,53 +1,8 @@ \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml deleted file mode 100644 index dd5077a..0000000 --- a/.idea/jarRepositories.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml index f8467b4..0dd4b35 100644 --- a/.idea/kotlinc.xml +++ b/.idea/kotlinc.xml @@ -1,6 +1,6 @@ - - \ No newline at end of file diff --git a/.idea/libraries/bld.xml b/.idea/libraries/bld.xml new file mode 100644 index 0000000..ca84ff0 --- /dev/null +++ b/.idea/libraries/bld.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/.idea/libraries/compile.xml b/.idea/libraries/compile.xml new file mode 100644 index 0000000..9bd86aa --- /dev/null +++ b/.idea/libraries/compile.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/runtime.xml b/.idea/libraries/runtime.xml new file mode 100644 index 0000000..2ae5c4b --- /dev/null +++ b/.idea/libraries/runtime.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/test.xml b/.idea/libraries/test.xml new file mode 100644 index 0000000..b80486a --- /dev/null +++ b/.idea/libraries/test.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 1e1e260..6933af7 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,21 +1,14 @@ + - - - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..55adcb9 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/Run Tests.xml b/.idea/runConfigurations/Run Tests.xml new file mode 100644 index 0000000..a0f7cf6 --- /dev/null +++ b/.idea/runConfigurations/Run Tests.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..d32cf05 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,11 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "type": "java", + "name": "Run Tests", + "request": "launch", + "mainClass": "net.thauvin.erik.AkismetTest" + } + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..133aa45 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,15 @@ +{ + "java.project.sourcePaths": [ + "src/main/java", + "src/main/resources", + "src/test/java", + "src/bld/java" + ], + "java.configuration.updateBuildConfiguration": "automatic", + "java.project.referencedLibraries": [ + "${HOME}/.bld/dist/bld-1.7.5.jar", + "lib/compile/*.jar", + "lib/runtime/*.jar", + "lib/test/*.jar" + ] +} diff --git a/README.md b/README.md index fb401bc..f968ac8 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ [![License (3-Clause BSD)](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg?style=flat-square)](https://opensource.org/licenses/BSD-3-Clause) -[![Kotlin](https://img.shields.io/badge/kotlin-1.9.10-7f52ff)](https://kotlinlang.org/) +[![Kotlin](https://img.shields.io/badge/kotlin-1.9.20-7f52ff)](https://kotlinlang.org/) [![Release](https://img.shields.io/github/release/ethauvin/akismet-kotlin.svg)](https://github.com/ethauvin/akismet-kotlin/releases/latest) [![Nexus Snapshot](https://img.shields.io/nexus/s/net.thauvin.erik/akismet-kotlin?label=snapshot&server=https%3A%2F%2Foss.sonatype.org%2F)](https://oss.sonatype.org/content/repositories/snapshots/net/thauvin/erik/akismet-kotlin/) [![Maven Central](https://img.shields.io/maven-central/v/net.thauvin.erik/akismet-kotlin.svg?color=blue)](https://central.sonatype.com/artifact/net.thauvin.erik/akismet-kotlin) @@ -37,7 +37,7 @@ if (isSpam) { } ``` -[View Full Example](https://github.com/ethauvin/akismet-kotlin/blob/master/examples/src/main/kotlin/com/example/AkismetExample.kt) +[View Full Examples](https://github.com/ethauvin/akismet-kotlin/blob/master/examples) #### Java @@ -60,11 +60,22 @@ if (isSpam) { } ``` -[View Full Example](https://github.com/ethauvin/akismet-kotlin/blob/master/examples/src/main/java/com/example/AkismetSample.java) +[View Full Examples](https://github.com/ethauvin/akismet-kotlin/blob/master/examples) + +### bld + +To use with [bld](https://rife2.com/bld), include the following dependency in your [build](https://github.com/ethauvin/akismet-kotlin/blob/master/examples/bld/src/bld/java/com/example/ExampleBuild.java) file: + +```java +repositories = List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS_LEGACY); + +scope(compile) + .include(dependency("net.thauvin.erik:akismet-kotlin:1.0.0")); +``` ### Gradle -To use with [Gradle](https://gradle.org/), include the following dependency in your [build](https://github.com/ethauvin/akismet-kotlin/blob/master/examples/build.gradle.kts) file: +To use with [Gradle](https://gradle.org/), include the following dependency in your [build](https://github.com/ethauvin/akismet-kotlin/blob/master/examples/gradle/build.gradle.kts) file: ```gradle repositories { @@ -104,5 +115,6 @@ At a latter time, the comment can then be submitted: akismet.submitSpam(Akismet.jsonComment(json)) ``` -### More... +### More… + If all else fails, there's always more [Documentation](https://ethauvin.github.io/akismet-kotlin/). diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index a9514a0..7c85194 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -1,9 +1,10 @@ -image: maven:3-openjdk-18 +image: openjdk:17 pipelines: default: - step: - caches: - - gradle + name: Test with bld script: - - bash ./gradlew check + - ./bld download + - ./bld compile + - ./bld test diff --git a/bld b/bld new file mode 100755 index 0000000..f9906e9 --- /dev/null +++ b/bld @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +java -jar "$(dirname "$0")/lib/bld/bld-wrapper.jar" "$0" --build net.thauvin.erik.AkismetBuild "$@" \ No newline at end of file diff --git a/bld.bat b/bld.bat new file mode 100644 index 0000000..5a0f2a2 --- /dev/null +++ b/bld.bat @@ -0,0 +1,4 @@ +@echo off +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +java -jar "%DIRNAME%/lib/bld/bld-wrapper.jar" "%0" --build net.thauvin.erik.AkismetBuild %* \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts deleted file mode 100644 index 144ac06..0000000 --- a/build.gradle.kts +++ /dev/null @@ -1,273 +0,0 @@ -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile -import java.net.URL -import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask -import org.gradle.api.tasks.testing.logging.TestExceptionFormat -import org.gradle.api.tasks.testing.logging.TestLogEvent - -plugins { - id("com.github.ben-manes.versions") version "0.48.0" - id("io.gitlab.arturbosch.detekt") version "1.23.1" - id("java-library") - id("java") - id("maven-publish") - id("net.thauvin.erik.gradle.semver") version "1.0.4" - id("org.jetbrains.dokka") version "1.9.0" - id("org.jetbrains.kotlinx.kover") version "0.7.3" - id("org.sonarqube") version "4.3.1.3277" - id("signing") - kotlin("jvm") version "1.9.10" - kotlin("kapt") version "1.9.10" - kotlin("plugin.serialization") version "1.9.10" -} - -group = "net.thauvin.erik" -description = "A client library for accessing the Automattic Kismet (Akismet) spam comments filtering service." - -val gitHub = "ethauvin/$name" -val mavenUrl = "https://github.com/$gitHub" -val deployDir = "deploy" -var isRelease = "release" in gradle.startParameter.taskNames - -var semverProcessor = "net.thauvin.erik:semver:1.2.0" - -val publicationName = "mavenJava" - -object Versions { - const val OKHTTP = "4.11.0" -} - -fun isNonStable(version: String): Boolean { - val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { version.uppercase().contains(it) } - val regex = "^[0-9,.v-]+(-r)?$".toRegex() - val isStable = stableKeyword || regex.matches(version) - return isStable.not() -} - -repositories { - mavenCentral() - maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots") } -} - -dependencies { - kapt(semverProcessor) - compileOnly(semverProcessor) - - implementation(platform("org.jetbrains.kotlin:kotlin-bom")) - -// implementation("javax.servlet:javax.servlet-api:4.0.1") - implementation("jakarta.servlet:jakarta.servlet-api:6.0.0") - - - implementation("com.squareup.okhttp3:okhttp:${Versions.OKHTTP}") - implementation("com.squareup.okio:okio:3.5.0") - implementation("com.squareup.okhttp3:logging-interceptor:${Versions.OKHTTP}") - - implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0") - - testImplementation("org.mockito:mockito-core:5.5.0") - testImplementation("org.testng:testng:7.8.0") - testImplementation("com.willowtreeapps.assertk:assertk-jvm:0.27.0") -} - -kapt { - arguments { - arg("semver.project.dir", projectDir) - } -} - -detekt { - //toolVersion = "main-SNAPSHOT" - baseline = project.rootDir.resolve("config/detekt/baseline.xml") -} - -java { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 - withSourcesJar() -} - -koverReport { - defaults { - xml { - onCheck = true - } - html { - onCheck = true - } - } -} - -sonarqube { - properties { - property("sonar.projectKey", "ethauvin_$name") - property("sonar.organization", "ethauvin-github") - property("sonar.host.url", "https://sonarcloud.io") - property("sonar.sourceEncoding", "UTF-8") - property("sonar.coverage.jacoco.xmlReportPaths", "${layout.buildDirectory.get()}/reports/kover/report.xml") - } -} - -val javadocJar by tasks.creating(Jar::class) { - dependsOn(tasks.dokkaJavadoc) - from(tasks.dokkaJavadoc) - archiveClassifier.set("javadoc") - description = "Assembles a JAR of the generated Javadoc." - group = JavaBasePlugin.DOCUMENTATION_GROUP -} - -tasks { - withType { - testLogging { - exceptionFormat = TestExceptionFormat.FULL - events = setOf(TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.FAILED) - } - - useTestNG() - } - - withType().configureEach { - kotlinOptions.jvmTarget = java.targetCompatibility.toString() - } - - withType { - destination = file("$projectDir/pom.xml") - } - - withType { - rejectVersionIf { - isNonStable(candidate.version) - } - } - - assemble { - dependsOn(javadocJar) - } - - clean { - doLast { - project.delete(fileTree(deployDir)) - } - } - - dokkaHtml { - dependsOn("kaptKotlin") - outputDirectory.set(file("$projectDir/docs")) - - dokkaSourceSets { - configureEach { - includes.from("config/dokka/packages.md") - sourceLink { - localDirectory.set(file("src/main/kotlin/")) - remoteUrl.set(URL("https://github.com/ethauvin/${project.name}/tree/master/src/main/kotlin/")) - remoteLineSuffix.set("#L") - } - externalDocumentationLink { - url.set(URL("https://jakarta.ee/specifications/platform/9/apidocs/")) - } - } - } - } - - dokkaJavadoc { - dependsOn(dokkaHtml) - dokkaSourceSets { - configureEach { - includes.from("config/dokka/packages.md") - externalDocumentationLink { - url.set(URL("https://jakarta.ee/specifications/platform/9/apidocs/")) - } - } - } - } - - val copyToDeploy by registering(Copy::class) { - from(configurations.runtimeClasspath) { - exclude("annotations-*.jar", "jakarta.servlet-*.jar") - } - from(jar) - into(deployDir) - } - - register("deploy") { - description = "Copies all needed files to the $deployDir directory." - group = PublishingPlugin.PUBLISH_TASK_GROUP - dependsOn(clean, build, jar) - outputs.dir(deployDir) - inputs.files(copyToDeploy) - mustRunAfter(clean) - } - - val gitIsDirty by registering(Exec::class) { - description = "Fails if git has uncommitted changes." - group = "verification" - commandLine("git", "diff", "--quiet", "--exit-code") - } - - val gitTag by registering(Exec::class) { - description = "Tags the local repository with version ${project.version}" - group = PublishingPlugin.PUBLISH_TASK_GROUP - dependsOn(gitIsDirty) - if (isRelease) { - commandLine("git", "tag", "-a", project.version, "-m", "Version ${project.version}") - } - } - - register("release") { - description = "Publishes version ${project.version} to local repository." - group = PublishingPlugin.PUBLISH_TASK_GROUP - dependsOn("deploy", gitTag, publishToMavenLocal) - } -} - -publishing { - publications { - create(publicationName) { - from(components["java"]) - artifact(javadocJar) - pom { - name.set(project.name) - description.set(project.description) - url.set(mavenUrl) - licenses { - license { - name.set("BSD 3-Clause") - url.set("https://opensource.org/licenses/BSD-3-Clause") - } - } - developers { - developer { - id.set("ethauvin") - name.set("Erik C. Thauvin") - email.set("erik@thauvin.net") - url.set("https://erik.thauvin.net/") - } - } - scm { - connection.set("scm:git:https://github.com/$gitHub.git") - developerConnection.set("scm:git:git@github.com:$gitHub.git") - url.set(mavenUrl) - } - issueManagement { - system.set("GitHub") - url.set("$mavenUrl/issues") - } - } - } - } - repositories { - maven { - name = "ossrh" - project.afterEvaluate { - url = if (project.version.toString().contains("SNAPSHOT")) - uri("https://oss.sonatype.org/content/repositories/snapshots/") else - uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/") - } - credentials(PasswordCredentials::class) - } - } -} - -signing { - useGpgCmd() - sign(publishing.publications[publicationName]) -} diff --git a/config/dokka/packages.md b/config/dokka/packages.md index 138c3a1..0183a6f 100644 --- a/config/dokka/packages.md +++ b/config/dokka/packages.md @@ -2,7 +2,7 @@ [Akismet for Kotlin/Java](https://github.com/ethauvin/akismet-kotlin), a client library for accessing the [Automattic Kismet](https://www.akismet.com/) (Akismet) spam comments filtering service. -# package net.thauvin.erik.akismet +# Package net.thauvin.erik.akismet A Kotlin/Java library for accessing the Akismet service. diff --git a/docs/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/-akismet-comment.html b/docs/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/-akismet-comment.html similarity index 52% rename from docs/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/-akismet-comment.html rename to docs/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/-akismet-comment.html index af49898..3013bd1 100644 --- a/docs/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/-akismet-comment.html +++ b/docs/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/-akismet-comment.html @@ -41,14 +41,14 @@
-1.0.0
+1.0.1-SNAPSHOT
- +
-
- +
+

AkismetComment

-
constructor(request: HttpServletRequest)(source)

Creates a new instance extracting the userIp, userAgent, referrer and serverEnv environment variables from a Servlet request.

See the Akismet API for more details.

See also


constructor(userIp: String, userAgent: String)(source)

Creates a new instance.

See the Akismet API for more details.

Parameters

userIp

IP address of the comment submitter.

userAgent

User agent string of the web browser submitting the comment.

+
constructor(request: <Error class: unknown class>)(source)

Creates a new instance extracting the userIp, userAgent, referrer and serverEnv environment variables from a Servlet request.

See the Akismet API for more details.

See also


constructor(userIp: String, userAgent: String)(source)

Creates a new instance.

See the Akismet API for more details.

Parameters

userIp

IP address of the comment submitter.

userAgent

User agent string of the web browser submitting the comment.

- +
-
- +
+

ADMIN_ROLE

-

Administrator role. If used, Akismet will always return false.

+

Administrator role. If used, Akismet will always return false.

- +
-
- +
+

TYPE_BLOG_POST

-

A blog post.

+

A blog post.

- +
-
- +
+

TYPE_COMMENT

-

A blog comment.

+

A blog comment.

- +
-
- +
+

TYPE_CONTACT_FORM

-

A contact form or feedback form submission.

+

A contact form or feedback form submission.

- +
-
- +
+

TYPE_FORUM_POST

-

A top-level forum post.

+

A top-level forum post.

- +
-
- +
+

TYPE_MESSAGE

-

A message sent between just a few users.

+

A message sent between just a few users.

- +
-
- +
+

TYPE_PINGBACK

-

A pingback.

+

A pingback.

- +
-
- +
+

TYPE_REPLY

-

A reply to a top-level forum post.

+

A reply to a top-level forum post.

- +
-
- +
+

TYPE_SIGNUP

-

A new user account.

+

A new user account.

- +
-
- +
+

TYPE_TRACKBACK

-

A trackback.

+

A trackback.

- +
-
- +
+

TYPE_TWEET

-

A Twitter message.

+

A Twitter message.

- +
-
- +
+

Companion

- +

Properties

-
-
+
+
- +
Link copied to clipboard
-
const val ADMIN_ROLE: String

Administrator role. If used, Akismet will always return false.

+
const val ADMIN_ROLE: String

Administrator role. If used, Akismet will always return false.

- -
+ +
- +
Link copied to clipboard
-

A blog post.

+

A blog post.

- -
+ +
- +
Link copied to clipboard
-
const val TYPE_COMMENT: String

A blog comment.

+
const val TYPE_COMMENT: String

A blog comment.

- -
+ +
- +
Link copied to clipboard
-

A contact form or feedback form submission.

+

A contact form or feedback form submission.

- -
+ +
- +
Link copied to clipboard
-

A top-level forum post.

+

A top-level forum post.

- -
+ +
- +
Link copied to clipboard
-
const val TYPE_MESSAGE: String

A message sent between just a few users.

+
const val TYPE_MESSAGE: String

A message sent between just a few users.

- -
+ +
- +
Link copied to clipboard
-

A pingback.

+

A pingback.

- -
+ +
- +
Link copied to clipboard
-
const val TYPE_REPLY: String

A reply to a top-level forum post.

+
const val TYPE_REPLY: String

A reply to a top-level forum post.

- -
+ +
- +
Link copied to clipboard
-
const val TYPE_SIGNUP: String

A new user account.

+
const val TYPE_SIGNUP: String

A new user account.

- -
+ +
- +
Link copied to clipboard
-

A trackback.

+

A trackback.

- -
+ +
- +
Link copied to clipboard
-
const val TYPE_TWEET: String

A Twitter message.

+
const val TYPE_TWEET: String

A Twitter message.

diff --git a/docs/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/author-email.html b/docs/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/author-email.html similarity index 79% rename from docs/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/author-email.html rename to docs/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/author-email.html index 1caea15..32b3e8e 100644 --- a/docs/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/author-email.html +++ b/docs/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/author-email.html @@ -41,14 +41,14 @@
-1.0.0
+1.0.1-SNAPSHOT
- +
-
- +
+

authorEmail

-

Email address submitted with the comment.

+

Email address submitted with the comment.

- +
-
- +
+

authorUrl

-

URL submitted with comment.

+

URL submitted with comment.

- +
-
- +
+

author

-

Name submitted with the comment.

+

Name submitted with the comment.

- +
-
- +
+

blogCharset

-

The character encoding for the form values included in comment parameters, such as UTF-8 or ISO-8859-1

+

The character encoding for the form values included in comment parameters, such as UTF-8 or ISO-8859-1

- +
-
- +
+

blogLang

-

Indicates the language(s) in use on the blog or site, in ISO 639-1 format, comma-separated.

A site with articles in English and French might use: en, fr_ca

+

Indicates the language(s) in use on the blog or site, in ISO 639-1 format, comma-separated.

A site with articles in English and French might use: en, fr_ca

- +
-
- +
+

content

-

The content that was submitted.

+

The content that was submitted.

- +
-
- +
+

dateGmt

-

The UTC timestamp of the creation of the comment, in ISO 8601 format.

May be omitted if the comment is sent to the API at the time it is created.

See also

+

The UTC timestamp of the creation of the comment, in ISO 8601 format.

May be omitted if the comment is sent to the API at the time it is created.

See also

- +
-
- +
+

equals

-
open operator override fun equals(other: Any?): Boolean(source)

Indicates whether some other object is equal to this one.

+
open operator override fun equals(other: Any?): Boolean(source)

Indicates whether some other object is equal to this one.

- +
-
- +
+

hashCode

-
open override fun hashCode(): Int(source)

Returns a hash code value for the object.

+
open override fun hashCode(): Int(source)

Returns a hash code value for the object.

- +
-
- +
+

AkismetComment

-
@Serializable
open class AkismetComment(val userIp: String, val userAgent: String)(source)

A comment to send to Akismet.

Most everything is optional. Performance can drop dramatically if you choose to exclude data points. The more data you send Akismet about each comment, the greater the accuracy. They recommend erring on the side of including too much data.

See the Akismet API for more details.

Parameters

userIp

IP address of the comment submitter.

userAgent

User agent string of the web browser submitting the comment.

+
open class AkismetComment(val userIp: String, val userAgent: String)(source)

A comment to send to Akismet.

Most everything is optional. Performance can drop dramatically if you choose to exclude data points. The more data you send Akismet about each comment, the greater the accuracy. They recommend erring on the side of including too much data.

See the Akismet API for more details.

Parameters

userIp

IP address of the comment submitter.

userAgent

User agent string of the web browser submitting the comment.

Constructors

-
-
+
+
- +
Link copied to clipboard
-
constructor(request: HttpServletRequest)

Creates a new instance extracting the userIp, userAgent, referrer and serverEnv environment variables from a Servlet request.

constructor(userIp: String, userAgent: String)

Creates a new instance.

+
constructor(request: <Error class: unknown class>)

Creates a new instance extracting the userIp, userAgent, referrer and serverEnv environment variables from a Servlet request.

constructor(userIp: String, userAgent: String)

Creates a new instance.

@@ -91,17 +91,17 @@

Types

-
-
+
+
- +
Link copied to clipboard
-
object Companion
+
object Companion
@@ -110,257 +110,257 @@

Properties

-
-
+
+
- +
Link copied to clipboard
-

Name submitted with the comment.

+

Name submitted with the comment.

- -
+ +
- +
Link copied to clipboard
-

Email address submitted with the comment.

+

Email address submitted with the comment.

- -
+ +
- +
Link copied to clipboard
-

URL submitted with comment.

+

URL submitted with comment.

- -
+ +
- +
Link copied to clipboard
-

The character encoding for the form values included in comment parameters, such as UTF-8 or ISO-8859-1

+

The character encoding for the form values included in comment parameters, such as UTF-8 or ISO-8859-1

- -
+ +
- +
Link copied to clipboard
-

Indicates the language(s) in use on the blog or site, in ISO 639-1 format, comma-separated.

+

Indicates the language(s) in use on the blog or site, in ISO 639-1 format, comma-separated.

- -
+ +
- +
Link copied to clipboard
-

The content that was submitted.

+

The content that was submitted.

- -
+ +
- +
Link copied to clipboard
-

The UTC timestamp of the creation of the comment, in ISO 8601 format.

+

The UTC timestamp of the creation of the comment, in ISO 8601 format.

- -
+ +
- +
Link copied to clipboard
-

This is an optional parameter. You can use it when submitting test queries to Akismet.

+

This is an optional parameter. You can use it when submitting test queries to Akismet.

- -
+ +
- +
Link copied to clipboard
-

The full permanent URL of the entry the comment was submitted to.

+

The full permanent URL of the entry the comment was submitted to.

- -
+ +
- +
Link copied to clipboard
-

The UTC timestamp of the publication time for the post, page or thread on which the comment was posted.

+

The UTC timestamp of the publication time for the post, page or thread on which the comment was posted.

- -
+ +
- +
Link copied to clipboard
-

If you are sending content to Akismet to be rechecked, such as a post that has been edited or old pending comments that you'd like to recheck, include this parameter with a string describing why the content is being rechecked.

+

If you are sending content to Akismet to be rechecked, such as a post that has been edited or old pending comments that you'd like to recheck, include this parameter with a string describing why the content is being rechecked.

- -
+ +
- +
Link copied to clipboard
-

The content of the referer header should be set here.

+

The content of the referer header should be set here.

- -
+ +
- +
Link copied to clipboard
-

In PHP, there is an array of environmental variables called $_SERVER that contains information about the Web server itself as well as a key/value for every HTTP header sent with the request. This data is highly useful to Akismet.

+

In PHP, there is an array of environmental variables called $_SERVER that contains information about the Web server itself as well as a key/value for every HTTP header sent with the request. This data is highly useful to Akismet.

- -
+ +
- +
Link copied to clipboard
-
var type: String?

A string that describes the type of content being sent, such as:

+
var type: String?

A string that describes the type of content being sent, such as:

- -
+ +
- +
Link copied to clipboard
- -
+ +
- +
Link copied to clipboard
- +
- -
+ +
- +
Link copied to clipboard
-

The user role of the user who submitted the comment. This is an optional parameter.

+

The user role of the user who submitted the comment. This is an optional parameter.

@@ -369,62 +369,62 @@

Functions

-
-
+
+
- +
Link copied to clipboard
-
open operator override fun equals(other: Any?): Boolean

Indicates whether some other object is equal to this one.

+
open operator override fun equals(other: Any?): Boolean

Indicates whether some other object is equal to this one.

- -
+ +
- +
Link copied to clipboard
-
open override fun hashCode(): Int

Returns a hash code value for the object.

+
open override fun hashCode(): Int

Returns a hash code value for the object.

- -
+ +
- +
Link copied to clipboard
-
fun toJson(): String

Returns a JSON representation of the comment.

+
fun toJson(): String

Returns a JSON representation of the comment.

- -
+ +
- +
Link copied to clipboard
-
open override fun toString(): String

Returns a JSON representation of the comment.

+
open override fun toString(): String

Returns a JSON representation of the comment.

diff --git a/docs/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/is-test.html b/docs/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/is-test.html similarity index 79% rename from docs/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/is-test.html rename to docs/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/is-test.html index d67c2e9..58cc1e9 100644 --- a/docs/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/is-test.html +++ b/docs/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/is-test.html @@ -41,14 +41,14 @@
-1.0.0
+1.0.1-SNAPSHOT
- +
-
- +
+

isTest

-

This is an optional parameter. You can use it when submitting test queries to Akismet.

+

This is an optional parameter. You can use it when submitting test queries to Akismet.

- +
-
- +
+

permalink

-

The full permanent URL of the entry the comment was submitted to.

+

The full permanent URL of the entry the comment was submitted to.

- +
-
- +
+

postModifiedGmt

-

The UTC timestamp of the publication time for the post, page or thread on which the comment was posted.

See also

+

The UTC timestamp of the publication time for the post, page or thread on which the comment was posted.

See also

- +
-
- +
+

recheckReason

-

If you are sending content to Akismet to be rechecked, such as a post that has been edited or old pending comments that you'd like to recheck, include this parameter with a string describing why the content is being rechecked.

For example: edit

+

If you are sending content to Akismet to be rechecked, such as a post that has been edited or old pending comments that you'd like to recheck, include this parameter with a string describing why the content is being rechecked.

For example: edit

- +
-
- +
+

referrer

-

The content of the referer header should be set here.

+

The content of the referer header should be set here.

- +
-
- +
+

serverEnv

-

In PHP, there is an array of environmental variables called $_SERVER that contains information about the Web server itself as well as a key/value for every HTTP header sent with the request. This data is highly useful to Akismet.

How the submitted content interacts with the server can be very telling, so please include as much of it as possible.

+

In PHP, there is an array of environmental variables called $_SERVER that contains information about the Web server itself as well as a key/value for every HTTP header sent with the request. This data is highly useful to Akismet.

How the submitted content interacts with the server can be very telling, so please include as much of it as possible.

- +
-
- +
+

toJson

-

Returns a JSON representation of the comment.

See also

+

Returns a JSON representation of the comment.

See also

- +
-
- +
+

toString

-
open override fun toString(): String(source)

Returns a JSON representation of the comment.

See also

+
open override fun toString(): String(source)

Returns a JSON representation of the comment.

See also

- +
-
- +
+

type

-

A string that describes the type of content being sent, such as:

You may send a value not listed above if none of them accurately describe your content.

This is further explained here.

+

A string that describes the type of content being sent, such as:

You may send a value not listed above if none of them accurately describe your content.

This is further explained here.

- +
-
- +
+

userAgent

-

Parameters

userAgent

User agent string of the web browser submitting the comment.

+

Parameters

userAgent

User agent string of the web browser submitting the comment.

- +
-
- +
+

userIp

-

Parameters

userIp

IP address of the comment submitter.

+

Parameters

userIp

IP address of the comment submitter.

- +
-
- +
+

userRole

-

The user role of the user who submitted the comment. This is an optional parameter.

If you set it to ADMIN_ROLE, Akismet will always return false.

+

The user role of the user who submitted the comment. This is an optional parameter.

If you set it to ADMIN_ROLE, Akismet will always return false.

- +
-
- +
+

Akismet

-
constructor(apiKey: String, blog: String)(source)

Creates a new instance using an Akismet API key and URL registered with Akismet.


constructor(apiKey: String)(source)

Creates a new instance using the provided Akismet API key.

+
constructor(apiKey: String, blog: String)(source)

Creates a new instance using an Akismet API key and URL registered with Akismet.


constructor(apiKey: String)(source)

Creates a new instance using the provided Akismet API key.

- +
-
- +
+

dateToGmt

-

Converts a date to a UTC timestamp. (ISO 8601)

See also


Converts a locale date/time to a UTC timestamp. (ISO 8601)

See also

+

Converts a date to a UTC timestamp. (ISO 8601)

See also


Converts a locale date/time to a UTC timestamp. (ISO 8601)

See also

- +
-
- +
+

Companion

- +

Functions

-
-
+
+
- +
Link copied to clipboard
-

Converts a locale date/time to a UTC timestamp. (ISO 8601)

Converts a date to a UTC timestamp. (ISO 8601)

+

Converts a locale date/time to a UTC timestamp. (ISO 8601)

fun dateToGmt(date: Date): String

Converts a date to a UTC timestamp. (ISO 8601)

- -
+ +
- +
Link copied to clipboard
-

(Re)Creates a comment from a JSON string.

+

(Re)Creates a comment from a JSON string.

diff --git a/docs/akismet-kotlin/net.thauvin.erik.akismet/-akismet/-companion/json-comment.html b/docs/-akismet -kotlin/net.thauvin.erik.akismet/-akismet/-companion/json-comment.html similarity index 67% rename from docs/akismet-kotlin/net.thauvin.erik.akismet/-akismet/-companion/json-comment.html rename to docs/-akismet -kotlin/net.thauvin.erik.akismet/-akismet/-companion/json-comment.html index a01d046..eeb9e5d 100644 --- a/docs/akismet-kotlin/net.thauvin.erik.akismet/-akismet/-companion/json-comment.html +++ b/docs/-akismet -kotlin/net.thauvin.erik.akismet/-akismet/-companion/json-comment.html @@ -41,14 +41,14 @@
-1.0.0
+1.0.1-SNAPSHOT
- +
-
- +
+

jsonComment

-

(Re)Creates a comment from a JSON string.

See also

+

(Re)Creates a comment from a JSON string.

See also

- +
-
- +
+

appUserAgent

-

The application user agent to be sent to Akismet.

If possible, the application user agent string should always use the following format:

    Application Name/Version

The library's own user agent string will automatically be appended.

See the Akismet API for more details.

+

The application user agent to be sent to Akismet.

If possible, the application user agent string should always use the following format:

    Application Name/Version

The library's own user agent string will automatically be appended.

See the Akismet API for more details.

- +
-
- +
+

blog

-

The URL registered with Akismet.

+

The URL registered with Akismet.

- +
-
- +
+

checkComment

-
fun checkComment(comment: AkismetComment, trueOnError: Boolean = false): Boolean(source)

Comment Check.

This is the call you will make the most. It takes a number of arguments and characteristics about the submitted content and then returns a thumbs up or thumbs down. Performance can drop dramatically if you choose to exclude data points. The more data you send Akismet about each comment, the greater the accuracy. They recommend erring on the side of including too much data

By default, if an error (IO, empty response from Akismet, etc.) occurs the function will return false and log the error, use the trueOnError parameter to change this behavior.

See the Akismet API for more details.

Return

true if the comment is spam, false if the comment is not.

Parameters

trueOnError

Set to return true on error.

+
fun checkComment(comment: AkismetComment, trueOnError: Boolean = false): Boolean(source)

Comment Check.

This is the call you will make the most. It takes a number of arguments and characteristics about the submitted content and then returns a thumbs up or thumbs down. Performance can drop dramatically if you choose to exclude data points. The more data you send Akismet about each comment, the greater the accuracy. They recommend erring on the side of including too much data

By default, if an error (IO, empty response from Akismet, etc.) occurs the function will return false and log the error, use the trueOnError parameter to change this behavior.

See the Akismet API for more details.

Return

true if the comment is spam, false if the comment is not.

Parameters

trueOnError

Set to return true on error.

- +
-
- +
+
-

proTip

+

debugHelp

-

The x-akismet-pro-tip header from the last operation, if any.

If the x-akismet-pro-tip header is set to discard, then Akismet has determined that the comment is blatant spam, and you can safely discard it without saving it in any spam queue.

See the Akismet API for more details.

See also

+

The x-akismet-debug-help header from the last operation, if any.

If the call returns neither true nor false, the x-akismet-debug-help header will provide context for any error that has occurred.

Note that the x-akismet-debug-help header will not always be sent if a response does not return false or true.

See the Akismet API for more details.

- +
-
- +
+

errorMessage

-

The error message.

The error (IO, empty response from Akismet, etc.) message is also logged as a warning.

See also

+

The error message.

The error (IO, empty response from Akismet, etc.) message is also logged as a warning.

See also

- +
-
- +
+

executeMethod

-
fun executeMethod(apiUrl: HttpUrl, formBody: FormBody, trueOnError: Boolean = false): Boolean(source)

Executes a call to an Akismet REST API method.

Parameters

apiUrl

The Akismet API URL endpoint. (e.g. https://rest.akismet.com/1.1/verify-key)

formBody

The HTTP POST form body containing the request parameters to be submitted.

trueOnError

Set to return true on error (IO, empty response, etc.)

+
fun executeMethod(apiUrl: <Error class: unknown class>, formBody: <Error class: unknown class>, trueOnError: Boolean = false): Boolean(source)

Executes a call to an Akismet REST API method.

Parameters

apiUrl

The Akismet API URL endpoint. (e.g. https://rest.akismet.com/1.1/verify-key)

formBody

The HTTP POST form body containing the request parameters to be submitted.

trueOnError

Set to return true on error (IO, empty response, etc.)

- +
-
- +
+

httpStatusCode

-

The HTTP status code of the last operation.

+

The HTTP status code of the last operation.

- +
-
- +
+

Akismet

-
open class Akismet(apiKey: String)(source)

Provides access to the Akismet API.

+
open class Akismet(apiKey: String)(source)

Provides access to the Akismet API.

Constructors

-
-
+
+
- +
Link copied to clipboard
-
constructor(apiKey: String, blog: String)

Creates a new instance using an Akismet API key and URL registered with Akismet.

constructor(apiKey: String)

Creates a new instance using the provided Akismet API key.

+
constructor(apiKey: String, blog: String)

Creates a new instance using an Akismet API key and URL registered with Akismet.

constructor(apiKey: String)

Creates a new instance using the provided Akismet API key.

@@ -91,17 +91,17 @@

Types

-
-
+
+
- +
Link copied to clipboard
-
object Companion
+
object Companion
@@ -110,152 +110,152 @@

Properties

-
-
+
+
- +
Link copied to clipboard
-

The application user agent to be sent to Akismet.

+

The application user agent to be sent to Akismet.

- -
+ +
- +
Link copied to clipboard
-

The URL registered with Akismet.

+

The URL registered with Akismet.

- -
+ +
- +
Link copied to clipboard
-

The x-akismet-debug-help header from the last operation, if any.

+

The x-akismet-debug-help header from the last operation, if any.

- -
+ +
- +
Link copied to clipboard
-

The error message.

+

The error message.

- -
+ +
- +
Link copied to clipboard
-

The HTTP status code of the last operation.

+

The HTTP status code of the last operation.

- -
+ +
- +
Link copied to clipboard
-

Set to true if Akismet has determined that the last checked comment is blatant spam, and you can safely discard it without saving it in any spam queue.

+

Set to true if Akismet has determined that the last checked comment is blatant spam, and you can safely discard it without saving it in any spam queue.

- -
+ +
- +
Link copied to clipboard
-

Set to true if the API Key has been verified.

+

Set to true if the API Key has been verified.

- -
+ +
- +
Link copied to clipboard
-

The logger instance.

+

The logger instance.

- -
+ +
- +
Link copied to clipboard
-

The x-akismet-pro-tip header from the last operation, if any.

+

The x-akismet-pro-tip header from the last operation, if any.

- -
+ +
- +
Link copied to clipboard
-

The actual response sent by Akismet from the last operation.

+

The actual response sent by Akismet from the last operation.

@@ -264,92 +264,92 @@

Functions

-
-
+
+
- +
Link copied to clipboard
-
fun checkComment(comment: AkismetComment, trueOnError: Boolean = false): Boolean

Comment Check.

+
fun checkComment(comment: AkismetComment, trueOnError: Boolean = false): Boolean

Comment Check.

- -
+ +
- +
Link copied to clipboard
-
fun executeMethod(apiUrl: HttpUrl, formBody: FormBody, trueOnError: Boolean = false): Boolean

Executes a call to an Akismet REST API method.

+
fun executeMethod(apiUrl: <Error class: unknown class>, formBody: <Error class: unknown class>, trueOnError: Boolean = false): Boolean

Executes a call to an Akismet REST API method.

- -
+ +
- +
Link copied to clipboard
- -
+ +
- +
Link copied to clipboard
-

Submit Ham. (False Positives)

+

Submit Ham. (False Positives)

- -
+ +
- +
Link copied to clipboard
-

Submit Spam. (Missed Spam)

+

Submit Spam. (Missed Spam)

- -
+ +
- +
Link copied to clipboard
-

Key Verification.

+

Key Verification.

diff --git a/docs/akismet-kotlin/net.thauvin.erik.akismet/-akismet/is-discard.html b/docs/-akismet -kotlin/net.thauvin.erik.akismet/-akismet/is-discard.html similarity index 71% rename from docs/akismet-kotlin/net.thauvin.erik.akismet/-akismet/is-discard.html rename to docs/-akismet -kotlin/net.thauvin.erik.akismet/-akismet/is-discard.html index 54ea4e6..ae2d654 100644 --- a/docs/akismet-kotlin/net.thauvin.erik.akismet/-akismet/is-discard.html +++ b/docs/-akismet -kotlin/net.thauvin.erik.akismet/-akismet/is-discard.html @@ -41,14 +41,14 @@
-1.0.0
+1.0.1-SNAPSHOT
- +
-
- +
+

isDiscard

-

Set to true if Akismet has determined that the last checked comment is blatant spam, and you can safely discard it without saving it in any spam queue.

See the Akismet API for more details.

See also

+

Set to true if Akismet has determined that the last checked comment is blatant spam, and you can safely discard it without saving it in any spam queue.

See the Akismet API for more details.

See also

- +
-
- +
+

isVerifiedKey

-

Set to true if the API Key has been verified.

See also

+

Set to true if the API Key has been verified.

See also

- +
-
- +
+

logger

-

The logger instance.

+

The logger instance.

- +
-
- +
+
-

debugHelp

+

proTip

-

The x-akismet-debug-help header from the last operation, if any.

If the call returns neither true nor false, the x-akismet-debug-help header will provide context for any error that has occurred.

Note that the x-akismet-debug-help header will not always be sent if a response does not return false or true.

See the Akismet API for more details.

+

The x-akismet-pro-tip header from the last operation, if any.

If the x-akismet-pro-tip header is set to discard, then Akismet has determined that the comment is blatant spam, and you can safely discard it without saving it in any spam queue.

See the Akismet API for more details.

See also

- +
-
- +
+

reset

- +
- +
-
- +
+

response

-

The actual response sent by Akismet from the last operation.

For example: true, false, valid, invalid, etc.

+

The actual response sent by Akismet from the last operation.

For example: true, false, valid, invalid, etc.

- +
-
- +
+

submitHam

-

Submit Ham. (False Positives)

This call is intended for the submission of false positives - items that were incorrectly classified as spam by Akismet. It takes identical arguments as comment check and submit spam.

It is very important that the values you submit with this call match those of your comment check calls as closely as possible. In order to learn from its mistakes, Akismet needs to match your missed spam and false positive reports to the original comment-check API calls made when the content was first posted. While it is normal for less information to be available for submit-spam and submit-ham calls (most comment systems and forums will not store all metadata), you should ensure that the values that you do send match those of the original content.

See the Akismet API for more details.

Return

true if the comment was submitted, false otherwise.

+

Submit Ham. (False Positives)

This call is intended for the submission of false positives - items that were incorrectly classified as spam by Akismet. It takes identical arguments as comment check and submit spam.

It is very important that the values you submit with this call match those of your comment check calls as closely as possible. In order to learn from its mistakes, Akismet needs to match your missed spam and false positive reports to the original comment-check API calls made when the content was first posted. While it is normal for less information to be available for submit-spam and submit-ham calls (most comment systems and forums will not store all metadata), you should ensure that the values that you do send match those of the original content.

See the Akismet API for more details.

Return

true if the comment was submitted, false otherwise.

- +
-
- +
+

submitSpam

-

Submit Spam. (Missed Spam)

This call is for submitting comments that weren't marked as spam but should have been.

It is very important that the values you submit with this call match those of your comment check calls as closely as possible. In order to learn from its mistakes, Akismet needs to match your missed spam and false positive reports to the original comment-check API calls made when the content was first posted. While it is normal for less information to be available for submit-spam and submit-ham calls (most comment systems and forums will not store all metadata), you should ensure that the values that you do send match those of the original content.

See the Akismet API for more details.

Return

true if the comment was submitted, false otherwise.

+

Submit Spam. (Missed Spam)

This call is for submitting comments that weren't marked as spam but should have been.

It is very important that the values you submit with this call match those of your comment check calls as closely as possible. In order to learn from its mistakes, Akismet needs to match your missed spam and false positive reports to the original comment-check API calls made when the content was first posted. While it is normal for less information to be available for submit-spam and submit-ham calls (most comment systems and forums will not store all metadata), you should ensure that the values that you do send match those of the original content.

See the Akismet API for more details.

Return

true if the comment was submitted, false otherwise.

- +
-
- +
+

verifyKey

-

Key Verification.

Key verification authenticates your key before calling the comment check, submit spam, or submit ham methods. This is the first call that you should make to Akismet and is especially useful if you will have multiple users with their own Akismet subscriptions using your application.

See the Akismet API for more details.

Return

true if the key is valid, false otherwise.

See also

+

Key Verification.

Key verification authenticates your key before calling the comment check, submit spam, or submit ham methods. This is the first call that you should make to Akismet and is especially useful if you will have multiple users with their own Akismet subscriptions using your application.

See the Akismet API for more details.

Return

true if the key is valid, false otherwise.

See also

- +
-
- +
+

Package-level declarations

+

A Kotlin/Java library for accessing the Akismet service.

Types

-
-
+
+
- +
Link copied to clipboard
-
open class Akismet(apiKey: String)

Provides access to the Akismet API.

+
open class Akismet(apiKey: String)

Provides access to the Akismet API.

- -
+ +
- +
Link copied to clipboard
-
@Serializable
open class AkismetComment(val userIp: String, val userAgent: String)

A comment to send to Akismet.

+
open class AkismetComment(val userIp: String, val userAgent: String)

A comment to send to Akismet.

diff --git a/docs/-akismet -kotlin/package-list b/docs/-akismet -kotlin/package-list new file mode 100644 index 0000000..e7dce2a --- /dev/null +++ b/docs/-akismet -kotlin/package-list @@ -0,0 +1,64 @@ +$dokka.format:html-v1 +$dokka.linkExtension:html +$dokka.location:net.thauvin.erik.akismet////PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/index.html +$dokka.location:net.thauvin.erik.akismet/Akismet.Companion///PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet/-companion/index.html +$dokka.location:net.thauvin.erik.akismet/Akismet.Companion/dateToGmt/#java.time.LocalDateTime/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet/-companion/date-to-gmt.html +$dokka.location:net.thauvin.erik.akismet/Akismet.Companion/dateToGmt/#java.util.Date/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet/-companion/date-to-gmt.html +$dokka.location:net.thauvin.erik.akismet/Akismet.Companion/jsonComment/#kotlin.String/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet/-companion/json-comment.html +$dokka.location:net.thauvin.erik.akismet/Akismet///PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet/index.html +$dokka.location:net.thauvin.erik.akismet/Akismet/Akismet/#kotlin.String#kotlin.String/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet/-akismet.html +$dokka.location:net.thauvin.erik.akismet/Akismet/Akismet/#kotlin.String/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet/-akismet.html +$dokka.location:net.thauvin.erik.akismet/Akismet/appUserAgent/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet/app-user-agent.html +$dokka.location:net.thauvin.erik.akismet/Akismet/blog/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet/blog.html +$dokka.location:net.thauvin.erik.akismet/Akismet/checkComment/#net.thauvin.erik.akismet.AkismetComment#kotlin.Boolean/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet/check-comment.html +$dokka.location:net.thauvin.erik.akismet/Akismet/debugHelp/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet/debug-help.html +$dokka.location:net.thauvin.erik.akismet/Akismet/errorMessage/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet/error-message.html +$dokka.location:net.thauvin.erik.akismet/Akismet/executeMethod/#[Error type: Unresolved type for HttpUrl]#[Error type: Unresolved type for FormBody]#kotlin.Boolean/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet/execute-method.html +$dokka.location:net.thauvin.erik.akismet/Akismet/httpStatusCode/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet/http-status-code.html +$dokka.location:net.thauvin.erik.akismet/Akismet/isDiscard/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet/is-discard.html +$dokka.location:net.thauvin.erik.akismet/Akismet/isVerifiedKey/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet/is-verified-key.html +$dokka.location:net.thauvin.erik.akismet/Akismet/logger/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet/logger.html +$dokka.location:net.thauvin.erik.akismet/Akismet/proTip/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet/pro-tip.html +$dokka.location:net.thauvin.erik.akismet/Akismet/reset/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet/reset.html +$dokka.location:net.thauvin.erik.akismet/Akismet/response/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet/response.html +$dokka.location:net.thauvin.erik.akismet/Akismet/submitHam/#net.thauvin.erik.akismet.AkismetComment/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet/submit-ham.html +$dokka.location:net.thauvin.erik.akismet/Akismet/submitSpam/#net.thauvin.erik.akismet.AkismetComment/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet/submit-spam.html +$dokka.location:net.thauvin.erik.akismet/Akismet/verifyKey/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet/verify-key.html +$dokka.location:net.thauvin.erik.akismet/AkismetComment.Companion///PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/index.html +$dokka.location:net.thauvin.erik.akismet/AkismetComment.Companion/ADMIN_ROLE/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-a-d-m-i-n_-r-o-l-e.html +$dokka.location:net.thauvin.erik.akismet/AkismetComment.Companion/TYPE_BLOG_POST/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-t-y-p-e_-b-l-o-g_-p-o-s-t.html +$dokka.location:net.thauvin.erik.akismet/AkismetComment.Companion/TYPE_COMMENT/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-t-y-p-e_-c-o-m-m-e-n-t.html +$dokka.location:net.thauvin.erik.akismet/AkismetComment.Companion/TYPE_CONTACT_FORM/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-t-y-p-e_-c-o-n-t-a-c-t_-f-o-r-m.html +$dokka.location:net.thauvin.erik.akismet/AkismetComment.Companion/TYPE_FORUM_POST/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-t-y-p-e_-f-o-r-u-m_-p-o-s-t.html +$dokka.location:net.thauvin.erik.akismet/AkismetComment.Companion/TYPE_MESSAGE/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-t-y-p-e_-m-e-s-s-a-g-e.html +$dokka.location:net.thauvin.erik.akismet/AkismetComment.Companion/TYPE_PINGBACK/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-t-y-p-e_-p-i-n-g-b-a-c-k.html +$dokka.location:net.thauvin.erik.akismet/AkismetComment.Companion/TYPE_REPLY/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-t-y-p-e_-r-e-p-l-y.html +$dokka.location:net.thauvin.erik.akismet/AkismetComment.Companion/TYPE_SIGNUP/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-t-y-p-e_-s-i-g-n-u-p.html +$dokka.location:net.thauvin.erik.akismet/AkismetComment.Companion/TYPE_TRACKBACK/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-t-y-p-e_-t-r-a-c-k-b-a-c-k.html +$dokka.location:net.thauvin.erik.akismet/AkismetComment.Companion/TYPE_TWEET/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-t-y-p-e_-t-w-e-e-t.html +$dokka.location:net.thauvin.erik.akismet/AkismetComment///PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/index.html +$dokka.location:net.thauvin.erik.akismet/AkismetComment/AkismetComment/#[Error type: Unresolved type for HttpServletRequest]/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/-akismet-comment.html +$dokka.location:net.thauvin.erik.akismet/AkismetComment/AkismetComment/#kotlin.String#kotlin.String/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/-akismet-comment.html +$dokka.location:net.thauvin.erik.akismet/AkismetComment/author/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/author.html +$dokka.location:net.thauvin.erik.akismet/AkismetComment/authorEmail/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/author-email.html +$dokka.location:net.thauvin.erik.akismet/AkismetComment/authorUrl/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/author-url.html +$dokka.location:net.thauvin.erik.akismet/AkismetComment/blogCharset/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/blog-charset.html +$dokka.location:net.thauvin.erik.akismet/AkismetComment/blogLang/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/blog-lang.html +$dokka.location:net.thauvin.erik.akismet/AkismetComment/content/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/content.html +$dokka.location:net.thauvin.erik.akismet/AkismetComment/dateGmt/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/date-gmt.html +$dokka.location:net.thauvin.erik.akismet/AkismetComment/equals/#kotlin.Any?/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/equals.html +$dokka.location:net.thauvin.erik.akismet/AkismetComment/hashCode/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/hash-code.html +$dokka.location:net.thauvin.erik.akismet/AkismetComment/isTest/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/is-test.html +$dokka.location:net.thauvin.erik.akismet/AkismetComment/permalink/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/permalink.html +$dokka.location:net.thauvin.erik.akismet/AkismetComment/postModifiedGmt/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/post-modified-gmt.html +$dokka.location:net.thauvin.erik.akismet/AkismetComment/recheckReason/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/recheck-reason.html +$dokka.location:net.thauvin.erik.akismet/AkismetComment/referrer/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/referrer.html +$dokka.location:net.thauvin.erik.akismet/AkismetComment/serverEnv/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/server-env.html +$dokka.location:net.thauvin.erik.akismet/AkismetComment/toJson/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/to-json.html +$dokka.location:net.thauvin.erik.akismet/AkismetComment/toString/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/to-string.html +$dokka.location:net.thauvin.erik.akismet/AkismetComment/type/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/type.html +$dokka.location:net.thauvin.erik.akismet/AkismetComment/userAgent/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/user-agent.html +$dokka.location:net.thauvin.erik.akismet/AkismetComment/userIp/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/user-ip.html +$dokka.location:net.thauvin.erik.akismet/AkismetComment/userRole/#/PointingToDeclaration/-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/user-role.html +net.thauvin.erik.akismet + diff --git a/docs/akismet-kotlin/package-list b/docs/akismet-kotlin/package-list deleted file mode 100644 index 8f4b479..0000000 --- a/docs/akismet-kotlin/package-list +++ /dev/null @@ -1,64 +0,0 @@ -$dokka.format:html-v1 -$dokka.linkExtension:html -$dokka.location:net.thauvin.erik.akismet////PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/index.html -$dokka.location:net.thauvin.erik.akismet/Akismet.Companion///PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet/-companion/index.html -$dokka.location:net.thauvin.erik.akismet/Akismet.Companion/dateToGmt/#java.time.LocalDateTime/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet/-companion/date-to-gmt.html -$dokka.location:net.thauvin.erik.akismet/Akismet.Companion/dateToGmt/#java.util.Date/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet/-companion/date-to-gmt.html -$dokka.location:net.thauvin.erik.akismet/Akismet.Companion/jsonComment/#kotlin.String/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet/-companion/json-comment.html -$dokka.location:net.thauvin.erik.akismet/Akismet///PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet/index.html -$dokka.location:net.thauvin.erik.akismet/Akismet/Akismet/#kotlin.String#kotlin.String/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet/-akismet.html -$dokka.location:net.thauvin.erik.akismet/Akismet/Akismet/#kotlin.String/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet/-akismet.html -$dokka.location:net.thauvin.erik.akismet/Akismet/appUserAgent/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet/app-user-agent.html -$dokka.location:net.thauvin.erik.akismet/Akismet/blog/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet/blog.html -$dokka.location:net.thauvin.erik.akismet/Akismet/checkComment/#net.thauvin.erik.akismet.AkismetComment#kotlin.Boolean/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet/check-comment.html -$dokka.location:net.thauvin.erik.akismet/Akismet/debugHelp/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet/debug-help.html -$dokka.location:net.thauvin.erik.akismet/Akismet/errorMessage/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet/error-message.html -$dokka.location:net.thauvin.erik.akismet/Akismet/executeMethod/#okhttp3.HttpUrl#okhttp3.FormBody#kotlin.Boolean/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet/execute-method.html -$dokka.location:net.thauvin.erik.akismet/Akismet/httpStatusCode/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet/http-status-code.html -$dokka.location:net.thauvin.erik.akismet/Akismet/isDiscard/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet/is-discard.html -$dokka.location:net.thauvin.erik.akismet/Akismet/isVerifiedKey/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet/is-verified-key.html -$dokka.location:net.thauvin.erik.akismet/Akismet/logger/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet/logger.html -$dokka.location:net.thauvin.erik.akismet/Akismet/proTip/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet/pro-tip.html -$dokka.location:net.thauvin.erik.akismet/Akismet/reset/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet/reset.html -$dokka.location:net.thauvin.erik.akismet/Akismet/response/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet/response.html -$dokka.location:net.thauvin.erik.akismet/Akismet/submitHam/#net.thauvin.erik.akismet.AkismetComment/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet/submit-ham.html -$dokka.location:net.thauvin.erik.akismet/Akismet/submitSpam/#net.thauvin.erik.akismet.AkismetComment/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet/submit-spam.html -$dokka.location:net.thauvin.erik.akismet/Akismet/verifyKey/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet/verify-key.html -$dokka.location:net.thauvin.erik.akismet/AkismetComment.Companion///PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/index.html -$dokka.location:net.thauvin.erik.akismet/AkismetComment.Companion/ADMIN_ROLE/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-a-d-m-i-n_-r-o-l-e.html -$dokka.location:net.thauvin.erik.akismet/AkismetComment.Companion/TYPE_BLOG_POST/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-t-y-p-e_-b-l-o-g_-p-o-s-t.html -$dokka.location:net.thauvin.erik.akismet/AkismetComment.Companion/TYPE_COMMENT/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-t-y-p-e_-c-o-m-m-e-n-t.html -$dokka.location:net.thauvin.erik.akismet/AkismetComment.Companion/TYPE_CONTACT_FORM/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-t-y-p-e_-c-o-n-t-a-c-t_-f-o-r-m.html -$dokka.location:net.thauvin.erik.akismet/AkismetComment.Companion/TYPE_FORUM_POST/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-t-y-p-e_-f-o-r-u-m_-p-o-s-t.html -$dokka.location:net.thauvin.erik.akismet/AkismetComment.Companion/TYPE_MESSAGE/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-t-y-p-e_-m-e-s-s-a-g-e.html -$dokka.location:net.thauvin.erik.akismet/AkismetComment.Companion/TYPE_PINGBACK/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-t-y-p-e_-p-i-n-g-b-a-c-k.html -$dokka.location:net.thauvin.erik.akismet/AkismetComment.Companion/TYPE_REPLY/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-t-y-p-e_-r-e-p-l-y.html -$dokka.location:net.thauvin.erik.akismet/AkismetComment.Companion/TYPE_SIGNUP/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-t-y-p-e_-s-i-g-n-u-p.html -$dokka.location:net.thauvin.erik.akismet/AkismetComment.Companion/TYPE_TRACKBACK/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-t-y-p-e_-t-r-a-c-k-b-a-c-k.html -$dokka.location:net.thauvin.erik.akismet/AkismetComment.Companion/TYPE_TWEET/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-t-y-p-e_-t-w-e-e-t.html -$dokka.location:net.thauvin.erik.akismet/AkismetComment///PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/index.html -$dokka.location:net.thauvin.erik.akismet/AkismetComment/AkismetComment/#jakarta.servlet.http.HttpServletRequest/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/-akismet-comment.html -$dokka.location:net.thauvin.erik.akismet/AkismetComment/AkismetComment/#kotlin.String#kotlin.String/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/-akismet-comment.html -$dokka.location:net.thauvin.erik.akismet/AkismetComment/author/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/author.html -$dokka.location:net.thauvin.erik.akismet/AkismetComment/authorEmail/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/author-email.html -$dokka.location:net.thauvin.erik.akismet/AkismetComment/authorUrl/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/author-url.html -$dokka.location:net.thauvin.erik.akismet/AkismetComment/blogCharset/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/blog-charset.html -$dokka.location:net.thauvin.erik.akismet/AkismetComment/blogLang/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/blog-lang.html -$dokka.location:net.thauvin.erik.akismet/AkismetComment/content/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/content.html -$dokka.location:net.thauvin.erik.akismet/AkismetComment/dateGmt/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/date-gmt.html -$dokka.location:net.thauvin.erik.akismet/AkismetComment/equals/#kotlin.Any?/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/equals.html -$dokka.location:net.thauvin.erik.akismet/AkismetComment/hashCode/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/hash-code.html -$dokka.location:net.thauvin.erik.akismet/AkismetComment/isTest/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/is-test.html -$dokka.location:net.thauvin.erik.akismet/AkismetComment/permalink/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/permalink.html -$dokka.location:net.thauvin.erik.akismet/AkismetComment/postModifiedGmt/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/post-modified-gmt.html -$dokka.location:net.thauvin.erik.akismet/AkismetComment/recheckReason/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/recheck-reason.html -$dokka.location:net.thauvin.erik.akismet/AkismetComment/referrer/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/referrer.html -$dokka.location:net.thauvin.erik.akismet/AkismetComment/serverEnv/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/server-env.html -$dokka.location:net.thauvin.erik.akismet/AkismetComment/toJson/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/to-json.html -$dokka.location:net.thauvin.erik.akismet/AkismetComment/toString/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/to-string.html -$dokka.location:net.thauvin.erik.akismet/AkismetComment/type/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/type.html -$dokka.location:net.thauvin.erik.akismet/AkismetComment/userAgent/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/user-agent.html -$dokka.location:net.thauvin.erik.akismet/AkismetComment/userIp/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/user-ip.html -$dokka.location:net.thauvin.erik.akismet/AkismetComment/userRole/#/PointingToDeclaration/akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/user-role.html -net.thauvin.erik.akismet - diff --git a/docs/images/anchor-copy-button.svg b/docs/images/anchor-copy-button.svg index bab9d74..19c1fa3 100644 --- a/docs/images/anchor-copy-button.svg +++ b/docs/images/anchor-copy-button.svg @@ -1,4 +1,8 @@ + + - \ No newline at end of file + diff --git a/docs/images/arrow_down.svg b/docs/images/arrow_down.svg index c0388de..639aaf1 100644 --- a/docs/images/arrow_down.svg +++ b/docs/images/arrow_down.svg @@ -1,3 +1,7 @@ + + - \ No newline at end of file + diff --git a/docs/images/burger.svg b/docs/images/burger.svg index d6dcefc..fcca732 100644 --- a/docs/images/burger.svg +++ b/docs/images/burger.svg @@ -1,5 +1,9 @@ + + - \ No newline at end of file + diff --git a/docs/images/copy-icon.svg b/docs/images/copy-icon.svg index 61440f0..2cb02ec 100644 --- a/docs/images/copy-icon.svg +++ b/docs/images/copy-icon.svg @@ -1,3 +1,7 @@ + + - \ No newline at end of file + diff --git a/docs/images/copy-successful-icon.svg b/docs/images/copy-successful-icon.svg index 1865f73..c4b9538 100644 --- a/docs/images/copy-successful-icon.svg +++ b/docs/images/copy-successful-icon.svg @@ -1,3 +1,7 @@ + + - \ No newline at end of file + diff --git a/docs/images/footer-go-to-link.svg b/docs/images/footer-go-to-link.svg index 0137e22..a87add7 100644 --- a/docs/images/footer-go-to-link.svg +++ b/docs/images/footer-go-to-link.svg @@ -1,3 +1,7 @@ + + - \ No newline at end of file + diff --git a/docs/images/go-to-top-icon.svg b/docs/images/go-to-top-icon.svg index d987f3e..abc3d1c 100644 --- a/docs/images/go-to-top-icon.svg +++ b/docs/images/go-to-top-icon.svg @@ -1,4 +1,8 @@ + + - \ No newline at end of file + diff --git a/docs/images/logo-icon.svg b/docs/images/logo-icon.svg index 1fea087..e42f957 100644 --- a/docs/images/logo-icon.svg +++ b/docs/images/logo-icon.svg @@ -1,3 +1,7 @@ + + @@ -7,4 +11,4 @@ - \ No newline at end of file + diff --git a/docs/images/nav-icons/abstract-class-kotlin.svg b/docs/images/nav-icons/abstract-class-kotlin.svg index a2069b8..19d6148 100644 --- a/docs/images/nav-icons/abstract-class-kotlin.svg +++ b/docs/images/nav-icons/abstract-class-kotlin.svg @@ -1,3 +1,7 @@ + + diff --git a/docs/images/nav-icons/annotation-kotlin.svg b/docs/images/nav-icons/annotation-kotlin.svg index 932f1d3..b90f508 100644 --- a/docs/images/nav-icons/annotation-kotlin.svg +++ b/docs/images/nav-icons/annotation-kotlin.svg @@ -1,3 +1,7 @@ + + diff --git a/docs/images/nav-icons/class-kotlin.svg b/docs/images/nav-icons/class-kotlin.svg index 46a21f6..797a242 100644 --- a/docs/images/nav-icons/class-kotlin.svg +++ b/docs/images/nav-icons/class-kotlin.svg @@ -1,3 +1,7 @@ + + diff --git a/docs/images/nav-icons/enum-kotlin.svg b/docs/images/nav-icons/enum-kotlin.svg index 4a85459..775a7cc 100644 --- a/docs/images/nav-icons/enum-kotlin.svg +++ b/docs/images/nav-icons/enum-kotlin.svg @@ -1,3 +1,7 @@ + + diff --git a/docs/images/nav-icons/field-value.svg b/docs/images/nav-icons/field-value.svg index 20449c9..2771ee5 100644 --- a/docs/images/nav-icons/field-value.svg +++ b/docs/images/nav-icons/field-value.svg @@ -1,3 +1,7 @@ + + diff --git a/docs/images/nav-icons/field-variable.svg b/docs/images/nav-icons/field-variable.svg index 3b07450..e2d2bbd 100644 --- a/docs/images/nav-icons/field-variable.svg +++ b/docs/images/nav-icons/field-variable.svg @@ -1,3 +1,7 @@ + + diff --git a/docs/images/nav-icons/interface-kotlin.svg b/docs/images/nav-icons/interface-kotlin.svg index bf07a14..5e16326 100644 --- a/docs/images/nav-icons/interface-kotlin.svg +++ b/docs/images/nav-icons/interface-kotlin.svg @@ -1,3 +1,7 @@ + + diff --git a/docs/images/nav-icons/object.svg b/docs/images/nav-icons/object.svg index 9f427de..31f0ee3 100644 --- a/docs/images/nav-icons/object.svg +++ b/docs/images/nav-icons/object.svg @@ -1,3 +1,7 @@ + + diff --git a/docs/images/nav-icons/typealias-kotlin.svg b/docs/images/nav-icons/typealias-kotlin.svg index 4795069..f4bb238 100644 --- a/docs/images/nav-icons/typealias-kotlin.svg +++ b/docs/images/nav-icons/typealias-kotlin.svg @@ -1,3 +1,7 @@ + + diff --git a/docs/images/theme-toggle.svg b/docs/images/theme-toggle.svg index dad3ff2..df86202 100644 --- a/docs/images/theme-toggle.svg +++ b/docs/images/theme-toggle.svg @@ -1,3 +1,7 @@ + + - \ No newline at end of file + diff --git a/docs/index.html b/docs/index.html index 5de1b65..c16d667 100644 --- a/docs/index.html +++ b/docs/index.html @@ -2,7 +2,7 @@ - akismet-kotlin + Akismet Kotlin @@ -41,14 +41,14 @@
-1.0.0
+1.0.1-SNAPSHOT
- +
-
+
-

akismet-kotlin

-

Akismet for Kotlin/Java, a client library for accessing the Automattic Kismet (Akismet) spam comments filtering service.

package net.thauvin.erik.akismet

A Kotlin/Java library for accessing the Akismet service.

+

Akismet Kotlin

Packages

-
-
+
+
- - + +
Link copied to clipboard
- +
-
+
+

A Kotlin/Java library for accessing the Akismet service.

+
diff --git a/docs/navigation.html b/docs/navigation.html index a83bc16..aff718a 100644 --- a/docs/navigation.html +++ b/docs/navigation.html @@ -1,17 +1,17 @@ -
- -
- -
- -
- +
+ +
+ + -
- - diff --git a/docs/scripts/clipboard.js b/docs/scripts/clipboard.js index b00ce24..7a4f33c 100644 --- a/docs/scripts/clipboard.js +++ b/docs/scripts/clipboard.js @@ -1,3 +1,7 @@ +/* + * Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. + */ + window.addEventListener('load', () => { document.querySelectorAll('span.copy-icon').forEach(element => { element.addEventListener('click', (el) => copyElementsContentToClipboard(element)); diff --git a/docs/scripts/navigation-loader.js b/docs/scripts/navigation-loader.js index 9246491..3df7ac8 100644 --- a/docs/scripts/navigation-loader.js +++ b/docs/scripts/navigation-loader.js @@ -1,3 +1,7 @@ +/* + * Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. + */ + navigationPageText = fetch(pathToRoot + "navigation.html").then(response => response.text()) displayNavigationFromPage = () => { diff --git a/docs/scripts/pages.json b/docs/scripts/pages.json index 1b911f5..bdcd091 100644 --- a/docs/scripts/pages.json +++ b/docs/scripts/pages.json @@ -1 +1 @@ -[{"name":"const val ADMIN_ROLE: String","description":"net.thauvin.erik.akismet.AkismetComment.Companion.ADMIN_ROLE","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-a-d-m-i-n_-r-o-l-e.html","searchKeys":["ADMIN_ROLE","const val ADMIN_ROLE: String","net.thauvin.erik.akismet.AkismetComment.Companion.ADMIN_ROLE"]},{"name":"const val TYPE_BLOG_POST: String","description":"net.thauvin.erik.akismet.AkismetComment.Companion.TYPE_BLOG_POST","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-t-y-p-e_-b-l-o-g_-p-o-s-t.html","searchKeys":["TYPE_BLOG_POST","const val TYPE_BLOG_POST: String","net.thauvin.erik.akismet.AkismetComment.Companion.TYPE_BLOG_POST"]},{"name":"const val TYPE_COMMENT: String","description":"net.thauvin.erik.akismet.AkismetComment.Companion.TYPE_COMMENT","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-t-y-p-e_-c-o-m-m-e-n-t.html","searchKeys":["TYPE_COMMENT","const val TYPE_COMMENT: String","net.thauvin.erik.akismet.AkismetComment.Companion.TYPE_COMMENT"]},{"name":"const val TYPE_CONTACT_FORM: String","description":"net.thauvin.erik.akismet.AkismetComment.Companion.TYPE_CONTACT_FORM","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-t-y-p-e_-c-o-n-t-a-c-t_-f-o-r-m.html","searchKeys":["TYPE_CONTACT_FORM","const val TYPE_CONTACT_FORM: String","net.thauvin.erik.akismet.AkismetComment.Companion.TYPE_CONTACT_FORM"]},{"name":"const val TYPE_FORUM_POST: String","description":"net.thauvin.erik.akismet.AkismetComment.Companion.TYPE_FORUM_POST","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-t-y-p-e_-f-o-r-u-m_-p-o-s-t.html","searchKeys":["TYPE_FORUM_POST","const val TYPE_FORUM_POST: String","net.thauvin.erik.akismet.AkismetComment.Companion.TYPE_FORUM_POST"]},{"name":"const val TYPE_MESSAGE: String","description":"net.thauvin.erik.akismet.AkismetComment.Companion.TYPE_MESSAGE","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-t-y-p-e_-m-e-s-s-a-g-e.html","searchKeys":["TYPE_MESSAGE","const val TYPE_MESSAGE: String","net.thauvin.erik.akismet.AkismetComment.Companion.TYPE_MESSAGE"]},{"name":"const val TYPE_PINGBACK: String","description":"net.thauvin.erik.akismet.AkismetComment.Companion.TYPE_PINGBACK","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-t-y-p-e_-p-i-n-g-b-a-c-k.html","searchKeys":["TYPE_PINGBACK","const val TYPE_PINGBACK: String","net.thauvin.erik.akismet.AkismetComment.Companion.TYPE_PINGBACK"]},{"name":"const val TYPE_REPLY: String","description":"net.thauvin.erik.akismet.AkismetComment.Companion.TYPE_REPLY","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-t-y-p-e_-r-e-p-l-y.html","searchKeys":["TYPE_REPLY","const val TYPE_REPLY: String","net.thauvin.erik.akismet.AkismetComment.Companion.TYPE_REPLY"]},{"name":"const val TYPE_SIGNUP: String","description":"net.thauvin.erik.akismet.AkismetComment.Companion.TYPE_SIGNUP","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-t-y-p-e_-s-i-g-n-u-p.html","searchKeys":["TYPE_SIGNUP","const val TYPE_SIGNUP: String","net.thauvin.erik.akismet.AkismetComment.Companion.TYPE_SIGNUP"]},{"name":"const val TYPE_TRACKBACK: String","description":"net.thauvin.erik.akismet.AkismetComment.Companion.TYPE_TRACKBACK","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-t-y-p-e_-t-r-a-c-k-b-a-c-k.html","searchKeys":["TYPE_TRACKBACK","const val TYPE_TRACKBACK: String","net.thauvin.erik.akismet.AkismetComment.Companion.TYPE_TRACKBACK"]},{"name":"const val TYPE_TWEET: String","description":"net.thauvin.erik.akismet.AkismetComment.Companion.TYPE_TWEET","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-t-y-p-e_-t-w-e-e-t.html","searchKeys":["TYPE_TWEET","const val TYPE_TWEET: String","net.thauvin.erik.akismet.AkismetComment.Companion.TYPE_TWEET"]},{"name":"constructor(apiKey: String)","description":"net.thauvin.erik.akismet.Akismet.Akismet","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet/-akismet.html","searchKeys":["Akismet","constructor(apiKey: String)","net.thauvin.erik.akismet.Akismet.Akismet"]},{"name":"constructor(apiKey: String, blog: String)","description":"net.thauvin.erik.akismet.Akismet.Akismet","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet/-akismet.html","searchKeys":["Akismet","constructor(apiKey: String, blog: String)","net.thauvin.erik.akismet.Akismet.Akismet"]},{"name":"constructor(request: HttpServletRequest)","description":"net.thauvin.erik.akismet.AkismetComment.AkismetComment","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/-akismet-comment.html","searchKeys":["AkismetComment","constructor(request: HttpServletRequest)","net.thauvin.erik.akismet.AkismetComment.AkismetComment"]},{"name":"constructor(userIp: String, userAgent: String)","description":"net.thauvin.erik.akismet.AkismetComment.AkismetComment","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/-akismet-comment.html","searchKeys":["AkismetComment","constructor(userIp: String, userAgent: String)","net.thauvin.erik.akismet.AkismetComment.AkismetComment"]},{"name":"fun checkComment(comment: AkismetComment, trueOnError: Boolean = false): Boolean","description":"net.thauvin.erik.akismet.Akismet.checkComment","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet/check-comment.html","searchKeys":["checkComment","fun checkComment(comment: AkismetComment, trueOnError: Boolean = false): Boolean","net.thauvin.erik.akismet.Akismet.checkComment"]},{"name":"fun dateToGmt(date: Date): String","description":"net.thauvin.erik.akismet.Akismet.Companion.dateToGmt","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet/-companion/date-to-gmt.html","searchKeys":["dateToGmt","fun dateToGmt(date: Date): String","net.thauvin.erik.akismet.Akismet.Companion.dateToGmt"]},{"name":"fun dateToGmt(date: LocalDateTime): String","description":"net.thauvin.erik.akismet.Akismet.Companion.dateToGmt","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet/-companion/date-to-gmt.html","searchKeys":["dateToGmt","fun dateToGmt(date: LocalDateTime): String","net.thauvin.erik.akismet.Akismet.Companion.dateToGmt"]},{"name":"fun executeMethod(apiUrl: HttpUrl, formBody: FormBody, trueOnError: Boolean = false): Boolean","description":"net.thauvin.erik.akismet.Akismet.executeMethod","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet/execute-method.html","searchKeys":["executeMethod","fun executeMethod(apiUrl: HttpUrl, formBody: FormBody, trueOnError: Boolean = false): Boolean","net.thauvin.erik.akismet.Akismet.executeMethod"]},{"name":"fun jsonComment(json: String): AkismetComment","description":"net.thauvin.erik.akismet.Akismet.Companion.jsonComment","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet/-companion/json-comment.html","searchKeys":["jsonComment","fun jsonComment(json: String): AkismetComment","net.thauvin.erik.akismet.Akismet.Companion.jsonComment"]},{"name":"fun reset()","description":"net.thauvin.erik.akismet.Akismet.reset","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet/reset.html","searchKeys":["reset","fun reset()","net.thauvin.erik.akismet.Akismet.reset"]},{"name":"fun submitHam(comment: AkismetComment): Boolean","description":"net.thauvin.erik.akismet.Akismet.submitHam","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet/submit-ham.html","searchKeys":["submitHam","fun submitHam(comment: AkismetComment): Boolean","net.thauvin.erik.akismet.Akismet.submitHam"]},{"name":"fun submitSpam(comment: AkismetComment): Boolean","description":"net.thauvin.erik.akismet.Akismet.submitSpam","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet/submit-spam.html","searchKeys":["submitSpam","fun submitSpam(comment: AkismetComment): Boolean","net.thauvin.erik.akismet.Akismet.submitSpam"]},{"name":"fun toJson(): String","description":"net.thauvin.erik.akismet.AkismetComment.toJson","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/to-json.html","searchKeys":["toJson","fun toJson(): String","net.thauvin.erik.akismet.AkismetComment.toJson"]},{"name":"fun verifyKey(): Boolean","description":"net.thauvin.erik.akismet.Akismet.verifyKey","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet/verify-key.html","searchKeys":["verifyKey","fun verifyKey(): Boolean","net.thauvin.erik.akismet.Akismet.verifyKey"]},{"name":"object Companion","description":"net.thauvin.erik.akismet.Akismet.Companion","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet/-companion/index.html","searchKeys":["Companion","object Companion","net.thauvin.erik.akismet.Akismet.Companion"]},{"name":"object Companion","description":"net.thauvin.erik.akismet.AkismetComment.Companion","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/index.html","searchKeys":["Companion","object Companion","net.thauvin.erik.akismet.AkismetComment.Companion"]},{"name":"open class Akismet(apiKey: String)","description":"net.thauvin.erik.akismet.Akismet","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet/index.html","searchKeys":["Akismet","open class Akismet(apiKey: String)","net.thauvin.erik.akismet.Akismet"]},{"name":"open class AkismetComment(val userIp: String, val userAgent: String)","description":"net.thauvin.erik.akismet.AkismetComment","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/index.html","searchKeys":["AkismetComment","open class AkismetComment(val userIp: String, val userAgent: String)","net.thauvin.erik.akismet.AkismetComment"]},{"name":"open operator override fun equals(other: Any?): Boolean","description":"net.thauvin.erik.akismet.AkismetComment.equals","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/equals.html","searchKeys":["equals","open operator override fun equals(other: Any?): Boolean","net.thauvin.erik.akismet.AkismetComment.equals"]},{"name":"open override fun hashCode(): Int","description":"net.thauvin.erik.akismet.AkismetComment.hashCode","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/hash-code.html","searchKeys":["hashCode","open override fun hashCode(): Int","net.thauvin.erik.akismet.AkismetComment.hashCode"]},{"name":"open override fun toString(): String","description":"net.thauvin.erik.akismet.AkismetComment.toString","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/to-string.html","searchKeys":["toString","open override fun toString(): String","net.thauvin.erik.akismet.AkismetComment.toString"]},{"name":"val logger: Logger","description":"net.thauvin.erik.akismet.Akismet.logger","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet/logger.html","searchKeys":["logger","val logger: Logger","net.thauvin.erik.akismet.Akismet.logger"]},{"name":"val userAgent: String","description":"net.thauvin.erik.akismet.AkismetComment.userAgent","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/user-agent.html","searchKeys":["userAgent","val userAgent: String","net.thauvin.erik.akismet.AkismetComment.userAgent"]},{"name":"val userIp: String","description":"net.thauvin.erik.akismet.AkismetComment.userIp","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/user-ip.html","searchKeys":["userIp","val userIp: String","net.thauvin.erik.akismet.AkismetComment.userIp"]},{"name":"var appUserAgent: String","description":"net.thauvin.erik.akismet.Akismet.appUserAgent","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet/app-user-agent.html","searchKeys":["appUserAgent","var appUserAgent: String","net.thauvin.erik.akismet.Akismet.appUserAgent"]},{"name":"var author: String?","description":"net.thauvin.erik.akismet.AkismetComment.author","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/author.html","searchKeys":["author","var author: String?","net.thauvin.erik.akismet.AkismetComment.author"]},{"name":"var authorEmail: String?","description":"net.thauvin.erik.akismet.AkismetComment.authorEmail","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/author-email.html","searchKeys":["authorEmail","var authorEmail: String?","net.thauvin.erik.akismet.AkismetComment.authorEmail"]},{"name":"var authorUrl: String?","description":"net.thauvin.erik.akismet.AkismetComment.authorUrl","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/author-url.html","searchKeys":["authorUrl","var authorUrl: String?","net.thauvin.erik.akismet.AkismetComment.authorUrl"]},{"name":"var blog: String","description":"net.thauvin.erik.akismet.Akismet.blog","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet/blog.html","searchKeys":["blog","var blog: String","net.thauvin.erik.akismet.Akismet.blog"]},{"name":"var blogCharset: String?","description":"net.thauvin.erik.akismet.AkismetComment.blogCharset","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/blog-charset.html","searchKeys":["blogCharset","var blogCharset: String?","net.thauvin.erik.akismet.AkismetComment.blogCharset"]},{"name":"var blogLang: String?","description":"net.thauvin.erik.akismet.AkismetComment.blogLang","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/blog-lang.html","searchKeys":["blogLang","var blogLang: String?","net.thauvin.erik.akismet.AkismetComment.blogLang"]},{"name":"var content: String?","description":"net.thauvin.erik.akismet.AkismetComment.content","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/content.html","searchKeys":["content","var content: String?","net.thauvin.erik.akismet.AkismetComment.content"]},{"name":"var dateGmt: String?","description":"net.thauvin.erik.akismet.AkismetComment.dateGmt","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/date-gmt.html","searchKeys":["dateGmt","var dateGmt: String?","net.thauvin.erik.akismet.AkismetComment.dateGmt"]},{"name":"var debugHelp: String","description":"net.thauvin.erik.akismet.Akismet.debugHelp","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet/debug-help.html","searchKeys":["debugHelp","var debugHelp: String","net.thauvin.erik.akismet.Akismet.debugHelp"]},{"name":"var errorMessage: String","description":"net.thauvin.erik.akismet.Akismet.errorMessage","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet/error-message.html","searchKeys":["errorMessage","var errorMessage: String","net.thauvin.erik.akismet.Akismet.errorMessage"]},{"name":"var httpStatusCode: Int","description":"net.thauvin.erik.akismet.Akismet.httpStatusCode","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet/http-status-code.html","searchKeys":["httpStatusCode","var httpStatusCode: Int","net.thauvin.erik.akismet.Akismet.httpStatusCode"]},{"name":"var isDiscard: Boolean","description":"net.thauvin.erik.akismet.Akismet.isDiscard","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet/is-discard.html","searchKeys":["isDiscard","var isDiscard: Boolean","net.thauvin.erik.akismet.Akismet.isDiscard"]},{"name":"var isTest: Boolean","description":"net.thauvin.erik.akismet.AkismetComment.isTest","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/is-test.html","searchKeys":["isTest","var isTest: Boolean","net.thauvin.erik.akismet.AkismetComment.isTest"]},{"name":"var isVerifiedKey: Boolean","description":"net.thauvin.erik.akismet.Akismet.isVerifiedKey","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet/is-verified-key.html","searchKeys":["isVerifiedKey","var isVerifiedKey: Boolean","net.thauvin.erik.akismet.Akismet.isVerifiedKey"]},{"name":"var permalink: String?","description":"net.thauvin.erik.akismet.AkismetComment.permalink","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/permalink.html","searchKeys":["permalink","var permalink: String?","net.thauvin.erik.akismet.AkismetComment.permalink"]},{"name":"var postModifiedGmt: String?","description":"net.thauvin.erik.akismet.AkismetComment.postModifiedGmt","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/post-modified-gmt.html","searchKeys":["postModifiedGmt","var postModifiedGmt: String?","net.thauvin.erik.akismet.AkismetComment.postModifiedGmt"]},{"name":"var proTip: String","description":"net.thauvin.erik.akismet.Akismet.proTip","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet/pro-tip.html","searchKeys":["proTip","var proTip: String","net.thauvin.erik.akismet.Akismet.proTip"]},{"name":"var recheckReason: String?","description":"net.thauvin.erik.akismet.AkismetComment.recheckReason","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/recheck-reason.html","searchKeys":["recheckReason","var recheckReason: String?","net.thauvin.erik.akismet.AkismetComment.recheckReason"]},{"name":"var referrer: String?","description":"net.thauvin.erik.akismet.AkismetComment.referrer","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/referrer.html","searchKeys":["referrer","var referrer: String?","net.thauvin.erik.akismet.AkismetComment.referrer"]},{"name":"var response: String","description":"net.thauvin.erik.akismet.Akismet.response","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet/response.html","searchKeys":["response","var response: String","net.thauvin.erik.akismet.Akismet.response"]},{"name":"var serverEnv: Map","description":"net.thauvin.erik.akismet.AkismetComment.serverEnv","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/server-env.html","searchKeys":["serverEnv","var serverEnv: Map","net.thauvin.erik.akismet.AkismetComment.serverEnv"]},{"name":"var type: String?","description":"net.thauvin.erik.akismet.AkismetComment.type","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/type.html","searchKeys":["type","var type: String?","net.thauvin.erik.akismet.AkismetComment.type"]},{"name":"var userRole: String?","description":"net.thauvin.erik.akismet.AkismetComment.userRole","location":"akismet-kotlin/net.thauvin.erik.akismet/-akismet-comment/user-role.html","searchKeys":["userRole","var userRole: String?","net.thauvin.erik.akismet.AkismetComment.userRole"]}] +[{"name":"const val ADMIN_ROLE: String","description":"net.thauvin.erik.akismet.AkismetComment.Companion.ADMIN_ROLE","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-a-d-m-i-n_-r-o-l-e.html","searchKeys":["ADMIN_ROLE","const val ADMIN_ROLE: String","net.thauvin.erik.akismet.AkismetComment.Companion.ADMIN_ROLE"]},{"name":"const val TYPE_BLOG_POST: String","description":"net.thauvin.erik.akismet.AkismetComment.Companion.TYPE_BLOG_POST","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-t-y-p-e_-b-l-o-g_-p-o-s-t.html","searchKeys":["TYPE_BLOG_POST","const val TYPE_BLOG_POST: String","net.thauvin.erik.akismet.AkismetComment.Companion.TYPE_BLOG_POST"]},{"name":"const val TYPE_COMMENT: String","description":"net.thauvin.erik.akismet.AkismetComment.Companion.TYPE_COMMENT","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-t-y-p-e_-c-o-m-m-e-n-t.html","searchKeys":["TYPE_COMMENT","const val TYPE_COMMENT: String","net.thauvin.erik.akismet.AkismetComment.Companion.TYPE_COMMENT"]},{"name":"const val TYPE_CONTACT_FORM: String","description":"net.thauvin.erik.akismet.AkismetComment.Companion.TYPE_CONTACT_FORM","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-t-y-p-e_-c-o-n-t-a-c-t_-f-o-r-m.html","searchKeys":["TYPE_CONTACT_FORM","const val TYPE_CONTACT_FORM: String","net.thauvin.erik.akismet.AkismetComment.Companion.TYPE_CONTACT_FORM"]},{"name":"const val TYPE_FORUM_POST: String","description":"net.thauvin.erik.akismet.AkismetComment.Companion.TYPE_FORUM_POST","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-t-y-p-e_-f-o-r-u-m_-p-o-s-t.html","searchKeys":["TYPE_FORUM_POST","const val TYPE_FORUM_POST: String","net.thauvin.erik.akismet.AkismetComment.Companion.TYPE_FORUM_POST"]},{"name":"const val TYPE_MESSAGE: String","description":"net.thauvin.erik.akismet.AkismetComment.Companion.TYPE_MESSAGE","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-t-y-p-e_-m-e-s-s-a-g-e.html","searchKeys":["TYPE_MESSAGE","const val TYPE_MESSAGE: String","net.thauvin.erik.akismet.AkismetComment.Companion.TYPE_MESSAGE"]},{"name":"const val TYPE_PINGBACK: String","description":"net.thauvin.erik.akismet.AkismetComment.Companion.TYPE_PINGBACK","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-t-y-p-e_-p-i-n-g-b-a-c-k.html","searchKeys":["TYPE_PINGBACK","const val TYPE_PINGBACK: String","net.thauvin.erik.akismet.AkismetComment.Companion.TYPE_PINGBACK"]},{"name":"const val TYPE_REPLY: String","description":"net.thauvin.erik.akismet.AkismetComment.Companion.TYPE_REPLY","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-t-y-p-e_-r-e-p-l-y.html","searchKeys":["TYPE_REPLY","const val TYPE_REPLY: String","net.thauvin.erik.akismet.AkismetComment.Companion.TYPE_REPLY"]},{"name":"const val TYPE_SIGNUP: String","description":"net.thauvin.erik.akismet.AkismetComment.Companion.TYPE_SIGNUP","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-t-y-p-e_-s-i-g-n-u-p.html","searchKeys":["TYPE_SIGNUP","const val TYPE_SIGNUP: String","net.thauvin.erik.akismet.AkismetComment.Companion.TYPE_SIGNUP"]},{"name":"const val TYPE_TRACKBACK: String","description":"net.thauvin.erik.akismet.AkismetComment.Companion.TYPE_TRACKBACK","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-t-y-p-e_-t-r-a-c-k-b-a-c-k.html","searchKeys":["TYPE_TRACKBACK","const val TYPE_TRACKBACK: String","net.thauvin.erik.akismet.AkismetComment.Companion.TYPE_TRACKBACK"]},{"name":"const val TYPE_TWEET: String","description":"net.thauvin.erik.akismet.AkismetComment.Companion.TYPE_TWEET","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/-t-y-p-e_-t-w-e-e-t.html","searchKeys":["TYPE_TWEET","const val TYPE_TWEET: String","net.thauvin.erik.akismet.AkismetComment.Companion.TYPE_TWEET"]},{"name":"constructor(apiKey: String)","description":"net.thauvin.erik.akismet.Akismet.Akismet","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet/-akismet.html","searchKeys":["Akismet","constructor(apiKey: String)","net.thauvin.erik.akismet.Akismet.Akismet"]},{"name":"constructor(apiKey: String, blog: String)","description":"net.thauvin.erik.akismet.Akismet.Akismet","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet/-akismet.html","searchKeys":["Akismet","constructor(apiKey: String, blog: String)","net.thauvin.erik.akismet.Akismet.Akismet"]},{"name":"constructor(request: )","description":"net.thauvin.erik.akismet.AkismetComment.AkismetComment","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/-akismet-comment.html","searchKeys":["AkismetComment","constructor(request: )","net.thauvin.erik.akismet.AkismetComment.AkismetComment"]},{"name":"constructor(userIp: String, userAgent: String)","description":"net.thauvin.erik.akismet.AkismetComment.AkismetComment","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/-akismet-comment.html","searchKeys":["AkismetComment","constructor(userIp: String, userAgent: String)","net.thauvin.erik.akismet.AkismetComment.AkismetComment"]},{"name":"fun checkComment(comment: AkismetComment, trueOnError: Boolean = false): Boolean","description":"net.thauvin.erik.akismet.Akismet.checkComment","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet/check-comment.html","searchKeys":["checkComment","fun checkComment(comment: AkismetComment, trueOnError: Boolean = false): Boolean","net.thauvin.erik.akismet.Akismet.checkComment"]},{"name":"fun dateToGmt(date: Date): String","description":"net.thauvin.erik.akismet.Akismet.Companion.dateToGmt","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet/-companion/date-to-gmt.html","searchKeys":["dateToGmt","fun dateToGmt(date: Date): String","net.thauvin.erik.akismet.Akismet.Companion.dateToGmt"]},{"name":"fun dateToGmt(date: LocalDateTime): String","description":"net.thauvin.erik.akismet.Akismet.Companion.dateToGmt","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet/-companion/date-to-gmt.html","searchKeys":["dateToGmt","fun dateToGmt(date: LocalDateTime): String","net.thauvin.erik.akismet.Akismet.Companion.dateToGmt"]},{"name":"fun executeMethod(apiUrl: , formBody: , trueOnError: Boolean = false): Boolean","description":"net.thauvin.erik.akismet.Akismet.executeMethod","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet/execute-method.html","searchKeys":["executeMethod","fun executeMethod(apiUrl: , formBody: , trueOnError: Boolean = false): Boolean","net.thauvin.erik.akismet.Akismet.executeMethod"]},{"name":"fun jsonComment(json: String): AkismetComment","description":"net.thauvin.erik.akismet.Akismet.Companion.jsonComment","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet/-companion/json-comment.html","searchKeys":["jsonComment","fun jsonComment(json: String): AkismetComment","net.thauvin.erik.akismet.Akismet.Companion.jsonComment"]},{"name":"fun reset()","description":"net.thauvin.erik.akismet.Akismet.reset","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet/reset.html","searchKeys":["reset","fun reset()","net.thauvin.erik.akismet.Akismet.reset"]},{"name":"fun submitHam(comment: AkismetComment): Boolean","description":"net.thauvin.erik.akismet.Akismet.submitHam","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet/submit-ham.html","searchKeys":["submitHam","fun submitHam(comment: AkismetComment): Boolean","net.thauvin.erik.akismet.Akismet.submitHam"]},{"name":"fun submitSpam(comment: AkismetComment): Boolean","description":"net.thauvin.erik.akismet.Akismet.submitSpam","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet/submit-spam.html","searchKeys":["submitSpam","fun submitSpam(comment: AkismetComment): Boolean","net.thauvin.erik.akismet.Akismet.submitSpam"]},{"name":"fun toJson(): String","description":"net.thauvin.erik.akismet.AkismetComment.toJson","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/to-json.html","searchKeys":["toJson","fun toJson(): String","net.thauvin.erik.akismet.AkismetComment.toJson"]},{"name":"fun verifyKey(): Boolean","description":"net.thauvin.erik.akismet.Akismet.verifyKey","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet/verify-key.html","searchKeys":["verifyKey","fun verifyKey(): Boolean","net.thauvin.erik.akismet.Akismet.verifyKey"]},{"name":"object Companion","description":"net.thauvin.erik.akismet.Akismet.Companion","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet/-companion/index.html","searchKeys":["Companion","object Companion","net.thauvin.erik.akismet.Akismet.Companion"]},{"name":"object Companion","description":"net.thauvin.erik.akismet.AkismetComment.Companion","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/-companion/index.html","searchKeys":["Companion","object Companion","net.thauvin.erik.akismet.AkismetComment.Companion"]},{"name":"open class Akismet(apiKey: String)","description":"net.thauvin.erik.akismet.Akismet","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet/index.html","searchKeys":["Akismet","open class Akismet(apiKey: String)","net.thauvin.erik.akismet.Akismet"]},{"name":"open class AkismetComment(val userIp: String, val userAgent: String)","description":"net.thauvin.erik.akismet.AkismetComment","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/index.html","searchKeys":["AkismetComment","open class AkismetComment(val userIp: String, val userAgent: String)","net.thauvin.erik.akismet.AkismetComment"]},{"name":"open operator override fun equals(other: Any?): Boolean","description":"net.thauvin.erik.akismet.AkismetComment.equals","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/equals.html","searchKeys":["equals","open operator override fun equals(other: Any?): Boolean","net.thauvin.erik.akismet.AkismetComment.equals"]},{"name":"open override fun hashCode(): Int","description":"net.thauvin.erik.akismet.AkismetComment.hashCode","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/hash-code.html","searchKeys":["hashCode","open override fun hashCode(): Int","net.thauvin.erik.akismet.AkismetComment.hashCode"]},{"name":"open override fun toString(): String","description":"net.thauvin.erik.akismet.AkismetComment.toString","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/to-string.html","searchKeys":["toString","open override fun toString(): String","net.thauvin.erik.akismet.AkismetComment.toString"]},{"name":"val logger: Logger","description":"net.thauvin.erik.akismet.Akismet.logger","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet/logger.html","searchKeys":["logger","val logger: Logger","net.thauvin.erik.akismet.Akismet.logger"]},{"name":"val userAgent: String","description":"net.thauvin.erik.akismet.AkismetComment.userAgent","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/user-agent.html","searchKeys":["userAgent","val userAgent: String","net.thauvin.erik.akismet.AkismetComment.userAgent"]},{"name":"val userIp: String","description":"net.thauvin.erik.akismet.AkismetComment.userIp","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/user-ip.html","searchKeys":["userIp","val userIp: String","net.thauvin.erik.akismet.AkismetComment.userIp"]},{"name":"var appUserAgent: String","description":"net.thauvin.erik.akismet.Akismet.appUserAgent","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet/app-user-agent.html","searchKeys":["appUserAgent","var appUserAgent: String","net.thauvin.erik.akismet.Akismet.appUserAgent"]},{"name":"var author: String?","description":"net.thauvin.erik.akismet.AkismetComment.author","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/author.html","searchKeys":["author","var author: String?","net.thauvin.erik.akismet.AkismetComment.author"]},{"name":"var authorEmail: String?","description":"net.thauvin.erik.akismet.AkismetComment.authorEmail","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/author-email.html","searchKeys":["authorEmail","var authorEmail: String?","net.thauvin.erik.akismet.AkismetComment.authorEmail"]},{"name":"var authorUrl: String?","description":"net.thauvin.erik.akismet.AkismetComment.authorUrl","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/author-url.html","searchKeys":["authorUrl","var authorUrl: String?","net.thauvin.erik.akismet.AkismetComment.authorUrl"]},{"name":"var blog: String","description":"net.thauvin.erik.akismet.Akismet.blog","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet/blog.html","searchKeys":["blog","var blog: String","net.thauvin.erik.akismet.Akismet.blog"]},{"name":"var blogCharset: String?","description":"net.thauvin.erik.akismet.AkismetComment.blogCharset","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/blog-charset.html","searchKeys":["blogCharset","var blogCharset: String?","net.thauvin.erik.akismet.AkismetComment.blogCharset"]},{"name":"var blogLang: String?","description":"net.thauvin.erik.akismet.AkismetComment.blogLang","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/blog-lang.html","searchKeys":["blogLang","var blogLang: String?","net.thauvin.erik.akismet.AkismetComment.blogLang"]},{"name":"var content: String?","description":"net.thauvin.erik.akismet.AkismetComment.content","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/content.html","searchKeys":["content","var content: String?","net.thauvin.erik.akismet.AkismetComment.content"]},{"name":"var dateGmt: String?","description":"net.thauvin.erik.akismet.AkismetComment.dateGmt","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/date-gmt.html","searchKeys":["dateGmt","var dateGmt: String?","net.thauvin.erik.akismet.AkismetComment.dateGmt"]},{"name":"var debugHelp: String","description":"net.thauvin.erik.akismet.Akismet.debugHelp","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet/debug-help.html","searchKeys":["debugHelp","var debugHelp: String","net.thauvin.erik.akismet.Akismet.debugHelp"]},{"name":"var errorMessage: String","description":"net.thauvin.erik.akismet.Akismet.errorMessage","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet/error-message.html","searchKeys":["errorMessage","var errorMessage: String","net.thauvin.erik.akismet.Akismet.errorMessage"]},{"name":"var httpStatusCode: Int","description":"net.thauvin.erik.akismet.Akismet.httpStatusCode","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet/http-status-code.html","searchKeys":["httpStatusCode","var httpStatusCode: Int","net.thauvin.erik.akismet.Akismet.httpStatusCode"]},{"name":"var isDiscard: Boolean","description":"net.thauvin.erik.akismet.Akismet.isDiscard","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet/is-discard.html","searchKeys":["isDiscard","var isDiscard: Boolean","net.thauvin.erik.akismet.Akismet.isDiscard"]},{"name":"var isTest: Boolean","description":"net.thauvin.erik.akismet.AkismetComment.isTest","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/is-test.html","searchKeys":["isTest","var isTest: Boolean","net.thauvin.erik.akismet.AkismetComment.isTest"]},{"name":"var isVerifiedKey: Boolean","description":"net.thauvin.erik.akismet.Akismet.isVerifiedKey","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet/is-verified-key.html","searchKeys":["isVerifiedKey","var isVerifiedKey: Boolean","net.thauvin.erik.akismet.Akismet.isVerifiedKey"]},{"name":"var permalink: String?","description":"net.thauvin.erik.akismet.AkismetComment.permalink","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/permalink.html","searchKeys":["permalink","var permalink: String?","net.thauvin.erik.akismet.AkismetComment.permalink"]},{"name":"var postModifiedGmt: String?","description":"net.thauvin.erik.akismet.AkismetComment.postModifiedGmt","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/post-modified-gmt.html","searchKeys":["postModifiedGmt","var postModifiedGmt: String?","net.thauvin.erik.akismet.AkismetComment.postModifiedGmt"]},{"name":"var proTip: String","description":"net.thauvin.erik.akismet.Akismet.proTip","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet/pro-tip.html","searchKeys":["proTip","var proTip: String","net.thauvin.erik.akismet.Akismet.proTip"]},{"name":"var recheckReason: String?","description":"net.thauvin.erik.akismet.AkismetComment.recheckReason","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/recheck-reason.html","searchKeys":["recheckReason","var recheckReason: String?","net.thauvin.erik.akismet.AkismetComment.recheckReason"]},{"name":"var referrer: String?","description":"net.thauvin.erik.akismet.AkismetComment.referrer","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/referrer.html","searchKeys":["referrer","var referrer: String?","net.thauvin.erik.akismet.AkismetComment.referrer"]},{"name":"var response: String","description":"net.thauvin.erik.akismet.Akismet.response","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet/response.html","searchKeys":["response","var response: String","net.thauvin.erik.akismet.Akismet.response"]},{"name":"var serverEnv: Map","description":"net.thauvin.erik.akismet.AkismetComment.serverEnv","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/server-env.html","searchKeys":["serverEnv","var serverEnv: Map","net.thauvin.erik.akismet.AkismetComment.serverEnv"]},{"name":"var type: String?","description":"net.thauvin.erik.akismet.AkismetComment.type","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/type.html","searchKeys":["type","var type: String?","net.thauvin.erik.akismet.AkismetComment.type"]},{"name":"var userRole: String?","description":"net.thauvin.erik.akismet.AkismetComment.userRole","location":"-akismet -kotlin/net.thauvin.erik.akismet/-akismet-comment/user-role.html","searchKeys":["userRole","var userRole: String?","net.thauvin.erik.akismet.AkismetComment.userRole"]}] diff --git a/docs/scripts/platform-content-handler.js b/docs/scripts/platform-content-handler.js index 7c5e8af..8c4ca53 100644 --- a/docs/scripts/platform-content-handler.js +++ b/docs/scripts/platform-content-handler.js @@ -1,3 +1,7 @@ +/* + * Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. + */ + filteringContext = { dependencies: {}, restrictedDependencies: [], diff --git a/docs/scripts/sourceset_dependencies.js b/docs/scripts/sourceset_dependencies.js index b3aa738..9d52f63 100644 --- a/docs/scripts/sourceset_dependencies.js +++ b/docs/scripts/sourceset_dependencies.js @@ -1 +1 @@ -sourceset_dependencies='{":dokkaHtml/main":[]}' +sourceset_dependencies='{"root/main":[]}' diff --git a/docs/scripts/symbol-parameters-wrapper_deferred.js b/docs/scripts/symbol-parameters-wrapper_deferred.js index 248d0ab..7ecae7a 100644 --- a/docs/scripts/symbol-parameters-wrapper_deferred.js +++ b/docs/scripts/symbol-parameters-wrapper_deferred.js @@ -1,83 +1,64 @@ +/* + * Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. + */ + // helps with some corner cases where starts working already, // but the signature is not yet long enough to be wrapped -const leftPaddingPx = 60 +(function() { + const leftPaddingPx = 60; -const symbolResizeObserver = new ResizeObserver(entries => { - entries.forEach(entry => { - const symbolElement = entry.target - symbolResizeObserver.unobserve(symbolElement) // only need it once, otherwise will be executed multiple times - wrapSymbolParameters(symbolElement); - }) -}); - -const wrapAllSymbolParameters = () => { - document.querySelectorAll("div.symbol").forEach(symbol => wrapSymbolParameters(symbol)) -} - -const wrapSymbolParameters = (symbol) => { - let parametersBlock = symbol.querySelector("span.parameters") - if (parametersBlock == null) { - return // nothing to wrap + function createNbspIndent() { + let indent = document.createElement("span"); + indent.append(document.createTextNode("\u00A0\u00A0\u00A0\u00A0")); + indent.classList.add("nbsp-indent"); + return indent; } - let symbolBlockWidth = symbol.clientWidth + function wrapSymbolParameters(entry) { + const symbol = entry.target; + const symbolBlockWidth = entry.borderBoxSize && entry.borderBoxSize[0] && entry.borderBoxSize[0].inlineSize; - // Even though the script is marked as `defer` and we wait for `DOMContentLoaded` event, - // it can happen that `symbolBlockWidth` is 0, indicating that something hasn't been loaded. - // In this case, just retry once all styles have been applied and it has been resized correctly. - if (symbolBlockWidth === 0) { - symbolResizeObserver.observe(symbol) - return + // Even though the script is marked as `defer` and we wait for `DOMContentLoaded` event, + // or if this block is a part of hidden tab, it can happen that `symbolBlockWidth` is 0, + // indicating that something hasn't been loaded. + // In this case, observer will be triggered onсe again when it will be ready. + if (symbolBlockWidth > 0) { + const node = symbol.querySelector(".parameters"); + + if (node) { + // if window resize happened and observer was triggered, reset previously wrapped + // parameters as they might not need wrapping anymore, and check again + node.classList.remove("wrapped"); + node.querySelectorAll(".parameter .nbsp-indent") + .forEach(indent => indent.remove()); + + const innerTextWidth = Array.from(symbol.children) + .filter(it => !it.classList.contains("block")) // blocks are usually on their own (like annotations), so ignore it + .map(it => it.getBoundingClientRect().width) + .reduce((a, b) => a + b, 0); + + // if signature text takes up more than a single line, wrap params for readability + if (innerTextWidth > (symbolBlockWidth - leftPaddingPx)) { + node.classList.add("wrapped"); + node.querySelectorAll(".parameter").forEach(param => { + // has to be a physical indent so that it can be copied. styles like + // paddings and `::before { content: " " }` do not work for that + param.prepend(createNbspIndent()); + }); + } + } + } } - let innerTextWidth = Array.from(symbol.children) - .filter(it => !it.classList.contains("block")) // blocks are usually on their own (like annotations), so ignore it - .map(it => it.getBoundingClientRect().width).reduce((a, b) => a + b, 0) + const symbolsObserver = new ResizeObserver(entries => entries.forEach(wrapSymbolParameters)); - // if signature text takes up more than a single line, wrap params for readability - let shouldWrapParams = innerTextWidth > (symbolBlockWidth - leftPaddingPx) - if (shouldWrapParams) { - parametersBlock.classList.add("wrapped") - parametersBlock.querySelectorAll("span.parameter").forEach(param => { - // has to be a physical indent so that it can be copied. styles like - // paddings and `::before { content: " " }` do not work for that - param.prepend(createNbspIndent()) - }) + function initHandlers() { + document.querySelectorAll("div.symbol").forEach(symbol => symbolsObserver.observe(symbol)); } -} -const createNbspIndent = () => { - let indent = document.createElement("span") - indent.append(document.createTextNode("\u00A0\u00A0\u00A0\u00A0")) - indent.classList.add("nbsp-indent") - return indent -} + if (document.readyState === 'loading') window.addEventListener('DOMContentLoaded', initHandlers); + else initHandlers(); -const resetAllSymbolParametersWrapping = () => { - document.querySelectorAll("div.symbol").forEach(symbol => resetSymbolParametersWrapping(symbol)) -} - -const resetSymbolParametersWrapping = (symbol) => { - let parameters = symbol.querySelector("span.parameters") - if (parameters != null) { - parameters.classList.remove("wrapped") - parameters.querySelectorAll("span.parameter").forEach(param => { - let indent = param.querySelector("span.nbsp-indent") - if (indent != null) indent.remove() - }) - } -} - -if (document.readyState === 'loading') { - window.addEventListener('DOMContentLoaded', () => { - wrapAllSymbolParameters() - }) -} else { - wrapAllSymbolParameters() -} - -window.onresize = event => { - // need to re-calculate if params need to be wrapped after resize - resetAllSymbolParametersWrapping() - wrapAllSymbolParameters() -} + // ToDo: Add `unobserve` if dokka will be SPA-like: + // https://github.com/w3c/csswg-drafts/issues/5155 +})(); diff --git a/docs/styles/font-jb-sans-auto.css b/docs/styles/font-jb-sans-auto.css index 95d8ef8..bdc6872 100644 --- a/docs/styles/font-jb-sans-auto.css +++ b/docs/styles/font-jb-sans-auto.css @@ -1,3 +1,7 @@ +/* + * Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. + */ + /* Light weight */ @font-face { font-family: 'JetBrains Sans'; diff --git a/docs/styles/jetbrains-mono.css b/docs/styles/jetbrains-mono.css deleted file mode 100644 index 9a0f06f..0000000 --- a/docs/styles/jetbrains-mono.css +++ /dev/null @@ -1,17 +0,0 @@ -@font-face{ - font-family: 'JetBrains Mono'; - src: url('https://raw.githubusercontent.com/JetBrains/JetBrainsMono/master/fonts/web/JetBrainsMono-Regular.eot') format('embedded-opentype'), - url('https://raw.githubusercontent.com/JetBrains/JetBrainsMono/master/fonts/webfonts/JetBrainsMono-Regular.woff2') format('woff2'), - url('https://raw.githubusercontent.com/JetBrains/JetBrainsMono/master/fonts/ttf/JetBrainsMono-Regular.ttf') format('truetype'); - font-weight: normal; - font-style: normal; -} - -@font-face{ - font-family: 'JetBrains Mono'; - src: url('https://raw.githubusercontent.com/JetBrains/JetBrainsMono/master/fonts/web/JetBrainsMono-Bold.eot') format('embedded-opentype'), - url('https://raw.githubusercontent.com/JetBrains/JetBrainsMono/master/fonts/webfonts/JetBrainsMono-Bold.woff2') format('woff2'), - url('https://raw.githubusercontent.com/JetBrains/JetBrainsMono/master/fonts/ttf/JetBrainsMono-Bold.ttf') format('truetype'); - font-weight: bold; - font-style: bold; -} \ No newline at end of file diff --git a/docs/styles/logo-styles.css b/docs/styles/logo-styles.css index f3846e8..69804e4 100644 --- a/docs/styles/logo-styles.css +++ b/docs/styles/logo-styles.css @@ -1,3 +1,7 @@ +/* + * Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. + */ + :root { --dokka-logo-image-url: url('../images/logo-icon.svg'); --dokka-logo-height: 50px; diff --git a/docs/styles/main.css b/docs/styles/main.css index 5aa04a4..ebe1ce1 100644 --- a/docs/styles/main.css +++ b/docs/styles/main.css @@ -1,4 +1,6 @@ -#pages-search{cursor:pointer;border:none;border-radius:50%;background:transparent;fill:#fff;fill:var(--dark-mode-and-search-icon-color)}#pages-search:focus{outline:none}#pages-search:hover{background:var(--white-10)}.search,.search [data-test=ring-select],.search [data-test=ring-tooltip],.search [data-test=ring-select_focus],.search #pages-search{display:inline-block;padding:0;margin:0;font-size:0;line-height:0}.search-hotkey-popup{background-color:var(--background-color) !important;padding:4px}.popup-wrapper{min-width:calc(100% - 322px) !important;border:1px solid rgba(255,255,255,.2) !important;background-color:#27282c !important}.popup-wrapper [class^=filterWrapper]{border-bottom:1px solid rgba(255,255,255,.2)}.popup-wrapper input{color:rgba(255,255,255,.8) !important;font-weight:normal !important}.popup-wrapper span[data-test-custom=ring-select-popup-filter-icon]{color:#fff}.popup-wrapper button[data-test=ring-input-clear]{color:#fff !important}@media screen and (max-width: 759px){.popup-wrapper{min-width:100% !important}}.template-wrapper{display:grid;height:32px;grid-template-columns:auto auto}.template-wrapper strong{color:rgba(255,255,255,.8)}.template-wrapper span{color:rgba(255,255,255,.8);line-height:32px}.template-wrapper span.template-description{color:rgba(255,255,255,.6);justify-self:end}@media screen and (max-width: 759px){.template-wrapper{display:flex;flex-direction:column;height:auto}.template-wrapper span{line-height:unset}}.template-name{justify-self:start}[class^=fade]{display:none}[class*=hover]{background-color:rgba(255,255,255,.1) !important} +/*! + * Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. + */#pages-search{cursor:pointer;border:none;border-radius:50%;background:transparent;fill:#fff;fill:var(--dark-mode-and-search-icon-color)}#pages-search:focus{outline:none}#pages-search:hover{background:var(--white-10)}.search,.search [data-test=ring-select],.search [data-test=ring-tooltip],.search [data-test=ring-select_focus],.search #pages-search{display:inline-block;padding:0;margin:0;font-size:0;line-height:0}.search-hotkey-popup{background-color:var(--background-color) !important;padding:4px}.popup-wrapper{min-width:calc(100% - 322px) !important;border:1px solid rgba(255,255,255,.2) !important;background-color:#27282c !important}.popup-wrapper [class^=filterWrapper]{border-bottom:1px solid rgba(255,255,255,.2)}.popup-wrapper input{color:rgba(255,255,255,.8) !important;font-weight:normal !important}.popup-wrapper span[data-test-custom=ring-select-popup-filter-icon]{color:#fff}.popup-wrapper button[data-test=ring-input-clear]{color:#fff !important}@media screen and (max-width: 759px){.popup-wrapper{min-width:100% !important}}.template-wrapper{display:grid;height:32px;grid-template-columns:auto auto}.template-wrapper strong{color:rgba(255,255,255,.8)}.template-wrapper span{color:rgba(255,255,255,.8);line-height:32px}.template-wrapper span.template-description{color:rgba(255,255,255,.6);justify-self:end}@media screen and (max-width: 759px){.template-wrapper{display:flex;flex-direction:column;height:auto}.template-wrapper span{line-height:unset}}.template-name{justify-self:start}[class^=fade]{display:none}[class*=hover]{background-color:rgba(255,255,255,.1) !important} /* stylelint-disable color-no-hex */ :root { @@ -113,6 +115,10 @@ --ring-alert-z-index: 6; } -html,.app-root{height:100%}.search-root{margin:0;padding:0;background:var(--ring-content-background-color);font-family:var(--ring-font-family);font-size:var(--ring-font-size);line-height:var(--ring-line-height)}.search-content{z-index:8} +/*! + * Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. + *//*! + * Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. + */html,.app-root{height:100%}.search-root{margin:0;padding:0;background:var(--ring-content-background-color);font-family:var(--ring-font-family);font-size:var(--ring-font-size);line-height:var(--ring-line-height)}.search-content{z-index:8} /*# sourceMappingURL=main.css.map*/ \ No newline at end of file diff --git a/docs/styles/prism.css b/docs/styles/prism.css index 4287f6d..2d3a091 100644 --- a/docs/styles/prism.css +++ b/docs/styles/prism.css @@ -1,3 +1,7 @@ +/* + * Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. + */ + /* * Custom Dokka styles */ diff --git a/docs/styles/style.css b/docs/styles/style.css index 7f6e4b0..67a899a 100644 --- a/docs/styles/style.css +++ b/docs/styles/style.css @@ -1,3 +1,7 @@ +/* + * Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. + */ + @import url('./font-jb-sans-auto.css'); @import url('https://fonts.googleapis.com/css?family=JetBrains+Mono'); @@ -1476,4 +1480,4 @@ has only one header, and the header text is the same as the tab name, so no poin */ .main-content[data-page-type="package"] .tabs-section-body h2 { display: none; -} \ No newline at end of file +} diff --git a/examples/.idea/.name b/examples/.idea/.name deleted file mode 100644 index bdb1d33..0000000 --- a/examples/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -akismet-examples \ No newline at end of file diff --git a/examples/.idea/checkstyle-idea.xml b/examples/.idea/checkstyle-idea.xml deleted file mode 100644 index ead1d8a..0000000 --- a/examples/.idea/checkstyle-idea.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/examples/.idea/encodings.xml b/examples/.idea/encodings.xml deleted file mode 100644 index 97626ba..0000000 --- a/examples/.idea/encodings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/examples/bld/.gitignore b/examples/bld/.gitignore new file mode 100644 index 0000000..a2805aa --- /dev/null +++ b/examples/bld/.gitignore @@ -0,0 +1,55 @@ +.gradle +.DS_Store +build +lib/bld/** +!lib/bld/bld-wrapper.jar +!lib/bld/bld-wrapper.properties +lib/compile/ +lib/runtime/ +lib/standalone/ +lib/test/ + +# IDEA ignores + +# User-specific +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# SonarLint plugin +.idea/sonarlint/ + +# Editor-based Rest Client +.idea/httpRequests \ No newline at end of file diff --git a/examples/bld/.idea/.gitignore b/examples/bld/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/examples/bld/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/examples/bld/.idea/.name b/examples/bld/.idea/.name new file mode 100644 index 0000000..2ee9f40 --- /dev/null +++ b/examples/bld/.idea/.name @@ -0,0 +1 @@ +akismet-kotlin-examples-bld \ No newline at end of file diff --git a/examples/bld/.idea/app.iml b/examples/bld/.idea/app.iml new file mode 100644 index 0000000..2c1fe21 --- /dev/null +++ b/examples/bld/.idea/app.iml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/bld/.idea/bld.iml b/examples/bld/.idea/bld.iml new file mode 100644 index 0000000..e63e11e --- /dev/null +++ b/examples/bld/.idea/bld.iml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/bld/.idea/inspectionProfiles/Project_Default.xml b/examples/bld/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..1e01b48 --- /dev/null +++ b/examples/bld/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/examples/bld/.idea/libraries/bld.xml b/examples/bld/.idea/libraries/bld.xml new file mode 100644 index 0000000..ca84ff0 --- /dev/null +++ b/examples/bld/.idea/libraries/bld.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/examples/bld/.idea/libraries/compile.xml b/examples/bld/.idea/libraries/compile.xml new file mode 100644 index 0000000..9bd86aa --- /dev/null +++ b/examples/bld/.idea/libraries/compile.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/bld/.idea/libraries/runtime.xml b/examples/bld/.idea/libraries/runtime.xml new file mode 100644 index 0000000..2ae5c4b --- /dev/null +++ b/examples/bld/.idea/libraries/runtime.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/bld/.idea/libraries/test.xml b/examples/bld/.idea/libraries/test.xml new file mode 100644 index 0000000..b80486a --- /dev/null +++ b/examples/bld/.idea/libraries/test.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/bld/.idea/misc.xml b/examples/bld/.idea/misc.xml new file mode 100644 index 0000000..542659b --- /dev/null +++ b/examples/bld/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/examples/bld/.idea/modules.xml b/examples/bld/.idea/modules.xml new file mode 100644 index 0000000..55adcb9 --- /dev/null +++ b/examples/bld/.idea/modules.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/examples/bld/.idea/runConfigurations/Run Tests.xml b/examples/bld/.idea/runConfigurations/Run Tests.xml new file mode 100644 index 0000000..2b503e5 --- /dev/null +++ b/examples/bld/.idea/runConfigurations/Run Tests.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/examples/bld/.idea/vcs.xml b/examples/bld/.idea/vcs.xml new file mode 100644 index 0000000..b2bdec2 --- /dev/null +++ b/examples/bld/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/examples/bld/.vscode/launch.json b/examples/bld/.vscode/launch.json new file mode 100644 index 0000000..30a8889 --- /dev/null +++ b/examples/bld/.vscode/launch.json @@ -0,0 +1,11 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "type": "java", + "name": "Run Tests", + "request": "launch", + "mainClass": "com.example.ExampleTest" + } + ] +} diff --git a/examples/bld/.vscode/settings.json b/examples/bld/.vscode/settings.json new file mode 100644 index 0000000..133aa45 --- /dev/null +++ b/examples/bld/.vscode/settings.json @@ -0,0 +1,15 @@ +{ + "java.project.sourcePaths": [ + "src/main/java", + "src/main/resources", + "src/test/java", + "src/bld/java" + ], + "java.configuration.updateBuildConfiguration": "automatic", + "java.project.referencedLibraries": [ + "${HOME}/.bld/dist/bld-1.7.5.jar", + "lib/compile/*.jar", + "lib/runtime/*.jar", + "lib/test/*.jar" + ] +} diff --git a/examples/bld/README.md b/examples/bld/README.md new file mode 100644 index 0000000..4cec4ce --- /dev/null +++ b/examples/bld/README.md @@ -0,0 +1,18 @@ +## Kotlin Example +To compile & run the Kotlin example: + +```text +./bld compile + +./bld run --args=API_KEY +``` + +## Java Example +cd +To compile & run the Java example: + +```text +./bld compile + +./bld run-java --args=API_KEY +``` diff --git a/examples/bld/bld b/examples/bld/bld new file mode 100755 index 0000000..80d2986 --- /dev/null +++ b/examples/bld/bld @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +java -jar "$(dirname "$0")/lib/bld/bld-wrapper.jar" "$0" --build com.example.ExampleBuild "$@" \ No newline at end of file diff --git a/examples/bld/bld.bat b/examples/bld/bld.bat new file mode 100644 index 0000000..084bb72 --- /dev/null +++ b/examples/bld/bld.bat @@ -0,0 +1,4 @@ +@echo off +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +java -jar "%DIRNAME%/lib/bld/bld-wrapper.jar" "%0" --build com.example.ExampleBuild %* \ No newline at end of file diff --git a/examples/bld/lib/bld/bld-wrapper.jar b/examples/bld/lib/bld/bld-wrapper.jar new file mode 100644 index 0000000..b185103 Binary files /dev/null and b/examples/bld/lib/bld/bld-wrapper.jar differ diff --git a/examples/bld/lib/bld/bld-wrapper.properties b/examples/bld/lib/bld/bld-wrapper.properties new file mode 100644 index 0000000..095b48c --- /dev/null +++ b/examples/bld/lib/bld/bld-wrapper.properties @@ -0,0 +1,7 @@ +bld.downloadExtensionJavadoc=false +bld.downloadExtensionSources=true +bld.extensions=com.uwyn.rife2:bld-kotlin:0.9.0-SNAPSHOT +bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES +bld.downloadLocation= +bld.sourceDirectories= +bld.version=1.7.5 diff --git a/examples/bld/src/bld/java/com/example/ExampleBuild.java b/examples/bld/src/bld/java/com/example/ExampleBuild.java new file mode 100644 index 0000000..33f0638 --- /dev/null +++ b/examples/bld/src/bld/java/com/example/ExampleBuild.java @@ -0,0 +1,58 @@ +package com.example; + +import rife.bld.BaseProject; +import rife.bld.BuildCommand; +import rife.bld.extension.CompileKotlinOperation; +import rife.bld.extension.CompileKotlinOptions; +import rife.bld.operations.RunOperation; + +import java.util.List; + +import static rife.bld.dependencies.Repository.*; +import static rife.bld.dependencies.Scope.compile; + +public class ExampleBuild extends BaseProject { + public ExampleBuild() { + pkg = "com.example"; + name = "Example"; + version = version(0, 1, 0); + + mainClass = "com.example.AkismetExampleKt"; + + javaRelease = 11; + downloadSources = true; + autoDownloadPurge = true; + repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL, SONATYPE_SNAPSHOTS_LEGACY); + + scope(compile) + .include(dependency("net.thauvin.erik:akismet-kotlin:1.0.0")) + .include(dependency("jakarta.servlet:jakarta.servlet-api:6.0.0")); + } + + public static void main(String[] args) { + new ExampleBuild().start(args); + } + + @Override + public void compile() throws Exception { + new CompileKotlinOperation() + .fromProject(this) + .compileOptions( + new CompileKotlinOptions() + .jdkRelease(javaRelease) + .verbose(true) + ) + .execute(); + + // Also compile the Java source code + super.compile(); + } + + @BuildCommand(value = "run-java", summary = "Runs the Java example") + public void runJava() throws Exception { + new RunOperation() + .fromProject(this) + .mainClass("com.example.AkismetSample") + .execute(); + } +} diff --git a/examples/src/main/java/com/example/AkismetSample.java b/examples/bld/src/main/java/com/example/AkismetSample.java similarity index 100% rename from examples/src/main/java/com/example/AkismetSample.java rename to examples/bld/src/main/java/com/example/AkismetSample.java diff --git a/examples/src/main/kotlin/com/example/AkismetExample.kt b/examples/bld/src/main/kotlin/com/example/AkismetExample.kt similarity index 100% rename from examples/src/main/kotlin/com/example/AkismetExample.kt rename to examples/bld/src/main/kotlin/com/example/AkismetExample.kt diff --git a/examples/src/main/kotlin/com/example/AkismetServlet.kt b/examples/bld/src/main/kotlin/com/example/AkismetServlet.kt similarity index 100% rename from examples/src/main/kotlin/com/example/AkismetServlet.kt rename to examples/bld/src/main/kotlin/com/example/AkismetServlet.kt diff --git a/examples/.editorconfig b/examples/gradle/.editorconfig similarity index 100% rename from examples/.editorconfig rename to examples/gradle/.editorconfig diff --git a/examples/.gitattributes b/examples/gradle/.gitattributes similarity index 100% rename from examples/.gitattributes rename to examples/gradle/.gitattributes diff --git a/examples/.gitignore b/examples/gradle/.gitignore similarity index 100% rename from examples/.gitignore rename to examples/gradle/.gitignore diff --git a/examples/gradle/.idea/.gitignore b/examples/gradle/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/examples/gradle/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/examples/gradle/.idea/.name b/examples/gradle/.idea/.name new file mode 100644 index 0000000..ac5e64e --- /dev/null +++ b/examples/gradle/.idea/.name @@ -0,0 +1 @@ +akismet-examples-gradle \ No newline at end of file diff --git a/.idea/checkstyle-idea.xml b/examples/gradle/.idea/checkstyle-idea.xml similarity index 100% rename from .idea/checkstyle-idea.xml rename to examples/gradle/.idea/checkstyle-idea.xml diff --git a/examples/.idea/codeStyles/codeStyleConfig.xml b/examples/gradle/.idea/codeStyles/codeStyleConfig.xml similarity index 100% rename from examples/.idea/codeStyles/codeStyleConfig.xml rename to examples/gradle/.idea/codeStyles/codeStyleConfig.xml diff --git a/examples/.idea/compiler.xml b/examples/gradle/.idea/compiler.xml similarity index 87% rename from examples/.idea/compiler.xml rename to examples/gradle/.idea/compiler.xml index 907f7b6..61ad941 100644 --- a/examples/.idea/compiler.xml +++ b/examples/gradle/.idea/compiler.xml @@ -1,7 +1,7 @@ - + diff --git a/.idea/encodings.xml b/examples/gradle/.idea/encodings.xml similarity index 100% rename from .idea/encodings.xml rename to examples/gradle/.idea/encodings.xml diff --git a/examples/gradle/.idea/gradle.xml b/examples/gradle/.idea/gradle.xml new file mode 100644 index 0000000..7d3b3e8 --- /dev/null +++ b/examples/gradle/.idea/gradle.xml @@ -0,0 +1,17 @@ + + + + + + + \ No newline at end of file diff --git a/examples/.idea/inspectionProfiles/Project_Default.xml b/examples/gradle/.idea/inspectionProfiles/Project_Default.xml similarity index 100% rename from examples/.idea/inspectionProfiles/Project_Default.xml rename to examples/gradle/.idea/inspectionProfiles/Project_Default.xml diff --git a/examples/gradle/.idea/jarRepositories.xml b/examples/gradle/.idea/jarRepositories.xml new file mode 100644 index 0000000..a529ef2 --- /dev/null +++ b/examples/gradle/.idea/jarRepositories.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/gradle/.idea/kotlinc.xml b/examples/gradle/.idea/kotlinc.xml new file mode 100644 index 0000000..e805548 --- /dev/null +++ b/examples/gradle/.idea/kotlinc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/examples/.idea/misc.xml b/examples/gradle/.idea/misc.xml similarity index 75% rename from examples/.idea/misc.xml rename to examples/gradle/.idea/misc.xml index f09e92a..7940811 100644 --- a/examples/.idea/misc.xml +++ b/examples/gradle/.idea/misc.xml @@ -6,7 +6,10 @@ - + + + diff --git a/examples/.idea/vcs.xml b/examples/gradle/.idea/vcs.xml similarity index 75% rename from examples/.idea/vcs.xml rename to examples/gradle/.idea/vcs.xml index 6c0b863..64713b8 100644 --- a/examples/.idea/vcs.xml +++ b/examples/gradle/.idea/vcs.xml @@ -1,6 +1,7 @@ + \ No newline at end of file diff --git a/examples/gradle/README.md b/examples/gradle/README.md new file mode 100644 index 0000000..445ae5a --- /dev/null +++ b/examples/gradle/README.md @@ -0,0 +1,14 @@ +## Kotlin Example +To compile & run the Kotlin example: + +```text +./gradlew run --args=API_KEY +``` + +## Java Example + +To compile & run the Java example: + +```text +./gradlew runJava --args=API_KEY +``` diff --git a/examples/build.gradle.kts b/examples/gradle/build.gradle.kts similarity index 78% rename from examples/build.gradle.kts rename to examples/gradle/build.gradle.kts index 0bfbac2..55b665a 100644 --- a/examples/build.gradle.kts +++ b/examples/gradle/build.gradle.kts @@ -2,13 +2,10 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { id("application") - id("com.github.ben-manes.versions") version "0.48.0" - kotlin("jvm") version "1.9.10" + id("com.github.ben-manes.versions") version "0.49.0" + kotlin("jvm") version "1.9.20" } -// ./gradlew run --args=API_KEY -// ./gradlew runJava --args=API_KEY - defaultTasks(ApplicationPlugin.TASK_RUN_NAME) repositories { @@ -17,9 +14,7 @@ repositories { } dependencies { -// implementation("javax.servlet:javax.servlet-api:4.0.1") implementation("jakarta.servlet:jakarta.servlet-api:6.0.0") - implementation("net.thauvin.erik:akismet-kotlin:1.0.0") } diff --git a/examples/gradle/wrapper/gradle-wrapper.jar b/examples/gradle/gradle/wrapper/gradle-wrapper.jar similarity index 100% rename from examples/gradle/wrapper/gradle-wrapper.jar rename to examples/gradle/gradle/wrapper/gradle-wrapper.jar diff --git a/examples/gradle/wrapper/gradle-wrapper.properties b/examples/gradle/gradle/wrapper/gradle-wrapper.properties similarity index 94% rename from examples/gradle/wrapper/gradle-wrapper.properties rename to examples/gradle/gradle/wrapper/gradle-wrapper.properties index ac72c34..3fa8f86 100644 --- a/examples/gradle/wrapper/gradle-wrapper.properties +++ b/examples/gradle/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/examples/gradle/gradlew similarity index 94% rename from gradlew rename to examples/gradle/gradlew index 0adc8e1..1aa94a4 100755 --- a/gradlew +++ b/examples/gradle/gradlew @@ -145,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -153,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -202,11 +202,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/examples/gradlew.bat b/examples/gradle/gradlew.bat similarity index 100% rename from examples/gradlew.bat rename to examples/gradle/gradlew.bat diff --git a/examples/settings.gradle.kts b/examples/gradle/settings.gradle.kts similarity index 100% rename from examples/settings.gradle.kts rename to examples/gradle/settings.gradle.kts diff --git a/examples/gradle/src/main/java/com/example/AkismetSample.java b/examples/gradle/src/main/java/com/example/AkismetSample.java new file mode 100644 index 0000000..f70698f --- /dev/null +++ b/examples/gradle/src/main/java/com/example/AkismetSample.java @@ -0,0 +1,64 @@ +package com.example; + +import net.thauvin.erik.akismet.Akismet; +import net.thauvin.erik.akismet.AkismetComment; + +import java.util.Date; + +public class AkismetSample { + public static void main(String... args) { + if (args.length == 1 && !args[0].isBlank()) { + final Akismet akismet = new Akismet(args[0], "https://yourblogdomainname.com/blog/"); + final AkismetComment comment = new AkismetComment("127.0.0.1", "curl/7.29.0"); + + comment.setTest(true); + + comment.setReferrer("https://www.google.com"); + comment.setPermalink(akismet.getBlog() + "post=1"); + comment.setType(AkismetComment.TYPE_COMMENT); + comment.setAuthor("admin"); + comment.setAuthorEmail("test@test.com"); + comment.setAuthorUrl("http://www.CheckOutMyCoolSite.com"); + comment.setDateGmt(Akismet.dateToGmt(new Date())); + // comment.setUserRole(AkismetComment.ADMIN_ROLE); + comment.setContent("It means a lot that you would take the time to review our software. Thanks again."); + + // final ConsoleHandler consoleHandler = new ConsoleHandler(); + // consoleHandler.setLevel(Level.FINE); + // final Logger logger = akismet.getLogger(); + // logger.addHandler(consoleHandler); + // logger.setLevel(Level.FINE); + + if (akismet.verifyKey()) { + final boolean isSpam = akismet.checkComment(comment); + if (isSpam) { + System.out.println("The comment is SPAM according to Akismet."); + + final boolean hasBeenSubmitted = akismet.submitSpam(comment); + if (hasBeenSubmitted) { + System.out.println("The comment has been submitted as SPAM to Akismet"); + } else { + System.err.println(akismet.getErrorMessage()); + } + } else { + System.out.println("The comment is not SPAM according to Akismet."); + + final boolean hasBeenSubmitted = akismet.submitHam(comment); + if (hasBeenSubmitted) { + System.out.println("The comment has been submitted as HAM to Akismet"); + } else { + System.err.println(akismet.getErrorMessage()); + } + } + } else { + System.err.println("Invalid API Key."); + System.exit(1); + } + + System.exit(0); + } else { + System.err.println("Please specify an API key."); + System.exit(1); + } + } +} diff --git a/examples/gradle/src/main/kotlin/com/example/AkismetExample.kt b/examples/gradle/src/main/kotlin/com/example/AkismetExample.kt new file mode 100644 index 0000000..149555f --- /dev/null +++ b/examples/gradle/src/main/kotlin/com/example/AkismetExample.kt @@ -0,0 +1,66 @@ +package com.example + +import net.thauvin.erik.akismet.Akismet +import net.thauvin.erik.akismet.AkismetComment +import java.util.Date +import kotlin.system.exitProcess + +fun main(args: Array) { + + if (args.size == 1 && args[0].isNotEmpty()) { + val akismet = Akismet(apiKey = args[0], blog = "https://yourblogdomainname.com/blog/") + val comment = AkismetComment(userIp = "127.0.0.1", userAgent = "curl/7.29.0") + + with(comment) { + isTest = true + + referrer = "https://www.google.com" + permalink = "${akismet.blog}post=1" + type = AkismetComment.TYPE_COMMENT + author = "admin" + authorEmail = "test@test.com" + authorUrl = "https://www.CheckOutMyCoolSite.com" + dateGmt = Akismet.dateToGmt(Date()) +// userRole = AkismetComment.ADMIN_ROLE + content = "It means a lot that you would take the time to review our software. Thanks again." + } + +// with(akismet.logger) { +// addHandler(ConsoleHandler().apply { level = Level.FINE }) +// level = Level.FINE +// } + + if (akismet.verifyKey()) { + val isSpam = akismet.checkComment(comment) + if (isSpam) { + println("The comment is SPAM according to Akismet.") + + val hasBeenSubmitted = akismet.submitSpam(comment) + + if (hasBeenSubmitted) { + println("The comment was successfully submitted as SPAM to Akismet.") + } else { + System.err.println(akismet.errorMessage) + } + } else { + println("The comment is not SPAM according to Akismet.") + + val hasBeenSubmitted = akismet.submitHam(comment) + + if (hasBeenSubmitted) { + println("The comment was successfully submitted as HAM to Akismet.") + } else { + System.err.println(akismet.errorMessage) + } + } + } else { + System.err.println("Invalid API Key.") + exitProcess(1) + } + + exitProcess(0) + } else { + System.err.println("Please specify an API key.") + exitProcess(1) + } +} diff --git a/examples/gradle/src/main/kotlin/com/example/AkismetServlet.kt b/examples/gradle/src/main/kotlin/com/example/AkismetServlet.kt new file mode 100644 index 0000000..4b245c8 --- /dev/null +++ b/examples/gradle/src/main/kotlin/com/example/AkismetServlet.kt @@ -0,0 +1,60 @@ +package com.example + +import jakarta.servlet.ServletException +import jakarta.servlet.annotation.WebServlet +import jakarta.servlet.http.HttpServlet +import jakarta.servlet.http.HttpServletRequest +import jakarta.servlet.http.HttpServletResponse +import net.thauvin.erik.akismet.Akismet +import net.thauvin.erik.akismet.AkismetComment +import java.io.IOException +import java.util.Date + +@WebServlet(description = "Akismet Servlet", displayName = "Akismet", urlPatterns = ["/comment/*"]) +class AkismetServlet : HttpServlet() { + private val akismet = Akismet("YOUR_API_KEY", "http://yourblogdomainname.com/blog/") + + @Throws(ServletException::class, IOException::class) + public override fun service(request: HttpServletRequest, response: HttpServletResponse) { + val id = request.getParameter("id") + + akismet.appUserAgent = request.servletContext.serverInfo + + val comment = AkismetComment(request) + with(comment) { + permalink = "${akismet.blog}/comment/$id" + type = AkismetComment.TYPE_COMMENT + author = request.getParameter("name") + authorEmail = request.getParameter("email") + dateGmt = Akismet.dateToGmt(Date()) + content = request.getParameter("comment") + } + + val isSpam = akismet.checkComment(comment) + + saveComment( + id = id, + name = comment.author, + email = comment.authorEmail, + date = comment.dateGmt, + comment = comment.content, + json = comment.toJson(), + isSpam = isSpam + ) + + // ... + } + + @Suppress("UNUSED_PARAMETER") + private fun saveComment( + id: String, + name: String?, + email: String?, + date: String?, + comment: String?, + json: String, + isSpam: Boolean + ) { + // ... + } +} diff --git a/examples/gradlew b/examples/gradlew deleted file mode 100755 index 0adc8e1..0000000 --- a/examples/gradlew +++ /dev/null @@ -1,249 +0,0 @@ -#!/bin/sh - -# -# Copyright © 2015-2021 the original authors. -# -# 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 -# -# https://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. -# - -############################################################################## -# -# Gradle start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh Gradle -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», -# «${var#prefix}», «${var%suffix}», and «$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -# -# You can find Gradle at https://github.com/gradle/gradle/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: $0 may be a link -app_path=$0 - -# Need this for daisy-chained symlinks. -while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] -do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac -done - -# This is normally unused -# shellcheck disable=SC2034 -APP_BASE_NAME=${0##*/} -# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { - echo "$*" -} >&2 - -die () { - echo - echo "$*" - echo - exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD=java - if ! command -v java >/dev/null 2>&1 - then - die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -fi - -# Increase the maximum file descriptors if we can. -if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - - JAVACMD=$( cygpath --unix "$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done -fi - - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. - -set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" - -# Stop when "xargs" is not available. -if ! command -v xargs >/dev/null 2>&1 -then - die "xargs is not available" -fi - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"$var" ) && -# set -- "${ARGS[@]}" "$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' - -exec "$JAVACMD" "$@" diff --git a/gradle.properties b/gradle.properties deleted file mode 100644 index e69de29..0000000 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 7f93135..0000000 Binary files a/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index ac72c34..0000000 --- a/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,7 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip -networkTimeout=10000 -validateDistributionUrl=true -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/gradlew.bat b/gradlew.bat deleted file mode 100644 index 93e3f59..0000000 --- a/gradlew.bat +++ /dev/null @@ -1,92 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/lib/bld/bld-wrapper.jar b/lib/bld/bld-wrapper.jar new file mode 100644 index 0000000..0f56927 Binary files /dev/null and b/lib/bld/bld-wrapper.jar differ diff --git a/lib/bld/bld-wrapper.properties b/lib/bld/bld-wrapper.properties new file mode 100644 index 0000000..37e3035 --- /dev/null +++ b/lib/bld/bld-wrapper.properties @@ -0,0 +1,9 @@ +bld.downloadExtensionJavadoc=false +bld.downloadExtensionSources=true +bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.1 +bld.extensions-kotlin=com.uwyn.rife2:bld-kotlin:0.9.0-SNAPSHOT +bld.extensions=com.uwyn.rife2:bld-generated-version:0.9.3-SNAPSHOT +bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES +bld.downloadLocation= +bld.sourceDirectories= +bld.version=1.7.5 diff --git a/pom.xml b/pom.xml index ff49ef0..fecf267 100644 --- a/pom.xml +++ b/pom.xml @@ -1,14 +1,10 @@ - - - - - - + 4.0.0 net.thauvin.erik akismet-kotlin - 1.0.0 + 1.0.1-SNAPSHOT akismet-kotlin A client library for accessing the Automattic Kismet (Akismet) spam comments filtering service. https://github.com/ethauvin/akismet-kotlin @@ -18,6 +14,38 @@ https://opensource.org/licenses/BSD-3-Clause + + + org.jetbrains.kotlin + kotlin-stdlib + 1.9.20 + compile + + + com.squareup.okhttp3 + okhttp + 4.12.0 + compile + + + com.squareup.okhttp3 + logging-interceptor + 4.12.0 + compile + + + jakarta.servlet + jakarta.servlet-api + 6.0.0 + compile + + + org.jetbrains.kotlinx + kotlinx-serialization-json-jvm + 1.6.0 + compile + + ethauvin @@ -27,61 +55,8 @@ - scm:git:https://github.com/ethauvin/akismet-kotlin.git + scm:git:https://github.com/ethauvin/akismet-kotlin scm:git:git@github.com:ethauvin/akismet-kotlin.git https://github.com/ethauvin/akismet-kotlin - - GitHub - https://github.com/ethauvin/akismet-kotlin/issues - - - - - org.jetbrains.kotlin - kotlin-bom - 1.9.10 - pom - import - - - - - - org.jetbrains.kotlin - kotlin-stdlib-jdk8 - 1.9.10 - compile - - - jakarta.servlet - jakarta.servlet-api - 6.0.0 - runtime - - - com.squareup.okhttp3 - okhttp - 4.11.0 - runtime - - - com.squareup.okio - okio-jvm - 3.5.0 - runtime - - - com.squareup.okhttp3 - logging-interceptor - 4.11.0 - runtime - - - org.jetbrains.kotlinx - kotlinx-serialization-json-jvm - 1.6.0 - runtime - - diff --git a/settings.gradle.kts b/settings.gradle.kts deleted file mode 100644 index f93566a..0000000 --- a/settings.gradle.kts +++ /dev/null @@ -1,18 +0,0 @@ -plugins { - id("com.gradle.enterprise").version("3.6.3") -} - -gradleEnterprise { - buildScan { - link("GitHub", "https://github.com/ethauvin/akismet-kotlin/tree/master") - if (!System.getenv("CI").isNullOrEmpty()) { - isUploadInBackground = false - publishOnFailure() - tag("CI") - } - termsOfServiceUrl = "https://gradle.com/terms-of-service" - termsOfServiceAgree = "yes" - } -} - -rootProject.name = "akismet-kotlin" diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..82098a0 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,7 @@ +sonar.organization=ethauvin-github +sonar.projectKey=ethauvin_akismet-kotlin +sonar.coverage.jacoco.xmlReportPaths=build/reports/jacoco/test/jacocoTestReport.xml +sonar.sources=src/main/kotlin/ +sonar.tests=src/test/kotlin/ +sonar.java.binaries=build/main,build/test +sonar.java.libraries=lib/compile/*.jar diff --git a/src/bld/java/net/thauvin/erik/AkismetBuild.java b/src/bld/java/net/thauvin/erik/AkismetBuild.java new file mode 100644 index 0000000..9a593c4 --- /dev/null +++ b/src/bld/java/net/thauvin/erik/AkismetBuild.java @@ -0,0 +1,196 @@ +/* + * AkismetBuild.java + * + * Copyright 2019-2023 Erik C. Thauvin (erik@thauvin.net) + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * Neither the name of this project nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package net.thauvin.erik; + +import rife.bld.BuildCommand; +import rife.bld.Project; +import rife.bld.extension.CompileKotlinOperation; +import rife.bld.extension.CompileKotlinOptions; +import rife.bld.extension.GeneratedVersionOperation; +import rife.bld.extension.JacocoReportOperation; +import rife.bld.extension.dokka.DokkaOperation; +import rife.bld.extension.dokka.LoggingLevel; +import rife.bld.extension.dokka.OutputFormat; +import rife.bld.extension.dokka.SourceSet; +import rife.bld.operations.exceptions.ExitStatusException; +import rife.bld.publish.PomBuilder; +import rife.bld.publish.PublishDeveloper; +import rife.bld.publish.PublishLicense; +import rife.bld.publish.PublishScm; +import rife.tools.exceptions.FileUtilsErrorException; + +import java.io.File; +import java.io.IOException; +import java.util.List; + +import static rife.bld.dependencies.Repository.*; +import static rife.bld.dependencies.Scope.*; + +public class AkismetBuild extends Project { + public AkismetBuild() { + pkg = "net.thauvin.erik"; + name = "akismet-kotlin"; + version = version(1, 0, 1, "SNAPSHOT"); + + javaRelease = 11; + downloadSources = true; + autoDownloadPurge = true; + repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL); + + var okHttp = version(4, 12, 0); + scope(compile) + .include(dependency("org.jetbrains.kotlin", "kotlin-stdlib", version(1, 9, 20))) + .include(dependency("com.squareup.okhttp3", "okhttp", okHttp)) + .include(dependency("com.squareup.okhttp3", "logging-interceptor", okHttp)) + .include(dependency("jakarta.servlet", "jakarta.servlet-api", version(6, 0, 0))) + .include(dependency("org.jetbrains.kotlinx", "kotlinx-serialization-json-jvm", version(1, 6, 0))); + scope(provided) + .include(dependency("org.jetbrains.kotlin:kotlin-serialization-compiler-plugin:1.9.20")); + scope(test) + .include(dependency("org.mockito", "mockito-core", version(5, 6, 0))) + .include(dependency("org.jetbrains.kotlin", "kotlin-test-junit5", version(1, 9, 20))) + .include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 10, 1))) + .include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 10, 1))) + .include(dependency("com.willowtreeapps.assertk", "assertk-jvm", version(0, 27, 0))); + + publishOperation() + .repository(version.isSnapshot() ? repository(SONATYPE_SNAPSHOTS_LEGACY.location()) + .withCredentials(property("sonatype.user"), property("sonatype.password")) + : repository(SONATYPE_RELEASES_LEGACY.location()) + .withCredentials(property("sonatype.user"), property("sonatype.password"))) + .info() + .groupId(pkg) + .artifactId(name) + .description("A client library for accessing the Automattic Kismet (Akismet) spam comments filtering service.") + .url("https://github.com/ethauvin/" + name) + .developer(new PublishDeveloper() + .id("ethauvin") + .name("Erik C. Thauvin") + .email("erik@thauvin.net") + .url("https://erik.thauvin.net/")) + .license(new PublishLicense() + .name("BSD 3-Clause") + .url("https://opensource.org/licenses/BSD-3-Clause")) + .scm(new PublishScm() + .connection("scm:git:https://github.com/ethauvin/" + name) + .developerConnection("scm:git:git@github.com:ethauvin/" + name + ".git") + .url("https://github.com/ethauvin/" + name)) + .signKey(property("sign.key")) + .signPassphrase(property("sign.passphrase")); + + jarSourcesOperation().sourceDirectories(new File(srcMainDirectory(), "kotlin")); + } + + public static void main(String[] args) { + new AkismetBuild().start(args); + } + + @BuildCommand(summary = "Compiles the Kotlin project") + @Override + public void compile() throws IOException { + genver(); + new CompileKotlinOperation() + .fromProject(this) + .plugins(CompileKotlinOperation.getJarList(libCompileDirectory(), + "^.*kotlin-serialization-compiler-plugin-.*$")) + .compileOptions( + new CompileKotlinOptions() + .jdkRelease(javaRelease) + .verbose(true) + ) + .execute(); + } + + @BuildCommand(summary = "Generates documentation in HTML format") + public void docs() throws ExitStatusException, IOException, InterruptedException { + var kotlin = new File(srcMainDirectory(), "kotlin").getAbsolutePath(); + new DokkaOperation() + .fromProject(this) + .loggingLevel(LoggingLevel.INFO) + .moduleName("Akismet Kotlin") + .moduleVersion(version.toString()) + .outputDir("docs") + .outputFormat(OutputFormat.HTML) + .sourceSet( + new SourceSet() + .src(kotlin) + .srcLink(kotlin, "https://github.com/ethauvin/" + name + + "/tree/master/src/main/kotlin/", "#L") + .includes("config/dokka/packages.md") + .jdkVersion(javaRelease) + ) + .execute(); + } + + @BuildCommand(summary = "Generates version class") + public void genver() { + new GeneratedVersionOperation() + .fromProject(this) + .projectName("Akismet Kotlin") + .packageName(pkg + ".akismet") + .classTemplate(new File(workDirectory(), "version.txt")) + .directory(new File(srcMainDirectory(), "kotlin")) + .extension(".kt") + .execute(); + } + + @BuildCommand(summary = "Generates JaCoCo Reports") + public void jacoco() throws IOException { + new JacocoReportOperation() + .fromProject(this) + .execute(); + } + + @Override + public void javadoc() throws ExitStatusException, IOException, InterruptedException { + new DokkaOperation() + .fromProject(this) + .loggingLevel(LoggingLevel.INFO) + .moduleName("Bitly Shorten") + .moduleVersion(version.toString()) + .outputDir(new File(buildDirectory(), "javadoc")) + .outputFormat(OutputFormat.JAVADOC) + .execute(); + } + + @Override + public void publish() throws Exception { + super.publish(); + pomRoot(); + } + + @BuildCommand(value = "pom-root", summary = "Generates the POM file in the root directory") + public void pomRoot() throws FileUtilsErrorException { + PomBuilder.generateInto(publishOperation().fromProject(this).info(), dependencies(), + new File(workDirectory, "pom.xml")); + } +} diff --git a/src/main/kotlin/net/thauvin/erik/akismet/Akismet.kt b/src/main/kotlin/net/thauvin/erik/akismet/Akismet.kt index 285c835..8311f88 100644 --- a/src/main/kotlin/net/thauvin/erik/akismet/Akismet.kt +++ b/src/main/kotlin/net/thauvin/erik/akismet/Akismet.kt @@ -1,8 +1,7 @@ /* * Akismet.kt * - * Copyright (c) 2019-2023, Erik C. Thauvin (erik@thauvin.net) - * All rights reserved. + * Copyright 2019-2023 Erik C. Thauvin (erik@thauvin.net) * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -32,7 +31,6 @@ package net.thauvin.erik.akismet import kotlinx.serialization.json.Json -import net.thauvin.erik.semver.Version import okhttp3.FormBody import okhttp3.HttpUrl import okhttp3.HttpUrl.Companion.toHttpUrl @@ -45,7 +43,7 @@ import java.time.OffsetDateTime import java.time.ZoneId import java.time.format.DateTimeFormatter import java.time.temporal.ChronoUnit -import java.util.Date +import java.util.* import java.util.logging.Level import java.util.logging.Logger @@ -54,7 +52,6 @@ import java.util.logging.Logger * * @constructor Creates a new instance using the provided [Akismet](https://www.askimet.com/) API key. */ -@Version(properties = "version.properties", type = "kt") open class Akismet(apiKey: String) { companion object { /** @@ -135,7 +132,6 @@ open class Akismet(apiKey: String) { /** * The [HTTP status code](https://www.restapitutorial.com/httpstatuscodes.html) of the last operation. */ - @Suppress("MemberVisibilityCanBePrivate") var httpStatusCode: Int = 0 private set @@ -144,7 +140,6 @@ open class Akismet(apiKey: String) { * * For example: `true`, `false`, `valid`, `invalid`, etc. */ - @Suppress("MemberVisibilityCanBePrivate") var response: String = "" private set @@ -168,7 +163,6 @@ open class Akismet(apiKey: String) { * * @see [Akismet.isDiscard] */ - @Suppress("MemberVisibilityCanBePrivate") var proTip: String = "" private set @@ -180,7 +174,6 @@ open class Akismet(apiKey: String) { * * @see [Akismet.proTip] */ - @Suppress("MemberVisibilityCanBePrivate") var isDiscard: Boolean = false private set diff --git a/src/main/kotlin/net/thauvin/erik/akismet/AkismetComment.kt b/src/main/kotlin/net/thauvin/erik/akismet/AkismetComment.kt index 5365898..c7ae7af 100644 --- a/src/main/kotlin/net/thauvin/erik/akismet/AkismetComment.kt +++ b/src/main/kotlin/net/thauvin/erik/akismet/AkismetComment.kt @@ -1,8 +1,7 @@ /* * AkismetComment.kt * - * Copyright (c) 2019-2023, Erik C. Thauvin (erik@thauvin.net) - * All rights reserved. + * Copyright 2019-2023 Erik C. Thauvin (erik@thauvin.net) * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -58,7 +57,6 @@ private fun String?.ifNull() = this ?: "" */ @Serializable open class AkismetComment(val userIp: String, val userAgent: String) { - @Suppress("unused") companion object { /** A blog comment. */ const val TYPE_COMMENT = "comment" diff --git a/src/main/kotlin/net/thauvin/erik/akismet/GeneratedVersion.kt b/src/main/kotlin/net/thauvin/erik/akismet/GeneratedVersion.kt new file mode 100644 index 0000000..8f63ec2 --- /dev/null +++ b/src/main/kotlin/net/thauvin/erik/akismet/GeneratedVersion.kt @@ -0,0 +1,14 @@ +/* +* This file is automatically generated. +* Do not modify! -- ALL CHANGES WILL BE ERASED! +*/ + +package net.thauvin.erik.akismet + +/** +* Provides semantic version information. +*/ +internal object GeneratedVersion { + const val PROJECT = "Akismet Kotlin" + const val VERSION = "1.0.1-SNAPSHOT" +} diff --git a/src/test/java/net/thauvin/erik/AkismetTest.java b/src/test/java/net/thauvin/erik/AkismetTest.java new file mode 100644 index 0000000..ea4fecc --- /dev/null +++ b/src/test/java/net/thauvin/erik/AkismetTest.java @@ -0,0 +1,46 @@ +/* + * AkismetTest.java + * + * Copyright 2019-2023 Erik C. Thauvin (erik@thauvin.net) + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * Neither the name of this project nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package net.thauvin.erik; + +public class AkismetTest { + public static void main(String[] args) { + new AkismetTest().verifyHello(); + } + + void verifyHello() { + if (!"Hello World!".equals(new AkismetLib().getMessage())) { + throw new AssertionError(); + } else { + System.out.println("Succeeded"); + } + } +} diff --git a/src/test/kotlin/net/thauvin/erik/akismet/AkismetTest.kt b/src/test/kotlin/net/thauvin/erik/akismet/AkismetTest.kt index 1db1803..2d9cb80 100644 --- a/src/test/kotlin/net/thauvin/erik/akismet/AkismetTest.kt +++ b/src/test/kotlin/net/thauvin/erik/akismet/AkismetTest.kt @@ -1,8 +1,7 @@ /* * AkismetTest.kt * - * Copyright (c) 2019-2023, Erik C. Thauvin (erik@thauvin.net) - * All rights reserved. + * Copyright 2019-2023 Erik C. Thauvin (erik@thauvin.net) * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -34,36 +33,27 @@ package net.thauvin.erik.akismet import assertk.all import assertk.assertThat -import assertk.assertions.contains -import assertk.assertions.isEmpty -import assertk.assertions.isEqualTo -import assertk.assertions.isFalse -import assertk.assertions.isNotEmpty -import assertk.assertions.isTrue -import assertk.assertions.key -import assertk.assertions.prop -import assertk.assertions.size +import assertk.assertions.* import jakarta.servlet.http.HttpServletRequest import okhttp3.FormBody import okhttp3.HttpUrl.Companion.toHttpUrl +import org.junit.Assert.assertThrows +import org.junit.BeforeClass +import org.junit.jupiter.api.Test import org.mockito.Mockito import org.mockito.Mockito.`when` -import org.testng.Assert.assertEquals -import org.testng.Assert.assertFalse -import org.testng.Assert.assertNotEquals -import org.testng.Assert.assertTrue -import org.testng.Assert.expectThrows -import org.testng.annotations.BeforeClass -import org.testng.annotations.Test import java.io.File import java.io.FileInputStream import java.time.LocalDateTime import java.time.ZoneId -import java.util.Collections -import java.util.Date -import java.util.Properties +import java.util.* import java.util.logging.ConsoleHandler import java.util.logging.Level +import kotlin.test.assertEquals +import kotlin.test.assertFalse +import kotlin.test.assertNotEquals +import kotlin.test.assertTrue + fun getKey(key: String): String { var value = System.getenv(key) ?: "" @@ -88,84 +78,40 @@ fun getKey(key: String): String { * AKISMET_API_KEY and AKISMET_BLOG should be in env vars or local.properties */ class AkismetTest { - private val apiKey = getKey("AKISMET_API_KEY") - private val blog = getKey("AKISMET_BLOG") - private val referer = "http://www.google.com" - private val date = Date() - private val comment = AkismetComment( - userIp = "127.0.0.1", - userAgent = "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6" - ) - private val akismet = Akismet(apiKey, blog) - private val mockComment: AkismetComment = AkismetComment(request = getMockRequest()) private val emptyFormBody = FormBody.Builder().build() - @BeforeClass - fun beforeClass() { - with(akismet.logger) { - addHandler(ConsoleHandler().apply { level = Level.FINE }) - level = Level.FINE - } - - with(comment) { - referrer = referer - permalink = "http://yourblogdomainname.com/blog/post=1" - type = AkismetComment.TYPE_COMMENT - author = "admin" - authorEmail = "test@test.com" - authorUrl = "http://www.CheckOutMyCoolSite.com" - content = "It means a lot that you would take the time to review our software. Thanks again." - dateGmt = Akismet.dateToGmt(date) - postModifiedGmt = dateGmt - blogLang = "en" - blogCharset = "UTF-8" - userRole = AkismetComment.ADMIN_ROLE - isTest = true - } - - akismet.logger.info(comment.toString()) - - with(mockComment) { - permalink = comment.permalink - type = comment.type - authorEmail = comment.authorEmail - author = comment.author - authorUrl = comment.authorUrl - content = comment.content - dateGmt = comment.dateGmt - postModifiedGmt = comment.dateGmt - blogLang = comment.blogLang - blogCharset = comment.blogCharset - userRole = comment.userRole - recheckReason = "edit" - isTest = true - } - - akismet.logger.info(mockComment.toJson()) - } - @Test fun constructorsTest() { - expectThrows(IllegalArgumentException::class.java) { + assertThrows( + IllegalArgumentException::class.java + ) { Akismet("") } - expectThrows(IllegalArgumentException::class.java) { + assertThrows( + IllegalArgumentException::class.java + ) { Akismet("1234") } - expectThrows(IllegalArgumentException::class.java) { + assertThrows( + IllegalArgumentException::class.java + ) { Akismet("123456789 12") } - expectThrows(IllegalArgumentException::class.java) { + assertThrows( + IllegalArgumentException::class.java + ) { Akismet("123456789012", "") } - expectThrows(IllegalArgumentException::class.java) { + assertThrows( + IllegalArgumentException::class.java + ) { Akismet("1234", "foo") } } @Test fun blogPropertyTest() { - expectThrows(IllegalArgumentException::class.java) { + assertThrows(IllegalArgumentException::class.java) { akismet.blog = "" } @@ -208,9 +154,10 @@ class AkismetTest { @Test fun emptyCommentTest() { - expectThrows(IllegalArgumentException::class.java) { - akismet.checkComment(AkismetComment("", "")) - } + assertThrows( + java.lang.IllegalArgumentException::class.java + ) { akismet.checkComment(AkismetComment("", "")) } + val empty = AkismetComment("", "") assertThat(empty, "AkismetComment(empty)").all { @@ -308,6 +255,7 @@ class AkismetTest { emptyFormBody ) ) + assertThat(akismet, "executeMethod(pro-tip)").all { prop(Akismet::proTip).isEqualTo("discard") prop(Akismet::isDiscard).isTrue() @@ -358,9 +306,12 @@ class AkismetTest { } } - @Test(expectedExceptions = [IllegalArgumentException::class]) + @Test fun invalidApiTest() { - akismet.executeMethod("https://.com".toHttpUrl(), emptyFormBody) + assertThrows( + java.lang.IllegalArgumentException::class.java + ) { akismet.executeMethod("https://.com".toHttpUrl(), emptyFormBody) } + } @Test @@ -395,7 +346,7 @@ class AkismetTest { jsonComment.recheckReason = "" assertNotEquals(jsonComment, mockComment, "jsonComment != jsonComment") - assertNotEquals(this, comment, "this != comment") + assertThat(this, "this != comment").isNotEqualTo(comment) } @Test @@ -415,19 +366,78 @@ class AkismetTest { assertThat(comment::dateGmt).isEqualTo(utcDate) } - private fun getMockRequest(): HttpServletRequest { - val request = Mockito.mock(HttpServletRequest::class.java) - with(request) { - `when`(remoteAddr).thenReturn(comment.userIp) - `when`(requestURI).thenReturn("/blog/post=1") - `when`(getHeader("referer")).thenReturn(referer) - `when`(getHeader("Cookie")).thenReturn("name=value; name2=value2; name3=value3") - `when`(getHeader("User-Agent")).thenReturn(comment.userAgent) - `when`(getHeader("Accept-Encoding")).thenReturn("gzip") - `when`(headerNames).thenReturn( - Collections.enumeration(listOf("User-Agent", "referer", "Cookie", "Accept-Encoding", "Null")) - ) + companion object { + private val apiKey = getKey("AKISMET_API_KEY") + private val blog = getKey("AKISMET_BLOG") + private val akismet = Akismet(apiKey, blog) + private val comment = AkismetComment( + userIp = "127.0.0.1", + userAgent = "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6" + ) + private val date = Date() + private val mockComment: AkismetComment = AkismetComment(request = getMockRequest()) + private const val REFERER = "http://www.google.com" + + init { + with(comment) { + referrer = REFERER + permalink = "http://yourblogdomainname.com/blog/post=1" + type = AkismetComment.TYPE_COMMENT + author = "admin" + authorEmail = "test@test.com" + authorUrl = "http://www.CheckOutMyCoolSite.com" + content = "It means a lot that you would take the time to review our software. Thanks again." + dateGmt = Akismet.dateToGmt(date) + postModifiedGmt = dateGmt + blogLang = "en" + blogCharset = "UTF-8" + userRole = AkismetComment.ADMIN_ROLE + isTest = true + } + + with(mockComment) { + permalink = comment.permalink + type = comment.type + authorEmail = comment.authorEmail + author = comment.author + authorUrl = comment.authorUrl + content = comment.content + dateGmt = comment.dateGmt + postModifiedGmt = comment.dateGmt + blogLang = comment.blogLang + blogCharset = comment.blogCharset + userRole = comment.userRole + recheckReason = "edit" + isTest = true + } + } + + @JvmStatic + @BeforeClass + fun beforeClass() { + with(akismet.logger) { + addHandler(ConsoleHandler().apply { level = Level.FINE }) + level = Level.FINE + } + + akismet.logger.info(comment.toString()) + akismet.logger.info(mockComment.toJson()) + } + + private fun getMockRequest(): HttpServletRequest { + val request = Mockito.mock(HttpServletRequest::class.java) + with(request) { + `when`(remoteAddr).thenReturn(comment.userIp) + `when`(requestURI).thenReturn("/blog/post=1") + `when`(getHeader("referer")).thenReturn(REFERER) + `when`(getHeader("Cookie")).thenReturn("name=value; name2=value2; name3=value3") + `when`(getHeader("User-Agent")).thenReturn(comment.userAgent) + `when`(getHeader("Accept-Encoding")).thenReturn("gzip") + `when`(headerNames).thenReturn( + Collections.enumeration(listOf("User-Agent", "referer", "Cookie", "Accept-Encoding", "Null")) + ) + } + return request } - return request } } diff --git a/version.mustache b/version.mustache deleted file mode 100644 index 34a4442..0000000 --- a/version.mustache +++ /dev/null @@ -1,18 +0,0 @@ -/* -* This file is automatically generated. -* Do not modify! -- ALL CHANGES WILL BE ERASED! -*/ - -package {{packageName}} - -/** -* Provides semantic version information. -* -* @author Semantic Version Annotation Processor -*/ -internal object {{className}} { - @JvmField - val PROJECT = "{{project}}" - @JvmField - val VERSION = "{{version}}" -} diff --git a/version.properties b/version.properties deleted file mode 100644 index 056f575..0000000 --- a/version.properties +++ /dev/null @@ -1,9 +0,0 @@ -#Generated by the Semver Plugin for Gradle -#Sun May 02 22:00:05 PDT 2021 -version.buildmeta= -version.major=1 -version.minor=0 -version.patch=0 -version.prerelease= -version.project=Akismet Kotlin -version.semver=1.0.0 diff --git a/version.txt b/version.txt new file mode 100644 index 0000000..2686ea8 --- /dev/null +++ b/version.txt @@ -0,0 +1,14 @@ +/* +* This file is automatically generated. +* Do not modify! -- ALL CHANGES WILL BE ERASED! +*/ + +package {{v packageName/}} + +/** +* Provides semantic version information. +*/ +internal object {{v className/}} { + const val PROJECT = "{{v project/}}" + const val VERSION = "{{v version/}}" +}