diff --git a/.circleci/config.yml b/.circleci/config.yml
index c781fdc..7c98f61 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -1,62 +1,82 @@
-version: 2.1
-
-orbs:
- sdkman: joshdholtz/sdkman@0.2.0
-
defaults: &defaults
working_directory: ~/repo
environment:
JVM_OPTS: -Xmx3200m
TERM: dumb
- CI_NAME: "CircleCI"
-commands:
- build_and_test:
- parameters:
- reports-dir:
- type: string
- default: "build/reports/test_results"
- steps:
- - checkout
- - sdkman/setup-sdkman
- - sdkman/sdkman-install:
- candidate: kotlin
- version: 2.1.10
- - run:
- name: Download dependencies
- command: ./bld download
- - run:
- name: Compile source
- command: ./bld compile
- - run:
- name: Run tests
- command: ./bld jacoco -reports-dir=<< parameters.reports-dir >>
- - store_test_results:
- path: << parameters.reports-dir >>
- - store_artifacts:
- path: build/reports/jacoco/test/html
+version: 2.0
jobs:
- bld_jdk17:
+
+ build_gradle:
<<: *defaults
docker:
- - image: cimg/openjdk:17.0
+ - image: circleci/openjdk:8-jdk
steps:
- - build_and_test
+ - checkout
+ - restore_cache:
+ keys:
+ - gradle-dependencies-{{ checksum "build.gradle.kts" }}
+ # fallback to using the latest cache if no exact match is found
+ - gradle-dependencies-
- bld_jdk21:
+ - run:
+ name: Gradle Dependencies
+ command: ./gradlew dependencies
+
+ - save_cache:
+ paths: ~/.m2
+ key: gradle-dependencies-{{ checksum "build.gradle.kts" }}
+
+ - run:
+ name: Run All Checks
+ command: ./gradlew check
+
+ - store_artifacts:
+ path: build/reports/
+ destination: reports
+ - store_test_results:
+ path: build/reports/
+
+ build_kobalt:
<<: *defaults
docker:
- - image: cimg/openjdk:21.0
+ - image: circleci/openjdk:8-jdk
steps:
- - build_and_test
+ - checkout
+ - restore_cache:
+ keys:
+ - kobalt-dependencies-{{ checksum "kobalt/src/Build.kt" }}
+ # fallback to using the latest cache if no exact match is found
+ - kobalt-dependencies-
+
+ - run:
+ name: Check Versions
+ command: ./kobaltw checkVersions
+
+ - save_cache:
+ paths: ~/.kobalt
+ key: kobalt-dependencies-{{ checksum "kobalt/src/Build.kt" }}
+
+ - run:
+ name: Assemble & Test
+ command: ./kobaltw assemble test
+
+ - store_artifacts:
+ path: kobaltBuild/test-output/
+ destination: test-output
+ - store_test_results:
+ path: kobaltBuild/test-output/
workflows:
- bld:
+ version: 2
+ gradle:
jobs:
- - bld_jdk17
- - bld_jdk21
+ - build_gradle
+ kobalt:
+ jobs:
+ - build_kobalt
\ No newline at end of file
diff --git a/.editorconfig b/.editorconfig
deleted file mode 100644
index a6971e1..0000000
--- a/.editorconfig
+++ /dev/null
@@ -1,2 +0,0 @@
-[*]
-insert_final_newline=true
diff --git a/.github/workflows/bld.yml b/.github/workflows/bld.yml
deleted file mode 100644
index e6e7ffa..0000000
--- a/.github/workflows/bld.yml
+++ /dev/null
@@ -1,73 +0,0 @@
-name: bld-ci
-
-on: [ push, pull_request, workflow_dispatch ]
-
-env:
- COVERAGE_JDK: "21"
- COVERAGE_KOTLIN: "2.1.20"
- PINBOARD_API_TOKEN: ${{ secrets.PINBOARD_API_TOKEN }}
-
-jobs:
- build-bld-project:
- strategy:
- matrix:
- java-version: [ 17, 21, 24 ]
- kotlin-version: [ 1.9.25, 2.0.21, 2.1.20 ]
- os: [ ubuntu-latest, windows-latest, macos-latest ]
-
- runs-on: ${{ matrix.os }}
-
- steps:
- - name: Checkout source repository
- uses: actions/checkout@v4
- with:
- fetch-depth: 0
-
- - name: Set up JDK ${{ matrix.java-version }} with Kotlin ${{ matrix.kotlin-version }}
- uses: actions/setup-java@v4
- with:
- distribution: "zulu"
- java-version: ${{ matrix.java-version }}
-
- - name: Download dependencies [bld example]
- working-directory: examples/bld
- run: ./bld download
-
- - name: Compile and run examples [bld example]
- working-directory: examples/bld
- run: |
- ./bld compile
- ./bld run
- ./bld run-java
-
- - name: Run example [gradle java example]
- working-directory: examples/gradle/java
- run: |
- ./gradlew run
-
- - name: Run example [gradle kotlin example]
- working-directory: examples/gradle/kotlin
- run: |
- ./gradlew run
-
- - name: Download dependencies
- run: ./bld download
-
- - name: Compile source
- run: ./bld compile
-
- - name: Run tests
- run: ./bld jacoco
-
- - name: Remove pom.xml
- if: success() && matrix.java-version == env.COVERAGE_JDK && matrix.kotlin-version == env.COVERAGE_KOTLIN
- && matrix.os == 'ubuntu-latest'
- run: rm -rf pom.xml
-
- - name: SonarCloud Scan
- uses: sonarsource/sonarcloud-github-action@master
- if: success() && matrix.java-version == env.COVERAGE_JDK && matrix.kotlin-version == env.COVERAGE_KOTLIN
- && matrix.os == 'ubuntu-latest'
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
diff --git a/.github_changelog_generator b/.github_changelog_generator
deleted file mode 100644
index 19e45d2..0000000
--- a/.github_changelog_generator
+++ /dev/null
@@ -1 +0,0 @@
-future-release=1.1.0
diff --git a/.gitignore b/.gitignore
index 3402a75..7ad0aa5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,58 +1,30 @@
-.gradle
+**/.idea/dictionaries
+**/.idea/gradle.xml
+**/.idea/libraries
+**/.idea/tasks.xml
+**/.idea/workspace.xml
+*.sublime-*
+*.iws
+.classpath
.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
-
-
-local.properties
+.gradle
+.kobalt
+.nb-gradle
+.project
+.settings
+/bin
+/build
+/deploy
+/dist
+/gen
+/gradle.properties
+/local.properties
+/out
+/proguard-project.txt
+/project.properties
+/target
+/test-output
+ehthumbs.db
+kobaltBuild
+kobaltw*-test
+Thumbs.db
\ No newline at end of file
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
deleted file mode 100644
index 10b9b0f..0000000
--- a/.gitlab-ci.yml
+++ /dev/null
@@ -1,24 +0,0 @@
-image: fedora:latest
-
-variables:
- CI_NAME: "GitLab CI"
-
-stages:
- - test
-
-before_script:
- - dnf -qy update && dnf -y install zip
- - curl -s "https://get.sdkman.io" | bash
- - echo sdkman_auto_answer=true > $HOME/.sdkman/etc/config
- - echo sdkman_auto_selfupdate=true >> $HOME/.sdkman/etc/config
- - source "$HOME/.sdkman/bin/sdkman-init.sh"
- - sdk install java
- - sdk install kotlin
- - source "$HOME/.sdkman/bin/sdkman-init.sh"
-
-test:
- stage: test
- script:
- - ./bld download
- - ./bld compile
- - ./bld test
diff --git a/.idea/app.iml b/.idea/app.iml
deleted file mode 100644
index 2c1fe21..0000000
--- a/.idea/app.iml
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/bld.iml b/.idea/bld.iml
deleted file mode 100644
index e63e11e..0000000
--- a/.idea/bld.iml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
new file mode 100644
index 0000000..0dbc0e0
--- /dev/null
+++ b/.idea/compiler.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/copyright/Erik_s_Copyright_Notice.xml b/.idea/copyright/Erik_s_Copyright_Notice.xml
index ab1f825..e000a9b 100644
--- a/.idea/copyright/Erik_s_Copyright_Notice.xml
+++ b/.idea/copyright/Erik_s_Copyright_Notice.xml
@@ -1,6 +1,5 @@
-
-
+
\ No newline at end of file
diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml
index 1419e40..a25e371 100644
--- a/.idea/copyright/profiles_settings.xml
+++ b/.idea/copyright/profiles_settings.xml
@@ -1,3 +1,15 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/bld.xml b/.idea/encodings.xml
similarity index 54%
rename from .idea/bld.xml
rename to .idea/encodings.xml
index 6600cee..97626ba 100644
--- a/.idea/bld.xml
+++ b/.idea/encodings.xml
@@ -1,6 +1,6 @@
-
-
+
+
\ No newline at end of file
diff --git a/.idea/icon.svg b/.idea/icon.svg
deleted file mode 100644
index 94a6708..0000000
--- a/.idea/icon.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
index 94f28ea..8ff795e 100644
--- a/.idea/inspectionProfiles/Project_Default.xml
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -1,9 +1,53 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
\ No newline at end of file
diff --git a/.idea/kobalt.xml b/.idea/kobalt.xml
new file mode 100644
index 0000000..3eddb49
--- /dev/null
+++ b/.idea/kobalt.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml
new file mode 100644
index 0000000..b072dc0
--- /dev/null
+++ b/.idea/kotlinc.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/bld.xml b/.idea/libraries/bld.xml
deleted file mode 100644
index 153a060..0000000
--- a/.idea/libraries/bld.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/.idea/libraries/compile.xml b/.idea/libraries/compile.xml
deleted file mode 100644
index 99cc0c0..0000000
--- a/.idea/libraries/compile.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/runtime.xml b/.idea/libraries/runtime.xml
deleted file mode 100644
index d4069f2..0000000
--- a/.idea/libraries/runtime.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/test.xml b/.idea/libraries/test.xml
deleted file mode 100644
index 57ed5ef..0000000
--- a/.idea/libraries/test.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 2adb169..794aa67 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -1,27 +1,4 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
index 55adcb9..e86bd42 100644
--- a/.idea/modules.xml
+++ b/.idea/modules.xml
@@ -2,8 +2,17 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/pinboard-poster_main.iml b/.idea/modules/pinboard-poster_main.iml
new file mode 100644
index 0000000..1e47802
--- /dev/null
+++ b/.idea/modules/pinboard-poster_main.iml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/pinboard-poster_test.iml b/.idea/modules/pinboard-poster_test.iml
new file mode 100644
index 0000000..a1f7158
--- /dev/null
+++ b/.idea/modules/pinboard-poster_test.iml
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/samples-java.iml b/.idea/modules/samples-java.iml
new file mode 100644
index 0000000..19b4065
--- /dev/null
+++ b/.idea/modules/samples-java.iml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/samples-java_main.iml b/.idea/modules/samples-java_main.iml
new file mode 100644
index 0000000..f16e049
--- /dev/null
+++ b/.idea/modules/samples-java_main.iml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/samples-java_test.iml b/.idea/modules/samples-java_test.iml
new file mode 100644
index 0000000..56ba4d8
--- /dev/null
+++ b/.idea/modules/samples-java_test.iml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/samples-koltin.iml b/.idea/modules/samples-koltin.iml
new file mode 100644
index 0000000..19a4623
--- /dev/null
+++ b/.idea/modules/samples-koltin.iml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/samples-koltin_main.iml b/.idea/modules/samples-koltin_main.iml
new file mode 100644
index 0000000..bdcf78b
--- /dev/null
+++ b/.idea/modules/samples-koltin_main.iml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/samples-koltin_test.iml b/.idea/modules/samples-koltin_test.iml
new file mode 100644
index 0000000..3886186
--- /dev/null
+++ b/.idea/modules/samples-koltin_test.iml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/gradle/kotlin/.idea/kotlin.iml b/.idea/modules/samples-kotlin.iml
similarity index 82%
rename from examples/gradle/kotlin/.idea/kotlin.iml
rename to .idea/modules/samples-kotlin.iml
index d6ebd48..813d9e8 100644
--- a/examples/gradle/kotlin/.idea/kotlin.iml
+++ b/.idea/modules/samples-kotlin.iml
@@ -2,7 +2,7 @@
-
+
diff --git a/.idea/runConfigurations/Run Tests.xml b/.idea/runConfigurations/Run Tests.xml
deleted file mode 100644
index 2d4326e..0000000
--- a/.idea/runConfigurations/Run Tests.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/scopes/Source.xml b/.idea/scopes/Source.xml
new file mode 100644
index 0000000..942e059
--- /dev/null
+++ b/.idea/scopes/Source.xml
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml
new file mode 100644
index 0000000..e96534f
--- /dev/null
+++ b/.idea/uiDesigner.xml
@@ -0,0 +1,124 @@
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
index 35eb1dd..94a25f7 100644
--- a/.idea/vcs.xml
+++ b/.idea/vcs.xml
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..68dca32
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,19 @@
+language: java
+
+jdk:
+ - oraclejdk8
+
+before_cache:
+ - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
+ - rm -fr $HOME/.gradle/caches/*/plugin-resolution/
+
+before_install:
+ - chmod +x gradlew
+
+script:
+ - ./gradlew check
+
+cache:
+ directories:
+ - $HOME/.gradle/caches/
+ - $HOME/.gradle/wrapper/
\ No newline at end of file
diff --git a/.vscode/launch.json b/.vscode/launch.json
deleted file mode 100644
index f25500c..0000000
--- a/.vscode/launch.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "version": "0.2.0",
- "configurations": [
- {
- "type": "java",
- "name": "Run Tests",
- "request": "launch",
- "mainClass": "net.thauvin.erik.pinboard.PinboardPosterTest"
- }
- ]
-}
diff --git a/.vscode/settings.json b/.vscode/settings.json
deleted file mode 100644
index ba429d0..0000000
--- a/.vscode/settings.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "java.project.sourcePaths": [
- "src/main/java",
- "src/main/resources",
- "src/test/java",
- "src/test/resources",
- "src/bld/java",
- "src/bld/resources"
- ],
- "java.configuration.updateBuildConfiguration": "automatic",
- "java.project.referencedLibraries": [
- "${HOME}/.bld/dist/bld-2.2.1.jar",
- "lib/**/*.jar"
- ]
-}
diff --git a/CHANGELOG.md b/CHANGELOG.md
deleted file mode 100644
index 9c318e1..0000000
--- a/CHANGELOG.md
+++ /dev/null
@@ -1,61 +0,0 @@
-# Changelog
-
-## [1.1.0](https://github.com/ethauvin/pinboard-poster/tree/1.1.0) (2023-09-28)
-
-[Full Changelog](https://github.com/ethauvin/pinboard-poster/compare/1.0.3...1.1.0)
-
-**Implemented enhancements:**
-
-- Add pin config builder [\#10](https://github.com/ethauvin/pinboard-poster/issues/10)
-
-**Fixed bugs:**
-
-- Fixed potential resource leak [\#11](https://github.com/ethauvin/pinboard-poster/issues/11)
-
-## [1.0.3](https://github.com/ethauvin/pinboard-poster/tree/1.0.3) (2021-03-22)
-
-[Full Changelog](https://github.com/ethauvin/pinboard-poster/compare/1.0.2...1.0.3)
-
-**Fixed bugs:**
-
-- 1.0.2 only compiled for Java 15 [\#4](https://github.com/ethauvin/pinboard-poster/issues/4)
-
-## [1.0.2](https://github.com/ethauvin/pinboard-poster/tree/1.0.2) (2021-03-22)
-
-[Full Changelog](https://github.com/ethauvin/pinboard-poster/compare/1.0.1...1.0.2)
-
-**Implemented enhancements:**
-
-- Use HttpLoggingInterceptor instead of manually logging. [\#3](https://github.com/ethauvin/pinboard-poster/issues/3)
-
-**Fixed bugs:**
-
-- executeMethod should trap IO execeptions [\#2](https://github.com/ethauvin/pinboard-poster/issues/2)
-
-## [1.0.1](https://github.com/ethauvin/pinboard-poster/tree/1.0.1) (2019-05-27)
-
-[Full Changelog](https://github.com/ethauvin/pinboard-poster/compare/1.0.0...1.0.1)
-
-**Implemented enhancements:**
-
-- Implement better error reporting. [\#1](https://github.com/ethauvin/pinboard-poster/issues/1)
-
-## [1.0.0](https://github.com/ethauvin/pinboard-poster/tree/1.0.0) (2018-06-26)
-
-[Full Changelog](https://github.com/ethauvin/pinboard-poster/compare/0.9.3...1.0.0)
-
-## [0.9.3](https://github.com/ethauvin/pinboard-poster/tree/0.9.3) (2017-11-09)
-
-[Full Changelog](https://github.com/ethauvin/pinboard-poster/compare/0.9.2...0.9.3)
-
-## [0.9.2](https://github.com/ethauvin/pinboard-poster/tree/0.9.2) (2017-11-08)
-
-[Full Changelog](https://github.com/ethauvin/pinboard-poster/compare/0.9.1...0.9.2)
-
-## [0.9.1](https://github.com/ethauvin/pinboard-poster/tree/0.9.1) (2017-05-18)
-
-[Full Changelog](https://github.com/ethauvin/pinboard-poster/compare/2ee3568e40114e19b0956ea7d12c071d5c49b0d5...0.9.1)
-
-
-
-\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
diff --git a/LICENSE.txt b/LICENCE.txt
similarity index 95%
rename from LICENSE.txt
rename to LICENCE.txt
index 9926d00..8bbc8da 100644
--- a/LICENSE.txt
+++ b/LICENCE.txt
@@ -1,4 +1,4 @@
-Copyright (c) 2017-2025, Erik C. Thauvin (erik@thauvin.net)
+Copyright (c) 2017-2018, Erik C. Thauvin (erik@thauvin.net)
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -24,4 +24,4 @@ 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.
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
diff --git a/README.md b/README.md
index cdf7df5..d32566c 100644
--- a/README.md
+++ b/README.md
@@ -1,18 +1,9 @@
-# [Pinboard](https://pinboard.in) Poster for Kotlin, Java and Android
+# [Pinboard](https://pinboard.in) Poster for Kotlin/Java
-[](https://opensource.org/licenses/BSD-3-Clause)
-[](https://kotlinlang.org/)
-[](https://rife2.com/bld)
-[](https://github.com/ethauvin/pinboard-poster/releases/latest)
-[](https://central.sonatype.com/artifact/net.thauvin.erik/pinboard-poster)
-[](https://oss.sonatype.org/content/repositories/snapshots/net/thauvin/erik/pinboard-poster/)
+[](http://opensource.org/licenses/BSD-3-Clause) [](https://github.com/ethauvin/pinboard-poster/releases/latest) [](https://bintray.com/ethauvin/maven/pinboard-poster/_latestVersion)
+[](https://snyk.io/test/github/ethauvin/pinboard-poster?targetFile=pom.xml) [](https://travis-ci.org/ethauvin/pinboard-poster) [](https://circleci.com/gh/ethauvin/pinboard-poster/tree/master)
-
-[](https://sonarcloud.io/dashboard?id=ethauvin_pinboard-poster)
-[](https://github.com/ethauvin/pinboard-poster/actions/workflows/bld.yml)
-[](https://circleci.com/gh/ethauvin/pinboard-poster/tree/master)
-
-A small library for posting to [Pinboard](https://pinboard.in).
+A small Kotlin/Java library for posting to [Pinboard](https://pinboard.in).
## Examples
@@ -22,80 +13,74 @@ A small library for posting to [Pinboard](https://pinboard.in).
val poster = PinboardPoster("user:TOKEN")
-poster.addPin("https://example.com/foo", "This is a test")
-poster.addPin("https://example.com", "This is a test", tags = arrayOf("foo", "bar"))
-poster.deletePin("https://example.com/bar")
+poster.addPin("http://www.example.com/foo", "This is a test")
+poster.deletePin("http:///www.example.com/bar")
```
-
-[View Examples](https://github.com/ethauvin/pinboard-poster/blob/master/examples)
+[View Example](https://github.com/ethauvin/pinboard-poster/blob/master/samples/koltin/src/main/kotlin/net/thauvin/erik/pinboard/samples/KotlinExample.kt)
### Java
-
```java
final PinboardPoster poster = new PinBboardPoster("user:TOKEN");
-poster.addPin("https://example.com/foo", "This is a test");
-poster.addPin(new PinConfig.Builder("https://example.com", "This is a test")
- .tags("foo", "bar")
- .build());
-poster.deletePin("https://example.com/bar");
+poster.addPin("http://www.example.com/foo", "This is a test");
+poster.deletePin("http:///www.example.com/bar");
```
-
-[View Examples](https://github.com/ethauvin/pinboard-poster/blob/master/examples)
+[View Example](https://github.com/ethauvin/pinboard-poster/blob/master/samples/java/src/main/java/net/thauvin/erik/pinboard/samples/JavaExample.java)
Your API authentication token is available on the [Pinboard settings page](https://pinboard.in/settings/password).
-## bld
+## Usage with Maven, Gradle and Kobalt
-To use with [bld](https://rife2.com/bld), include the following dependency in your [build](https://github.com/ethauvin/pinboard-poster/blob/master/examples/bld/src/bld/java/net/thauvin/erik/pinboard/samples/ExampleBuild.java) file:
+### Maven
-```java
-repositories = List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS_LEGACY);
+To install and run from Maven, configure an artifact as follows:
-scope(compile)
- .include(dependency("net.thauvin.erik:pinboard-poster:1.2.0"));
+```xml
+
+ net.thauvin.erik
+ pinboard-poster
+ 1.0.0
+
```
-Be sure to use the [bld Kotlin extension](https://github.com/rife2/bld-kotlin) in your project.
-[View Example](https://github.com/ethauvin/pinboard-poster/blob/master/examples/bld/)
+### Gradle
-## Gradle, Maven, etc.
-
-To install and run from Gradle, add the following to the `build.gradle` file:
+To install and run from Gradle, add the following to the build.gradle file:
```gradle
-repositories {
- mavenCentral()
-}
-
dependencies {
- compile 'net.thauvin.erik:pinboard-poster:1.2.0'
+ compile 'net.thauvin.erik:pinboard-poster:1.0.0'
}
```
+[View Example](https://github.com/ethauvin/pinboard-poster/blob/master/samples/java/build.gradle)
+[View Kotlin DSL Example](https://github.com/ethauvin/pinboard-poster/blob/master/samples/koltin/build.gradle.kts)
-[View Examples](https://github.com/ethauvin/pinboard-poster/blob/master/examples/gradle/)
+### Kobalt
-Instructions for using with Maven, Ivy, etc. can be found on [Maven Central](https://central.sonatype.com/artifact/net.thauvin.erik/pinboard-poster).
+To install and run from Kobalt, add the following to the Build.kt file:
+
+```gradle
+dependencies {
+ compile("net.thauvin.erik:pinboard-poster:1.0.0")
+}
+```
+[View Example](https://github.com/ethauvin/pinboard-poster/blob/master/samples/koltin/kobalt/src/Build.kt)
## Adding
The `addPin` function support all of the [Pinboard API parameters](https://pinboard.in/api/#posts_add):
```kotlin
-import java.time.ZonedDateTime
-
-poster.addPin(
- url = "https://www.example.com",
- description = "This is the title",
- extended = "This is the extended description.",
- tags = arrayOf("tag1", "tag2", "tag3"),
- dt = ZonedDateTime.now(),
- replace = true,
- shared = true,
- toRead = false
-)
+poster.addPin(url = "http://www.example.com",
+ description = "This is the title",
+ extended = "This is the extended description.",
+ tags = "tag1 tag2 tag3",
+ dt = "2010-12-11T19:48:02Z",
+ replace = true,
+ shared = true,
+ toRead = false)
```
`url` and `description` are required.
@@ -107,7 +92,7 @@ It returns `true` if the bookmark was added successfully, `false` otherwise.
The `deletePin` function support all of the [Pinboard API parameters](https://pinboard.in/api/#posts_delete):
```kotlin
-poster.deletePin(url = "https://www.example.com/")
+poster.deletePin(url = "http://www.example.com/")
```
It returns `true` if the bookmark was deleted successfully, `false` otherwise.
@@ -117,24 +102,19 @@ It returns `true` if the bookmark was deleted successfully, `false` otherwise.
The library used [`java.util.logging`](https://docs.oracle.com/javase/8/docs/api/java/util/logging/package-summary.html) to log errors. Logging can be configured as follows:
#### Kotlin
-
```kotlin
with(poster.logger) {
addHandler(ConsoleHandler().apply { level = Level.FINE })
level = Level.FINE
- useParentHandlers = false
}
```
-
#### Java
-
```java
final ConsoleHandler consoleHandler = new ConsoleHandler();
consoleHandler.setLevel(Level.FINE);
final Logger logger = poster.getLogger();
logger.addHandler(consoleHandler);
logger.setLevel(Level.FINE);
-logger.setUseParentHandlers(false);
```
or using a logging properties file.
@@ -196,22 +176,4 @@ The API end point is automatically configured to `https://api.pinboard.in/v1/`.
```kotlin
poster.apiEndPoint = "https://www.example.com/v1"
-```
-
-## Contributing
-
-If you want to contribute to this project, all you have to do is clone the GitHub
-repository:
-
-```console
-git clone git@github.com:ethauvin/pinboard-poster.git
-```
-
-Then use [bld](https://rife2.com/bld) to build:
-
-```console
-cd pinboard-poster
-./bld compile
-```
-
-The project has an [IntelliJ IDEA](https://www.jetbrains.com/idea/) project structure. You can just open it after all the dependencies were downloaded and peruse the code.
+```
\ No newline at end of file
diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml
deleted file mode 100644
index ace99d2..0000000
--- a/bitbucket-pipelines.yml
+++ /dev/null
@@ -1,20 +0,0 @@
-image: ubuntu:latest
-
-pipelines:
- default:
- - step:
- name: Test with bld
- script:
- # Install latest Java & Kotlin via SDKMAN!
- - apt-get update -qq && apt-get install -y curl zip
- - curl -s "https://get.sdkman.io" | bash
- - echo sdkman_auto_answer=true > $HOME/.sdkman/etc/config
- - echo sdkman_auto_selfupdate=true >> $HOME/.sdkman/etc/config
- - source "$HOME/.sdkman/bin/sdkman-init.sh"
- - sdk install java
- - sdk install kotlin
- - source "$HOME/.sdkman/bin/sdkman-init.sh"
- # Download, compile and test with bld
- - ./bld download
- - ./bld compile
- - ./bld test
diff --git a/bld b/bld
deleted file mode 100755
index 3c1df97..0000000
--- a/bld
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/usr/bin/env sh
-java -jar "$(dirname "$0")/lib/bld/bld-wrapper.jar" "$0" --build net.thauvin.erik.pinboard.PinboardPosterBuild "$@"
diff --git a/bld.bat b/bld.bat
deleted file mode 100644
index 1262822..0000000
--- a/bld.bat
+++ /dev/null
@@ -1,4 +0,0 @@
-@echo off
-set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
-java -jar "%DIRNAME%/lib/bld/bld-wrapper.jar" "%0" --build net.thauvin.erik.pinboard.PinboardPosterBuild %*
diff --git a/build.gradle.kts b/build.gradle.kts
new file mode 100644
index 0000000..3264b63
--- /dev/null
+++ b/build.gradle.kts
@@ -0,0 +1,224 @@
+import com.jfrog.bintray.gradle.BintrayExtension
+import com.jfrog.bintray.gradle.tasks.BintrayUploadTask
+import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
+import org.gradle.api.publish.maven.MavenPom
+import org.jetbrains.dokka.DokkaConfiguration
+import org.jetbrains.dokka.gradle.DokkaTask
+import org.jetbrains.dokka.gradle.LinkMapping
+import java.io.FileInputStream
+import java.net.URL
+import java.util.Properties
+
+
+plugins {
+ kotlin("jvm") version "1.2.50"
+ `build-scan`
+ java
+ `maven-publish`
+ id("com.github.ben-manes.versions") version "0.20.0"
+ id("com.jfrog.bintray") version "1.8.3"
+ id("org.jetbrains.dokka") version "0.9.17"
+}
+
+group = "net.thauvin.erik"
+version = "1.0.0"
+description = "Pinboard Poster for Kotlin/Java"
+
+val gitHub = "ethauvin/$name"
+val mavenUrl = "https://github.com/$gitHub"
+val deployDir = "deploy"
+var isRelease = "release" in gradle.startParameter.taskNames
+
+// Load local.properties
+File("local.properties").apply {
+ if (exists()) {
+ FileInputStream(this).use { fis ->
+ Properties().apply {
+ load(fis)
+ forEach { (k, v) ->
+ extra[k as String] = v
+ }
+ }
+ }
+ }
+}
+
+repositories {
+ jcenter()
+}
+
+dependencies {
+ compile(kotlin("stdlib"))
+ compile("com.squareup.okhttp3:okhttp:3.10.0")
+ testCompile("org.testng:testng:6.14.3")
+}
+
+tasks {
+ withType(Test::class.java).all {
+ useTestNG()
+ }
+
+ withType {
+ kotlinOptions.jvmTarget = "1.8"
+ }
+
+ val sourcesJar by creating(Jar::class) {
+ classifier = "sources"
+ from(java.sourceSets["main"].allSource)
+ }
+
+ val dokka by getting(DokkaTask::class) {
+ dependsOn(java.sourceSets["main"].classesTaskName)
+ outputFormat = "html"
+ outputDirectory = "$buildDir/javadoc"
+ // See https://github.com/Kotlin/dokka/issues/196
+ externalDocumentationLink(delegateClosureOf {
+ url = URL("https://docs.oracle.com/javase/8/docs/api/")
+ packageListUrl = URL("https://docs.oracle.com/javase/8/docs/api/package-list")
+ })
+ val mapping = LinkMapping().apply {
+ dir = project.rootDir.toPath().resolve("src/main/kotlin").toFile().path
+ url = "https://github.com/ethauvin/pinboard-poster/blob/${project.version}/src/main/kotlin"
+ suffix = "#L"
+ }
+ linkMappings = arrayListOf(mapping)
+
+ includeNonPublic = false
+ }
+
+ val javadocJar by creating(Jar::class) {
+ dependsOn(dokka)
+ from(dokka.outputDirectory)
+ classifier = "javadoc"
+ description = "Assembles a JAR of the generated Javadoc"
+ group = JavaBasePlugin.DOCUMENTATION_GROUP
+ }
+
+ "assemble" {
+ dependsOn(sourcesJar, javadocJar)
+ }
+
+ val copyToDeploy by creating(Copy::class) {
+ from(configurations.runtime)
+ from(tasks["jar"])
+ into(deployDir)
+ }
+
+ "deploy" {
+ description = "Copies all needed files to the $deployDir directory."
+ group = PublishingPlugin.PUBLISH_TASK_GROUP
+ dependsOn("build")
+ outputs.dir(deployDir)
+ inputs.files(copyToDeploy)
+ mustRunAfter("clean")
+ }
+
+ val gitRefreshIndex by creating(Exec::class) {
+ description = "Refreshes the git index."
+ commandLine("git", "update-index", "--refresh").isIgnoreExitValue = true
+ }
+
+ val gitIsDirty by creating(Exec::class) {
+ description = "Fails if git has uncommitted changes."
+ group = "verification"
+ dependsOn(gitRefreshIndex)
+ commandLine("git", "diff-index", "--quiet", "HEAD", "--")
+ }
+
+ val gitTag by creating(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}")
+ }
+ }
+
+
+ val publicationName = "mavenJava"
+ publishing {
+ (publications) {
+ publicationName(MavenPublication::class) {
+ from(components["java"])
+ artifact(sourcesJar)
+ artifact(javadocJar)
+ pom.withXml {
+ asNode().apply {
+ appendNode("name", project.name)
+ appendNode("description", project.description)
+ appendNode("url", mavenUrl)
+
+ appendNode("licenses").appendNode("license").apply {
+ appendNode("name", "BSD 3-Clause")
+ appendNode("url", "https://opensource.org/licenses/BSD-3-Clause")
+ }
+
+ appendNode("developers").appendNode("developer").apply {
+ appendNode("id", "ethauvin")
+ appendNode("name", "Erik C. Thauvin")
+ appendNode("email", "erik@thauvin.net")
+ }
+
+ appendNode("scm").apply {
+ appendNode("connection", "scm:git:$mavenUrl.git")
+ appendNode("developerConnection", "scm:git:git@github.com:$gitHub.git")
+ appendNode("url", mavenUrl)
+ }
+
+ appendNode("issueManagement").apply {
+ appendNode("system", "GitHub")
+ appendNode("url", "$mavenUrl/issues")
+ }
+ }
+ }
+ }
+ }
+ }
+
+ val generatePomFileForMavenJavaPublication by getting(GenerateMavenPom::class) {
+ destination = file("$projectDir/pom.xml")
+ }
+
+ val bintrayUpload by getting(BintrayUploadTask::class) {
+ dependsOn(generatePomFileForMavenJavaPublication, gitTag)
+ }
+
+ fun findProperty(s: String) = project.findProperty(s) as String?
+ bintray {
+ user = findProperty("bintray.user")
+ key = findProperty("bintray.apikey")
+ publish = isRelease
+ setPublications(publicationName)
+ pkg.apply {
+ repo = "maven"
+ name = project.name
+ desc = description
+ websiteUrl = mavenUrl
+ issueTrackerUrl = "$mavenUrl/issues"
+ githubRepo = gitHub
+ githubReleaseNotesFile = "README.md"
+ vcsUrl = "$mavenUrl.git"
+ setLabels("kotlin", "java", "pinboard", "poster", "bookmarks")
+ publicDownloadNumbers = true
+ version.apply {
+ name = project.version as String
+ desc = description
+ vcsTag = project.version as String
+ gpg.apply {
+ sign = true
+ }
+ }
+ }
+ }
+
+ buildScan {
+ setTermsOfServiceUrl("https://gradle.com/terms-of-service")
+ setTermsOfServiceAgree("yes")
+ }
+
+ "release" {
+ description = "Publishes version ${project.version} to Bintray."
+ group = PublishingPlugin.PUBLISH_TASK_GROUP
+ dependsOn(bintrayUpload)
+ }
+}
\ No newline at end of file
diff --git a/config/detekt/baseline.xml b/config/detekt/baseline.xml
deleted file mode 100644
index 3f97ec1..0000000
--- a/config/detekt/baseline.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
- LongParameterList:PinConfig.kt$PinConfig$( var url: String, var description: String, var extended: String = "", var tags: Array<out String> = emptyArray(), var dt: ZonedDateTime = ZonedDateTime.now(), var replace: Boolean = true, var shared: Boolean = true, var toRead: Boolean = false )
- LongParameterList:PinboardPoster.kt$PinboardPoster$( url: String, description: String, extended: String = "", vararg tags: String = emptyArray(), dt: ZonedDateTime = ZonedDateTime.now(), replace: Boolean = true, shared: Boolean = true, toRead: Boolean = false )
- NestedBlockDepth:PinboardPoster.kt$PinboardPoster$private fun executeMethod(method: String, params: Map<String, String>): Boolean
- ThrowsCount:PinboardPoster.kt$PinboardPoster$@Throws(IOException::class) internal fun parseMethodResponse(method: String, response: String)
- TooManyFunctions:PinConfig.kt$PinConfig$Builder
-
-
diff --git a/examples/bld/.gitignore b/examples/bld/.gitignore
deleted file mode 100644
index a2805aa..0000000
--- a/examples/bld/.gitignore
+++ /dev/null
@@ -1,55 +0,0 @@
-.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
deleted file mode 100644
index 26d3352..0000000
--- a/examples/bld/.idea/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-# Default ignored files
-/shelf/
-/workspace.xml
diff --git a/examples/bld/.idea/.name b/examples/bld/.idea/.name
deleted file mode 100644
index 6782949..0000000
--- a/examples/bld/.idea/.name
+++ /dev/null
@@ -1 +0,0 @@
-pinboard-poster-examples-bld
\ No newline at end of file
diff --git a/examples/bld/.idea/app.iml b/examples/bld/.idea/app.iml
deleted file mode 100644
index 2d05353..0000000
--- a/examples/bld/.idea/app.iml
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/examples/bld/.idea/bld.iml b/examples/bld/.idea/bld.iml
deleted file mode 100644
index e63e11e..0000000
--- a/examples/bld/.idea/bld.iml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/examples/bld/.idea/bld.xml b/examples/bld/.idea/bld.xml
deleted file mode 100644
index 6600cee..0000000
--- a/examples/bld/.idea/bld.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/examples/bld/.idea/inspectionProfiles/Project_Default.xml b/examples/bld/.idea/inspectionProfiles/Project_Default.xml
deleted file mode 100644
index 1e01b48..0000000
--- a/examples/bld/.idea/inspectionProfiles/Project_Default.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/examples/bld/.idea/libraries/bld.xml b/examples/bld/.idea/libraries/bld.xml
deleted file mode 100644
index 153a060..0000000
--- a/examples/bld/.idea/libraries/bld.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/examples/bld/.idea/libraries/compile.xml b/examples/bld/.idea/libraries/compile.xml
deleted file mode 100644
index 99cc0c0..0000000
--- a/examples/bld/.idea/libraries/compile.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/examples/bld/.idea/libraries/runtime.xml b/examples/bld/.idea/libraries/runtime.xml
deleted file mode 100644
index d4069f2..0000000
--- a/examples/bld/.idea/libraries/runtime.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/examples/bld/.idea/libraries/test.xml b/examples/bld/.idea/libraries/test.xml
deleted file mode 100644
index 57ed5ef..0000000
--- a/examples/bld/.idea/libraries/test.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/examples/bld/.idea/misc.xml b/examples/bld/.idea/misc.xml
deleted file mode 100644
index f522a9e..0000000
--- a/examples/bld/.idea/misc.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/examples/bld/.idea/modules.xml b/examples/bld/.idea/modules.xml
deleted file mode 100644
index 55adcb9..0000000
--- a/examples/bld/.idea/modules.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/examples/bld/.idea/runConfigurations/Run Tests.xml b/examples/bld/.idea/runConfigurations/Run Tests.xml
deleted file mode 100644
index e5f873f..0000000
--- a/examples/bld/.idea/runConfigurations/Run Tests.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/examples/bld/.idea/vcs.xml b/examples/bld/.idea/vcs.xml
deleted file mode 100644
index b2bdec2..0000000
--- a/examples/bld/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/examples/bld/.vscode/launch.json b/examples/bld/.vscode/launch.json
deleted file mode 100644
index b183bbe..0000000
--- a/examples/bld/.vscode/launch.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "version": "0.2.0",
- "configurations": [
- {
- "type": "java",
- "name": "Run Tests",
- "request": "launch",
- "mainClass": "net.thauvin.erik.pinboard.samples.JavaExampleTest"
- }
- ]
-}
diff --git a/examples/bld/.vscode/settings.json b/examples/bld/.vscode/settings.json
deleted file mode 100644
index ba429d0..0000000
--- a/examples/bld/.vscode/settings.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "java.project.sourcePaths": [
- "src/main/java",
- "src/main/resources",
- "src/test/java",
- "src/test/resources",
- "src/bld/java",
- "src/bld/resources"
- ],
- "java.configuration.updateBuildConfiguration": "automatic",
- "java.project.referencedLibraries": [
- "${HOME}/.bld/dist/bld-2.2.1.jar",
- "lib/**/*.jar"
- ]
-}
diff --git a/examples/bld/README.md b/examples/bld/README.md
deleted file mode 100644
index ad5401c..0000000
--- a/examples/bld/README.md
+++ /dev/null
@@ -1,18 +0,0 @@
-## Kotlin Example
-To compile & run the Kotlin example:
-
-```console
-./bld compile
-
-./bld run
-```
-
-## Java Example
-
-To compile & run the Java example:
-
-```console
-./bld compile
-
-./bld run-java
-```
diff --git a/examples/bld/bld b/examples/bld/bld
deleted file mode 100755
index 1a39c97..0000000
--- a/examples/bld/bld
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/usr/bin/env sh
-java -jar "$(dirname "$0")/lib/bld/bld-wrapper.jar" "$0" --build net.thauvin.erik.pinboard.samples.ExampleBuild "$@"
diff --git a/examples/bld/bld.bat b/examples/bld/bld.bat
deleted file mode 100644
index 6357553..0000000
--- a/examples/bld/bld.bat
+++ /dev/null
@@ -1,4 +0,0 @@
-@echo off
-set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
-java -jar "%DIRNAME%/lib/bld/bld-wrapper.jar" "%0" --build net.thauvin.erik.pinboard.samples.ExampleBuild %*
diff --git a/examples/bld/lib/bld/bld-wrapper.jar b/examples/bld/lib/bld/bld-wrapper.jar
deleted file mode 100644
index 968a8ab..0000000
Binary files a/examples/bld/lib/bld/bld-wrapper.jar and /dev/null differ
diff --git a/examples/bld/lib/bld/bld-wrapper.properties b/examples/bld/lib/bld/bld-wrapper.properties
deleted file mode 100644
index 1f1009d..0000000
--- a/examples/bld/lib/bld/bld-wrapper.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-bld.downloadExtensionJavadoc=false
-bld.downloadExtensionSources=true
-bld.downloadLocation=
-bld.extension-kotlin=com.uwyn.rife2:bld-kotlin:1.1.0-SNAPSHOT
-bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
-bld.sourceDirectories=
-bld.version=2.2.1
diff --git a/examples/bld/src/bld/java/net/thauvin/erik/pinboard/samples/ExampleBuild.java b/examples/bld/src/bld/java/net/thauvin/erik/pinboard/samples/ExampleBuild.java
deleted file mode 100644
index 6fc8142..0000000
--- a/examples/bld/src/bld/java/net/thauvin/erik/pinboard/samples/ExampleBuild.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package net.thauvin.erik.pinboard.samples;
-
-import rife.bld.BaseProject;
-import rife.bld.BuildCommand;
-import rife.bld.extension.CompileKotlinOperation;
-import rife.bld.extension.kotlin.CompileOptions;
-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 = "net.thauvin.erik.pinboard.samples";
- name = "Example";
- version = version(0, 1, 0);
-
- mainClass = pkg + ".KotlinExampleKt";
-
- javaRelease = 11;
- downloadSources = true;
- autoDownloadPurge = true;
-
- repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL, SONATYPE_SNAPSHOTS_LEGACY);
-
- scope(compile)
- .include(dependency("net.thauvin.erik", "pinboard-poster", version(1, 2, 1, "SNAPSHOT")));
- }
-
- public static void main(String[] args) {
- new ExampleBuild().start(args);
- }
-
- @Override
- public void compile() throws Exception {
- new CompileKotlinOperation()
- .fromProject(this)
- .compileOptions(new CompileOptions().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(pkg + ".JavaExample")
- .execute();
- }
-}
diff --git a/examples/bld/src/main/java/net/thauvin/erik/pinboard/samples/JavaExample.java b/examples/bld/src/main/java/net/thauvin/erik/pinboard/samples/JavaExample.java
deleted file mode 100644
index 1ef224b..0000000
--- a/examples/bld/src/main/java/net/thauvin/erik/pinboard/samples/JavaExample.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package net.thauvin.erik.pinboard.samples;
-
-import net.thauvin.erik.pinboard.PinConfig;
-import net.thauvin.erik.pinboard.PinboardPoster;
-
-import java.nio.file.Paths;
-import java.util.logging.ConsoleHandler;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-public class JavaExample {
- public static void main(String[] args) {
- final String url = "https://example.com/pinboard";
- final PinboardPoster poster;
-
- if (args.length == 1) {
- // API Token is an argument
- poster = new PinboardPoster(args[0]);
- } else {
- // API Token is in local.properties or PINBOARD_API_TOKEN environment variable
- poster = new PinboardPoster(Paths.get("local.properties"));
- }
-
- // Set logging levels
- final ConsoleHandler consoleHandler = new ConsoleHandler();
- consoleHandler.setLevel(Level.FINE);
- final Logger logger = poster.getLogger();
- logger.addHandler(consoleHandler);
- logger.setLevel(Level.FINE);
- logger.setUseParentHandlers(false);
-
- if (poster.validate()) {
- // Add Pin
- if (poster.addPin(new PinConfig.Builder(url, "Testing")
- .extended("Extra")
- .tags("test", "java")
- .build())) {
- System.out.println("Added: " + url);
- }
-
- // Delete Pin
- if (poster.deletePin(url)) {
- System.out.println("Deleted: " + url);
- }
- }
- }
-}
diff --git a/examples/bld/src/main/kotlin/net/thauvin/erik/pinboard/samples/KotlinExample.kt b/examples/bld/src/main/kotlin/net/thauvin/erik/pinboard/samples/KotlinExample.kt
deleted file mode 100644
index 1b48e82..0000000
--- a/examples/bld/src/main/kotlin/net/thauvin/erik/pinboard/samples/KotlinExample.kt
+++ /dev/null
@@ -1,37 +0,0 @@
-package net.thauvin.erik.pinboard.samples
-
-import net.thauvin.erik.pinboard.PinboardPoster
-import java.nio.file.Paths
-import java.util.logging.ConsoleHandler
-import java.util.logging.Level
-
-fun main(args: Array) {
- val url = "https://example.com/pinboard"
-
- val poster = if (args.size == 1) {
- // API Token is an argument
- PinboardPoster(args[0])
- } else {
- // API Token is in local.properties or PINBOARD_API_TOKEN environment variable
- PinboardPoster(Paths.get("local.properties"))
- }
-
- // Set logging levels
- with(poster.logger) {
- addHandler(ConsoleHandler().apply { level = Level.FINE })
- level = Level.FINE
- useParentHandlers = false
- }
-
- if (poster.validate()) {
- // Add Pin
- if (poster.addPin(url, "Testing", "Extended test", tags = arrayOf("test", "kotlin"))) {
- println("Added: $url")
- }
-
- // Delete Pin
- if (poster.deletePin(url)) {
- println("Deleted: $url")
- }
- }
-}
diff --git a/examples/gradle/java/.editorconfig b/examples/gradle/java/.editorconfig
deleted file mode 100644
index a6971e1..0000000
--- a/examples/gradle/java/.editorconfig
+++ /dev/null
@@ -1,2 +0,0 @@
-[*]
-insert_final_newline=true
diff --git a/examples/gradle/java/.idea/.gitignore b/examples/gradle/java/.idea/.gitignore
deleted file mode 100644
index 26d3352..0000000
--- a/examples/gradle/java/.idea/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-# Default ignored files
-/shelf/
-/workspace.xml
diff --git a/examples/gradle/java/.idea/.name b/examples/gradle/java/.idea/.name
deleted file mode 100644
index 4f5dba1..0000000
--- a/examples/gradle/java/.idea/.name
+++ /dev/null
@@ -1 +0,0 @@
-pinboard-poster-examples-gradle-java
\ No newline at end of file
diff --git a/examples/gradle/java/.idea/compiler.xml b/examples/gradle/java/.idea/compiler.xml
deleted file mode 100644
index fb7f4a8..0000000
--- a/examples/gradle/java/.idea/compiler.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/examples/gradle/java/.idea/inspectionProfiles/Project_Default.xml b/examples/gradle/java/.idea/inspectionProfiles/Project_Default.xml
deleted file mode 100644
index 1e01b48..0000000
--- a/examples/gradle/java/.idea/inspectionProfiles/Project_Default.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/examples/gradle/java/.idea/jarRepositories.xml b/examples/gradle/java/.idea/jarRepositories.xml
deleted file mode 100644
index a529ef2..0000000
--- a/examples/gradle/java/.idea/jarRepositories.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/examples/gradle/java/.idea/misc.xml b/examples/gradle/java/.idea/misc.xml
deleted file mode 100644
index 7adacb2..0000000
--- a/examples/gradle/java/.idea/misc.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/examples/gradle/java/.idea/vcs.xml b/examples/gradle/java/.idea/vcs.xml
deleted file mode 100644
index c2365ab..0000000
--- a/examples/gradle/java/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/examples/gradle/java/README.md b/examples/gradle/java/README.md
deleted file mode 100644
index caf0563..0000000
--- a/examples/gradle/java/README.md
+++ /dev/null
@@ -1,5 +0,0 @@
-## Run the Example
-
-```console
-./gradlew run
-```
diff --git a/examples/gradle/java/build.gradle b/examples/gradle/java/build.gradle
deleted file mode 100644
index e0eceee..0000000
--- a/examples/gradle/java/build.gradle
+++ /dev/null
@@ -1,26 +0,0 @@
-plugins {
- id 'com.github.ben-manes.versions' version '0.51.0'
- id 'java'
- id 'application'
-}
-
-defaultTasks 'run'
-
-application {
- mainClass = 'net.thauvin.erik.pinboard.samples.JavaExample'
-}
-
-java {
- sourceCompatibility = JavaVersion.VERSION_11
- targetCompatibility = JavaVersion.VERSION_11
-}
-
-repositories {
- mavenLocal()
- mavenCentral()
- maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots") }
-}
-
-dependencies {
- implementation 'net.thauvin.erik:pinboard-poster:1.2.1-SNAPSHOT'
-}
diff --git a/examples/gradle/java/gradle/wrapper/gradle-wrapper.jar b/examples/gradle/java/gradle/wrapper/gradle-wrapper.jar
deleted file mode 100644
index 1b33c55..0000000
Binary files a/examples/gradle/java/gradle/wrapper/gradle-wrapper.jar and /dev/null differ
diff --git a/examples/gradle/java/gradlew b/examples/gradle/java/gradlew
deleted file mode 100755
index 23d15a9..0000000
--- a/examples/gradle/java/gradlew
+++ /dev/null
@@ -1,251 +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.
-#
-# SPDX-License-Identifier: Apache-2.0
-#
-
-##############################################################################
-#
-# 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/platforms/jvm/plugins-application/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 -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || 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="\\\"\\\""
-
-
-# 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=SC2039,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=SC2039,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 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" \
- -classpath "$CLASSPATH" \
- -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
- "$@"
-
-# 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/examples/gradle/java/gradlew.bat b/examples/gradle/java/gradlew.bat
deleted file mode 100644
index db3a6ac..0000000
--- a/examples/gradle/java/gradlew.bat
+++ /dev/null
@@ -1,94 +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
-@rem SPDX-License-Identifier: Apache-2.0
-@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. 1>&2
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
-echo. 1>&2
-echo Please set the JAVA_HOME variable in your environment to match the 1>&2
-echo location of your Java installation. 1>&2
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto execute
-
-echo. 1>&2
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
-echo. 1>&2
-echo Please set the JAVA_HOME variable in your environment to match the 1>&2
-echo location of your Java installation. 1>&2
-
-goto fail
-
-:execute
-@rem Setup the command line
-
-set CLASSPATH=
-
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
-
-: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/examples/gradle/java/src/main/java/net/thauvin/erik/pinboard/samples/JavaExample.java b/examples/gradle/java/src/main/java/net/thauvin/erik/pinboard/samples/JavaExample.java
deleted file mode 100644
index 1ef224b..0000000
--- a/examples/gradle/java/src/main/java/net/thauvin/erik/pinboard/samples/JavaExample.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package net.thauvin.erik.pinboard.samples;
-
-import net.thauvin.erik.pinboard.PinConfig;
-import net.thauvin.erik.pinboard.PinboardPoster;
-
-import java.nio.file.Paths;
-import java.util.logging.ConsoleHandler;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-public class JavaExample {
- public static void main(String[] args) {
- final String url = "https://example.com/pinboard";
- final PinboardPoster poster;
-
- if (args.length == 1) {
- // API Token is an argument
- poster = new PinboardPoster(args[0]);
- } else {
- // API Token is in local.properties or PINBOARD_API_TOKEN environment variable
- poster = new PinboardPoster(Paths.get("local.properties"));
- }
-
- // Set logging levels
- final ConsoleHandler consoleHandler = new ConsoleHandler();
- consoleHandler.setLevel(Level.FINE);
- final Logger logger = poster.getLogger();
- logger.addHandler(consoleHandler);
- logger.setLevel(Level.FINE);
- logger.setUseParentHandlers(false);
-
- if (poster.validate()) {
- // Add Pin
- if (poster.addPin(new PinConfig.Builder(url, "Testing")
- .extended("Extra")
- .tags("test", "java")
- .build())) {
- System.out.println("Added: " + url);
- }
-
- // Delete Pin
- if (poster.deletePin(url)) {
- System.out.println("Deleted: " + url);
- }
- }
- }
-}
diff --git a/examples/gradle/kotlin/.editorconfig b/examples/gradle/kotlin/.editorconfig
deleted file mode 100644
index a6971e1..0000000
--- a/examples/gradle/kotlin/.editorconfig
+++ /dev/null
@@ -1,2 +0,0 @@
-[*]
-insert_final_newline=true
diff --git a/examples/gradle/kotlin/.idea/.gitignore b/examples/gradle/kotlin/.idea/.gitignore
deleted file mode 100644
index 26d3352..0000000
--- a/examples/gradle/kotlin/.idea/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-# Default ignored files
-/shelf/
-/workspace.xml
diff --git a/examples/gradle/kotlin/.idea/.name b/examples/gradle/kotlin/.idea/.name
deleted file mode 100644
index 7379aed..0000000
--- a/examples/gradle/kotlin/.idea/.name
+++ /dev/null
@@ -1 +0,0 @@
-pinboard-post-examples-gradle-kotlin
\ No newline at end of file
diff --git a/examples/gradle/kotlin/.idea/compiler.xml b/examples/gradle/kotlin/.idea/compiler.xml
deleted file mode 100644
index fb7f4a8..0000000
--- a/examples/gradle/kotlin/.idea/compiler.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/examples/gradle/kotlin/.idea/inspectionProfiles/Project_Default.xml b/examples/gradle/kotlin/.idea/inspectionProfiles/Project_Default.xml
deleted file mode 100644
index 1e01b48..0000000
--- a/examples/gradle/kotlin/.idea/inspectionProfiles/Project_Default.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/examples/gradle/kotlin/.idea/jarRepositories.xml b/examples/gradle/kotlin/.idea/jarRepositories.xml
deleted file mode 100644
index a529ef2..0000000
--- a/examples/gradle/kotlin/.idea/jarRepositories.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/examples/gradle/kotlin/.idea/kotlinc.xml b/examples/gradle/kotlin/.idea/kotlinc.xml
deleted file mode 100644
index 6d0ee1c..0000000
--- a/examples/gradle/kotlin/.idea/kotlinc.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/examples/gradle/kotlin/.idea/misc.xml b/examples/gradle/kotlin/.idea/misc.xml
deleted file mode 100644
index 034d4d4..0000000
--- a/examples/gradle/kotlin/.idea/misc.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/examples/gradle/kotlin/.idea/modules.xml b/examples/gradle/kotlin/.idea/modules.xml
deleted file mode 100644
index a168080..0000000
--- a/examples/gradle/kotlin/.idea/modules.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/examples/gradle/kotlin/.idea/vcs.xml b/examples/gradle/kotlin/.idea/vcs.xml
deleted file mode 100644
index c2365ab..0000000
--- a/examples/gradle/kotlin/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/examples/gradle/kotlin/README.md b/examples/gradle/kotlin/README.md
deleted file mode 100644
index caf0563..0000000
--- a/examples/gradle/kotlin/README.md
+++ /dev/null
@@ -1,5 +0,0 @@
-## Run the Example
-
-```console
-./gradlew run
-```
diff --git a/examples/gradle/kotlin/build.gradle.kts b/examples/gradle/kotlin/build.gradle.kts
deleted file mode 100644
index f41881f..0000000
--- a/examples/gradle/kotlin/build.gradle.kts
+++ /dev/null
@@ -1,32 +0,0 @@
-import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
-
-plugins {
- id("application")
- id("com.github.ben-manes.versions") version "0.51.0"
- kotlin("jvm") version "2.1.20"
-}
-
-defaultTasks(ApplicationPlugin.TASK_RUN_NAME)
-
-repositories {
- mavenLocal()
- mavenCentral()
- maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots") }
-}
-
-dependencies {
- implementation("net.thauvin.erik:pinboard-poster:1.2.1-SNAPSHOT")
-}
-
-java {
- sourceCompatibility = JavaVersion.VERSION_11
- targetCompatibility = JavaVersion.VERSION_11
-}
-
-application {
- mainClass.set("net.thauvin.erik.pinboard.samples.KotlinExampleKt")
-}
-
-kotlin {
- compilerOptions.jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11)
-}
diff --git a/examples/gradle/kotlin/gradle/wrapper/gradle-wrapper.jar b/examples/gradle/kotlin/gradle/wrapper/gradle-wrapper.jar
deleted file mode 100644
index 1b33c55..0000000
Binary files a/examples/gradle/kotlin/gradle/wrapper/gradle-wrapper.jar and /dev/null differ
diff --git a/examples/gradle/kotlin/gradlew b/examples/gradle/kotlin/gradlew
deleted file mode 100755
index 23d15a9..0000000
--- a/examples/gradle/kotlin/gradlew
+++ /dev/null
@@ -1,251 +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.
-#
-# SPDX-License-Identifier: Apache-2.0
-#
-
-##############################################################################
-#
-# 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/platforms/jvm/plugins-application/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 -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || 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="\\\"\\\""
-
-
-# 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=SC2039,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=SC2039,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 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" \
- -classpath "$CLASSPATH" \
- -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
- "$@"
-
-# 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/examples/gradle/kotlin/gradlew.bat b/examples/gradle/kotlin/gradlew.bat
deleted file mode 100644
index db3a6ac..0000000
--- a/examples/gradle/kotlin/gradlew.bat
+++ /dev/null
@@ -1,94 +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
-@rem SPDX-License-Identifier: Apache-2.0
-@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. 1>&2
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
-echo. 1>&2
-echo Please set the JAVA_HOME variable in your environment to match the 1>&2
-echo location of your Java installation. 1>&2
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto execute
-
-echo. 1>&2
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
-echo. 1>&2
-echo Please set the JAVA_HOME variable in your environment to match the 1>&2
-echo location of your Java installation. 1>&2
-
-goto fail
-
-:execute
-@rem Setup the command line
-
-set CLASSPATH=
-
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
-
-: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/examples/gradle/kotlin/settings.gradle.kts b/examples/gradle/kotlin/settings.gradle.kts
deleted file mode 100644
index 5d8ff15..0000000
--- a/examples/gradle/kotlin/settings.gradle.kts
+++ /dev/null
@@ -1 +0,0 @@
-rootProject.name = "pinboard-post-examples-gradle-kotlin"
diff --git a/examples/gradle/kotlin/src/main/kotlin/net/thauvin/erik/pinboard/samples/KotlinExample.kt b/examples/gradle/kotlin/src/main/kotlin/net/thauvin/erik/pinboard/samples/KotlinExample.kt
deleted file mode 100644
index 1b48e82..0000000
--- a/examples/gradle/kotlin/src/main/kotlin/net/thauvin/erik/pinboard/samples/KotlinExample.kt
+++ /dev/null
@@ -1,37 +0,0 @@
-package net.thauvin.erik.pinboard.samples
-
-import net.thauvin.erik.pinboard.PinboardPoster
-import java.nio.file.Paths
-import java.util.logging.ConsoleHandler
-import java.util.logging.Level
-
-fun main(args: Array) {
- val url = "https://example.com/pinboard"
-
- val poster = if (args.size == 1) {
- // API Token is an argument
- PinboardPoster(args[0])
- } else {
- // API Token is in local.properties or PINBOARD_API_TOKEN environment variable
- PinboardPoster(Paths.get("local.properties"))
- }
-
- // Set logging levels
- with(poster.logger) {
- addHandler(ConsoleHandler().apply { level = Level.FINE })
- level = Level.FINE
- useParentHandlers = false
- }
-
- if (poster.validate()) {
- // Add Pin
- if (poster.addPin(url, "Testing", "Extended test", tags = arrayOf("test", "kotlin"))) {
- println("Added: $url")
- }
-
- // Delete Pin
- if (poster.deletePin(url)) {
- println("Deleted: $url")
- }
- }
-}
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..1948b90
Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/examples/gradle/java/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
similarity index 74%
rename from examples/gradle/java/gradle/wrapper/gradle-wrapper.properties
rename to gradle/wrapper/gradle-wrapper.properties
index ca025c8..d2c45a4 100644
--- a/examples/gradle/java/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,7 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
-networkTimeout=10000
-validateDistributionUrl=true
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.8-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/gradlew b/gradlew
new file mode 100755
index 0000000..cccdd3d
--- /dev/null
+++ b/gradlew
@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# 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
+ ;;
+ 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"
+ which java >/dev/null 2>&1 || 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
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/gradlew.bat b/gradlew.bat
new file mode 100644
index 0000000..f955316
--- /dev/null
+++ b/gradlew.bat
@@ -0,0 +1,84 @@
+@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=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@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=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+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 init
+
+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
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+: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 %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="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!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/kobalt/Build.kt.iml b/kobalt/Build.kt.iml
new file mode 100644
index 0000000..19209c6
--- /dev/null
+++ b/kobalt/Build.kt.iml
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/kobalt/src/Build.kt b/kobalt/src/Build.kt
new file mode 100644
index 0000000..65e5ca1
--- /dev/null
+++ b/kobalt/src/Build.kt
@@ -0,0 +1,99 @@
+import com.beust.kobalt.buildScript
+import com.beust.kobalt.glob
+import com.beust.kobalt.plugin.application.application
+import com.beust.kobalt.plugin.java.javaCompiler
+import com.beust.kobalt.plugin.kotlin.kotlinCompiler
+import com.beust.kobalt.plugin.packaging.assemble
+import com.beust.kobalt.plugin.packaging.install
+import com.beust.kobalt.plugin.publish.autoGitTag
+import com.beust.kobalt.plugin.publish.bintray
+import com.beust.kobalt.project
+import net.thauvin.erik.kobalt.plugin.pom2xml.pom2xml
+import org.apache.maven.model.Developer
+import org.apache.maven.model.License
+import org.apache.maven.model.Model
+import org.apache.maven.model.Scm
+
+val bs = buildScript {
+ plugins("net.thauvin.erik:kobalt-pom2xml:", "net.thauvin.erik:kobalt-maven-local:")
+}
+
+val p = project {
+ name = "pinboard-poster"
+ group = "net.thauvin.erik"
+ description = "Pinboard Poster for Kotlin/Java"
+ artifactId = name
+ version = "1.0.0"
+
+ pom = Model().apply {
+ description = project.description
+ url = "https://github.com/ethauvin/pinboard-poster"
+ licenses = listOf(License().apply {
+ name = "BSD 3-Clause"
+ url = "https://opensource.org/licenses/BSD-3-Clause"
+ })
+ scm = Scm().apply {
+ url = "https://github.com/ethauvin/pinboard-poster"
+ connection = "https://github.com/ethauvin/pinboard-poster.git"
+ developerConnection = "git@github.com:ethauvin/pinboard-poster.git"
+ }
+ developers = listOf(Developer().apply {
+ id = "ethauvin"
+ name = "Erik C. Thauvin"
+ email = "erik@thauvin.net"
+ })
+ }
+
+ dependencies {
+ compile("org.jetbrains.kotlin:kotlin-stdlib:1.2.50")
+ compile("com.squareup.okhttp3:okhttp:3.10.0")
+ }
+
+ dependenciesTest {
+ compile("org.testng:testng:6.14.3")
+ }
+
+ assemble {
+ jar { }
+ mavenJars { }
+ }
+
+ javaCompiler {
+ //args("-source", "1.8", "-target", "1.8")
+ }
+
+ kotlinCompiler {
+ //args("-source", "1.8")
+ }
+
+ application {
+ mainClass = "net.thauvin.erik.pinboard.PinboardPosterKt"
+ ignoreErrorStream = true
+ }
+
+ install {
+ target = "deploy"
+ include(from("kobaltBuild/libs"), to(target), glob("**/*"))
+ collect(compileDependencies).forEach {
+ copy(from(it.file.absolutePath), to(target))
+ }
+ }
+
+ autoGitTag {
+ enabled = true
+ push = false
+ message = "Version $version"
+ }
+
+ bintray {
+ publish = true
+ description = "Release version $version"
+ issueTrackerUrl = "https://github.com/ethauvin/pinboard-poster/issues"
+ vcsTag = version
+ sign = true
+ }
+
+ pom2xml {
+
+ }
+}
\ No newline at end of file
diff --git a/kobalt/wrapper/kobalt-wrapper.jar b/kobalt/wrapper/kobalt-wrapper.jar
new file mode 100644
index 0000000..6c6b435
Binary files /dev/null and b/kobalt/wrapper/kobalt-wrapper.jar differ
diff --git a/kobalt/wrapper/kobalt-wrapper.properties b/kobalt/wrapper/kobalt-wrapper.properties
new file mode 100644
index 0000000..d630dff
--- /dev/null
+++ b/kobalt/wrapper/kobalt-wrapper.properties
@@ -0,0 +1 @@
+kobalt.version=1.0.114
\ No newline at end of file
diff --git a/kobaltw b/kobaltw
new file mode 100755
index 0000000..c5186d5
--- /dev/null
+++ b/kobaltw
@@ -0,0 +1,2 @@
+#!/usr/bin/env sh
+java -jar "`dirname "$0"`/kobalt/wrapper/kobalt-wrapper.jar" $*
diff --git a/kobaltw.bat b/kobaltw.bat
new file mode 100644
index 0000000..d578071
--- /dev/null
+++ b/kobaltw.bat
@@ -0,0 +1,4 @@
+@echo off
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+java -jar "%DIRNAME%/kobalt/wrapper/kobalt-wrapper.jar" %*
diff --git a/lib/bld/bld-wrapper.jar b/lib/bld/bld-wrapper.jar
deleted file mode 100644
index 7add961..0000000
Binary files a/lib/bld/bld-wrapper.jar and /dev/null differ
diff --git a/lib/bld/bld-wrapper.properties b/lib/bld/bld-wrapper.properties
deleted file mode 100644
index 751133d..0000000
--- a/lib/bld/bld-wrapper.properties
+++ /dev/null
@@ -1,10 +0,0 @@
-bld.downloadExtensionJavadoc=false
-bld.downloadExtensionSources=true
-bld.downloadLocation=
-bld.extension-detekt=com.uwyn.rife2:bld-detekt:0.9.10-SNAPSHOT
-bld.extension-dokka=com.uwyn.rife2:bld-dokka:1.0.4-SNAPSHOT
-bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.10
-bld.extension-kotlin=com.uwyn.rife2:bld-kotlin:1.1.0-SNAPSHOT
-bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
-bld.sourceDirectories=
-bld.version=2.2.1
diff --git a/pinboard-poster.iml b/pinboard-poster.iml
new file mode 100644
index 0000000..71cca04
--- /dev/null
+++ b/pinboard-poster.iml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 64767c7..25b7bdb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,12 +1,25 @@
-
+
4.0.0
net.thauvin.erik
pinboard-poster
- 1.2.1-SNAPSHOT
+ 1.0.0
+
+
+ org.jetbrains.kotlin
+ kotlin-stdlib
+ 1.2.50
+ compile
+
+
+ com.squareup.okhttp3
+ okhttp
+ 3.10.0
+ compile
+
+
pinboard-poster
- A small library for posting to Pinboard
+ Pinboard Poster for Kotlin/Java
https://github.com/ethauvin/pinboard-poster
@@ -14,44 +27,11 @@
https://opensource.org/licenses/BSD-3-Clause
-
-
- org.jetbrains.kotlin
- kotlin-stdlib
- 2.1.20
- compile
-
-
- org.jetbrains.kotlin
- kotlin-stdlib-common
- 2.1.20
- compile
-
-
- org.jetbrains.kotlin
- kotlin-stdlib-jdk8
- 2.1.20
- compile
-
-
- com.squareup.okhttp3
- okhttp
- 4.12.0
- compile
-
-
- com.squareup.okhttp3
- logging-interceptor
- 4.12.0
- compile
-
-
ethauvin
Erik C. Thauvin
erik@thauvin.net
- https://erik.thauvin.net/
@@ -59,4 +39,8 @@
scm:git:git@github.com:ethauvin/pinboard-poster.git
https://github.com/ethauvin/pinboard-poster
+
+ GitHub
+ https://github.com/ethauvin/pinboard-poster/issues
+
diff --git a/examples/gradle/java/.gitignore b/samples/java/.gitignore
similarity index 100%
rename from examples/gradle/java/.gitignore
rename to samples/java/.gitignore
diff --git a/samples/java/build.gradle b/samples/java/build.gradle
new file mode 100644
index 0000000..7b08bba
--- /dev/null
+++ b/samples/java/build.gradle
@@ -0,0 +1,17 @@
+plugins {
+ id 'java'
+ id 'application'
+}
+
+defaultTasks 'run'
+
+mainClassName = 'net.thauvin.erik.pinboard.samples.JavaExample'
+
+dependencies {
+ compile 'net.thauvin.erik:pinboard-poster:1.0.0'
+}
+
+repositories {
+ mavenLocal()
+ jcenter()
+}
\ No newline at end of file
diff --git a/samples/java/gradle/wrapper/gradle-wrapper.jar b/samples/java/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..1948b90
Binary files /dev/null and b/samples/java/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/examples/gradle/kotlin/gradle/wrapper/gradle-wrapper.properties b/samples/java/gradle/wrapper/gradle-wrapper.properties
similarity index 74%
rename from examples/gradle/kotlin/gradle/wrapper/gradle-wrapper.properties
rename to samples/java/gradle/wrapper/gradle-wrapper.properties
index ca025c8..b61bef3 100644
--- a/examples/gradle/kotlin/gradle/wrapper/gradle-wrapper.properties
+++ b/samples/java/gradle/wrapper/gradle-wrapper.properties
@@ -1,7 +1,6 @@
+#Tue Jun 19 20:03:12 PDT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
-networkTimeout=10000
-validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.8-all.zip
diff --git a/samples/java/gradlew b/samples/java/gradlew
new file mode 100755
index 0000000..cccdd3d
--- /dev/null
+++ b/samples/java/gradlew
@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# 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
+ ;;
+ 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"
+ which java >/dev/null 2>&1 || 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
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/samples/java/gradlew.bat b/samples/java/gradlew.bat
new file mode 100644
index 0000000..f955316
--- /dev/null
+++ b/samples/java/gradlew.bat
@@ -0,0 +1,84 @@
+@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=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@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=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+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 init
+
+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
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+: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 %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="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!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/examples/gradle/java/settings.gradle b/samples/java/settings.gradle
similarity index 84%
rename from examples/gradle/java/settings.gradle
rename to samples/java/settings.gradle
index 87b714a..e7ecd5d 100644
--- a/examples/gradle/java/settings.gradle
+++ b/samples/java/settings.gradle
@@ -7,4 +7,4 @@
* in the user guide at https://docs.gradle.org/4.8/userguide/multi_project_builds.html
*/
-rootProject.name = 'pinboard-poster-examples-gradle-java'
+rootProject.name = 'samples-java'
diff --git a/samples/java/src/main/java/net/thauvin/erik/pinboard/samples/JavaExample.java b/samples/java/src/main/java/net/thauvin/erik/pinboard/samples/JavaExample.java
new file mode 100644
index 0000000..8cde903
--- /dev/null
+++ b/samples/java/src/main/java/net/thauvin/erik/pinboard/samples/JavaExample.java
@@ -0,0 +1,71 @@
+/*
+ * JavaExample.java
+ *
+ * Copyright (c) 2017-2018, Erik C. Thauvin (erik@thauvin.net)
+ * All rights reserved.
+ *
+ * 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.pinboard.samples;
+
+import net.thauvin.erik.pinboard.PinboardPoster;
+
+import java.nio.file.Paths;
+import java.util.logging.ConsoleHandler;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+public class JavaExample {
+ public static void main(String[] args) {
+ final String url = "http://www.example.com/pinboard";
+ final PinboardPoster poster;
+
+ if (args.length == 1) {
+ // API Token is an argument
+ poster = new PinboardPoster(args[0]);
+ } else {
+ // API Token is in local.properties or PINBOARD_API_TOKEN environment variable
+ poster = new PinboardPoster(Paths.get("local.properties"));
+ }
+
+ // Set logging levels
+ final ConsoleHandler consoleHandler = new ConsoleHandler();
+ consoleHandler.setLevel(Level.FINE);
+ final Logger logger = poster.getLogger();
+ logger.addHandler(consoleHandler);
+ logger.setLevel(Level.FINE);
+
+ // Add Pin
+ if (poster.addPin(url, "Testing", "Extended test", "test java")) {
+ System.out.println("Added: " + url);
+ }
+
+ // Delete Pin
+ if (poster.deletePin(url)) {
+ System.out.println("Deleted: " + url);
+ }
+ }
+}
\ No newline at end of file
diff --git a/examples/gradle/kotlin/.gitignore b/samples/koltin/.gitignore
similarity index 100%
rename from examples/gradle/kotlin/.gitignore
rename to samples/koltin/.gitignore
diff --git a/samples/koltin/build.gradle.kts b/samples/koltin/build.gradle.kts
new file mode 100644
index 0000000..cbbf0ef
--- /dev/null
+++ b/samples/koltin/build.gradle.kts
@@ -0,0 +1,19 @@
+plugins {
+ application
+ kotlin("jvm") version "1.2.50"
+}
+
+defaultTasks(ApplicationPlugin.TASK_RUN_NAME)
+
+dependencies {
+ compile("net.thauvin.erik:pinboard-poster:1.0.0")
+}
+
+application {
+ mainClassName = "net.thauvin.erik.pinboard.samples.KotlinExampleKt"
+}
+
+repositories {
+ mavenLocal()
+ jcenter()
+}
\ No newline at end of file
diff --git a/samples/koltin/gradle/wrapper/gradle-wrapper.jar b/samples/koltin/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..1948b90
Binary files /dev/null and b/samples/koltin/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/samples/koltin/gradle/wrapper/gradle-wrapper.properties b/samples/koltin/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..a4fc03d
--- /dev/null
+++ b/samples/koltin/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,5 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.8-all.zip
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/samples/koltin/gradlew b/samples/koltin/gradlew
new file mode 100755
index 0000000..cccdd3d
--- /dev/null
+++ b/samples/koltin/gradlew
@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# 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
+ ;;
+ 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"
+ which java >/dev/null 2>&1 || 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
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/samples/koltin/gradlew.bat b/samples/koltin/gradlew.bat
new file mode 100644
index 0000000..f955316
--- /dev/null
+++ b/samples/koltin/gradlew.bat
@@ -0,0 +1,84 @@
+@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=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@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=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+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 init
+
+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
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+: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 %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="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!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/samples/koltin/kobalt/src/Build.kt b/samples/koltin/kobalt/src/Build.kt
new file mode 100644
index 0000000..7b2bfae
--- /dev/null
+++ b/samples/koltin/kobalt/src/Build.kt
@@ -0,0 +1,28 @@
+import com.beust.kobalt.*
+import com.beust.kobalt.plugin.application.*
+import com.beust.kobalt.plugin.packaging.assemble
+
+// ./kobaltw run
+
+val bs = buildScript {
+ repos(localMaven())
+}
+
+val p = project {
+ name = "KotlinExample"
+ version = "0.1"
+
+ dependencies {
+ compile("net.thauvin.erik:pinboard-poster:1.0.0")
+ }
+
+ assemble {
+ jar {
+
+ }
+ }
+
+ application {
+ mainClass = "net.thauvin.erik.pinboard.samples.KotlinExampleKt"
+ }
+}
diff --git a/samples/koltin/kobalt/wrapper/kobalt-wrapper.jar b/samples/koltin/kobalt/wrapper/kobalt-wrapper.jar
new file mode 100644
index 0000000..0721eec
Binary files /dev/null and b/samples/koltin/kobalt/wrapper/kobalt-wrapper.jar differ
diff --git a/samples/koltin/kobalt/wrapper/kobalt-wrapper.properties b/samples/koltin/kobalt/wrapper/kobalt-wrapper.properties
new file mode 100644
index 0000000..132bac2
--- /dev/null
+++ b/samples/koltin/kobalt/wrapper/kobalt-wrapper.properties
@@ -0,0 +1 @@
+kobalt.version=1.0.114
diff --git a/samples/koltin/kobaltw b/samples/koltin/kobaltw
new file mode 100644
index 0000000..c5186d5
--- /dev/null
+++ b/samples/koltin/kobaltw
@@ -0,0 +1,2 @@
+#!/usr/bin/env sh
+java -jar "`dirname "$0"`/kobalt/wrapper/kobalt-wrapper.jar" $*
diff --git a/samples/koltin/kobaltw.bat b/samples/koltin/kobaltw.bat
new file mode 100644
index 0000000..d578071
--- /dev/null
+++ b/samples/koltin/kobaltw.bat
@@ -0,0 +1,4 @@
+@echo off
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+java -jar "%DIRNAME%/kobalt/wrapper/kobalt-wrapper.jar" %*
diff --git a/samples/koltin/settings.gradle b/samples/koltin/settings.gradle
new file mode 100644
index 0000000..b5aa465
--- /dev/null
+++ b/samples/koltin/settings.gradle
@@ -0,0 +1 @@
+rootProject.name = 'samples-koltin'
diff --git a/samples/koltin/src/main/kotlin/net/thauvin/erik/pinboard/samples/KotlinExample.kt b/samples/koltin/src/main/kotlin/net/thauvin/erik/pinboard/samples/KotlinExample.kt
new file mode 100644
index 0000000..65a2370
--- /dev/null
+++ b/samples/koltin/src/main/kotlin/net/thauvin/erik/pinboard/samples/KotlinExample.kt
@@ -0,0 +1,65 @@
+/*
+ * KotlinExample.kt
+ *
+ * Copyright (c) 2017-2018, Erik C. Thauvin (erik@thauvin.net)
+ * All rights reserved.
+ *
+ * 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.pinboard.samples
+
+import net.thauvin.erik.pinboard.PinboardPoster
+import java.nio.file.Paths
+import java.util.logging.ConsoleHandler
+import java.util.logging.Level
+
+fun main(args: Array) {
+ val url = "http://www.example.com/pinboard"
+
+ val poster = if (args.size == 1) {
+ // API Token is an argument
+ PinboardPoster(args[0])
+ } else {
+ // API Token is in local.properties or PINBOARD_API_TOKEN environment variable
+ PinboardPoster(Paths.get("local.properties"))
+ }
+
+ // Set logging levels
+ with(poster.logger) {
+ addHandler(ConsoleHandler().apply { level = Level.FINE })
+ level = Level.FINE
+ }
+
+ // Add Pin
+ if (poster.addPin(url, "Testing", "Extended test", "test kotlin")) {
+ println("Added: $url")
+ }
+
+ // Delete Pin
+ if (poster.deletePin(url)) {
+ println("Deleted: $url")
+ }
+}
\ No newline at end of file
diff --git a/settings.gradle b/settings.gradle
new file mode 100644
index 0000000..f9442f4
--- /dev/null
+++ b/settings.gradle
@@ -0,0 +1 @@
+enableFeaturePreview('STABLE_PUBLISHING')
\ No newline at end of file
diff --git a/sonar-project.properties b/sonar-project.properties
deleted file mode 100644
index 20487a7..0000000
--- a/sonar-project.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-sonar.organization=ethauvin-github
-sonar.projectKey=ethauvin_pinboard-poster
-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/pinboard/PinboardPosterBuild.java b/src/bld/java/net/thauvin/erik/pinboard/PinboardPosterBuild.java
deleted file mode 100644
index 7dfc1d4..0000000
--- a/src/bld/java/net/thauvin/erik/pinboard/PinboardPosterBuild.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * PinboardPosterBuild.java
- *
- * Copyright (c) 2017-2025, 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.pinboard;
-
-import rife.bld.BuildCommand;
-import rife.bld.Project;
-import rife.bld.extension.CompileKotlinOperation;
-import rife.bld.extension.DetektOperation;
-import rife.bld.extension.DokkaOperation;
-import rife.bld.extension.JacocoReportOperation;
-import rife.bld.extension.dokka.LoggingLevel;
-import rife.bld.extension.dokka.OutputFormat;
-import rife.bld.extension.kotlin.CompileOptions;
-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 java.util.logging.ConsoleHandler;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import static rife.bld.dependencies.Repository.*;
-import static rife.bld.dependencies.Scope.compile;
-import static rife.bld.dependencies.Scope.test;
-
-public class PinboardPosterBuild extends Project {
- final File srcMainKotlin = new File(srcMainDirectory(), "kotlin");
-
- public PinboardPosterBuild() {
- pkg = "net.thauvin.erik";
- name = "pinboard-poster";
- version = version(1, 2, 1, "SNAPSHOT");
-
- mainClass = pkg + ".PinboardPoster";
-
- javaRelease = 11;
- downloadSources = true;
- autoDownloadPurge = true;
- repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL);
-
- final var okHttp = version(4, 12, 0);
- final var kotlin = version(2, 1, 20);
- scope(compile)
- // Kotlin
- .include(dependency("org.jetbrains.kotlin", "kotlin-stdlib", kotlin))
- .include(dependency("org.jetbrains.kotlin", "kotlin-stdlib-common", kotlin))
- .include(dependency("org.jetbrains.kotlin", "kotlin-stdlib-jdk8", kotlin))
- // OkHttp
- .include(dependency("com.squareup.okhttp3", "okhttp", okHttp))
- .include(dependency("com.squareup.okhttp3", "logging-interceptor", okHttp));
- scope(test)
- .include(dependency("org.jetbrains.kotlin", "kotlin-test-junit5", kotlin))
- .include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 12, 2)))
- .include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 12, 2)))
- .include(dependency("org.junit.platform", "junit-platform-launcher", version(1, 12, 2)));
-
- 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")))
- .repository(repository("github"))
- .info()
- .groupId(pkg)
- .artifactId(name)
- .description("A small library for posting to Pinboard")
- .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 + ".git")
- .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(srcMainKotlin);
- }
-
- public static void main(final String[] args) {
- // Enable detailed logging for the extensions
- var level = Level.ALL;
- var logger = Logger.getLogger("rife.bld.extension");
- var consoleHandler = new ConsoleHandler();
-
- consoleHandler.setLevel(level);
- logger.addHandler(consoleHandler);
- logger.setLevel(level);
- logger.setUseParentHandlers(false);
-
- new PinboardPosterBuild().start(args);
- }
-
- @BuildCommand(summary = "Compiles the Kotlin project")
- @Override
- public void compile() throws Exception {
- new CompileKotlinOperation()
- .fromProject(this)
- .compileOptions(new CompileOptions().verbose(true))
- .execute();
- }
-
- @BuildCommand(summary = "Checks source with Detekt")
- public void detekt() throws ExitStatusException, IOException, InterruptedException {
- new DetektOperation()
- .fromProject(this)
- .baseline("config/detekt/baseline.xml")
- .execute();
- }
-
- @BuildCommand(value = "detekt-baseline", summary = "Creates the Detekt baseline")
- public void detektBaseline() throws ExitStatusException, IOException, InterruptedException {
- new DetektOperation()
- .fromProject(this)
- .baseline("config/detekt/baseline.xml")
- .createBaseline(true)
- .execute();
- }
-
- @BuildCommand(summary = "Generates JaCoCo Reports")
- public void jacoco() throws Exception {
- new JacocoReportOperation()
- .fromProject(this)
- .sourceFiles(srcMainKotlin)
- .execute();
- }
-
- @Override
- public void javadoc() throws ExitStatusException, IOException, InterruptedException {
- new DokkaOperation()
- .fromProject(this)
- .loggingLevel(LoggingLevel.INFO)
- .moduleName("CryptoPrice")
- .moduleVersion(version.toString())
- .outputDir(new File(buildDirectory(), "javadoc"))
- .outputFormat(OutputFormat.JAVADOC)
- .execute();
- }
-
- @Override
- public void publish() throws Exception {
- super.publish();
- pomRoot();
- }
-
- @Override
- public void publishLocal() throws Exception {
- super.publishLocal();
- 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/pinboard/PinConfig.kt b/src/main/kotlin/net/thauvin/erik/pinboard/PinConfig.kt
deleted file mode 100644
index a41e563..0000000
--- a/src/main/kotlin/net/thauvin/erik/pinboard/PinConfig.kt
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * PinConfig.kt
- *
- * Copyright (c) 2017-2025, 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.pinboard
-
-import java.time.ZonedDateTime
-
-/**
- * Provides a builder to add a pin.
- *
- * Supports of all the [Pinboard API Parameters](https://pinboard.in/api/#posts_add).
- */
-class PinConfig private constructor(builder: Builder) {
- val url: String = builder.url
- val description: String = builder.description
- val extended = builder.extended
- val tags = builder.tags
- val dt = builder.dt
- val replace = builder.replace
- val shared = builder.shared
- val toRead = builder.toRead
-
- /**
- * Configures the parameters to add a pin.
- *
- * @param url The URL of the bookmark.
- * @param description The title of the bookmark.
- */
- data class Builder(var url: String, var description: String) {
- var extended: String = ""
- var tags: Array = emptyArray()
- var dt: ZonedDateTime = ZonedDateTime.now()
- var replace: Boolean = true
- var shared: Boolean = true
- var toRead: Boolean = false
-
- /**
- * The URL of the bookmark.
- */
- fun url(url: String): Builder = apply { this.url = url }
-
- /**
- * The title of the bookmark.
- */
- fun description(description: String): Builder = apply { this.description = description }
-
- /**
- * The description of the bookmark.
- */
- fun extended(extended: String): Builder = apply { this.extended = extended }
-
- /**
- * A list of up to 100 tags.
- */
- fun tags(vararg tag: String): Builder = apply { this.tags = tag }
-
- /**
- * The creation time of the bookmark.
- */
- fun dt(datetime: ZonedDateTime): Builder = apply { this.dt = datetime }
-
- /**
- * Replace any existing bookmark with the specified URL. Default `true`.
- */
- fun replace(replace: Boolean): Builder = apply { this.replace = replace }
-
- /**
- * Make bookmark public. Default is `true`.
- */
- fun shared(shared: Boolean): Builder = apply { this.shared = shared }
-
- /**
- * Mark the bookmark as unread. Default is `false`.
- */
- fun toRead(toRead: Boolean): Builder = apply { this.toRead = toRead }
-
- /**
- * Builds a new configuration.
- */
- fun build() = PinConfig(this)
-
- override fun equals(other: Any?): Boolean {
- if (this === other) return true
- if (javaClass != other?.javaClass) return false
-
- other as Builder
-
- if (url != other.url) return false
- if (description != other.description) return false
- if (extended != other.extended) return false
- if (!tags.contentEquals(other.tags)) return false
- if (dt != other.dt) return false
- if (replace != other.replace) return false
- if (shared != other.shared) return false
- if (toRead != other.toRead) return false
-
- return true
- }
-
- override fun hashCode(): Int {
- var result = url.hashCode()
- result = 31 * result + description.hashCode()
- result = 31 * result + extended.hashCode()
- result = 31 * result + tags.contentHashCode()
- result = 31 * result + dt.hashCode()
- result = 31 * result + replace.hashCode()
- result = 31 * result + shared.hashCode()
- result = 31 * result + toRead.hashCode()
- return result
- }
-
- override fun toString(): String {
- return "Builder(url='$url', description='$description', extended='$extended'," +
- "tags=${tags.contentToString()}, dt=$dt, replace=$replace, shared=$shared, toRead=$toRead)"
- }
- }
-}
diff --git a/src/main/kotlin/net/thauvin/erik/pinboard/PinboardPoster.kt b/src/main/kotlin/net/thauvin/erik/pinboard/PinboardPoster.kt
index 00d2cc1..1c02378 100644
--- a/src/main/kotlin/net/thauvin/erik/pinboard/PinboardPoster.kt
+++ b/src/main/kotlin/net/thauvin/erik/pinboard/PinboardPoster.kt
@@ -1,7 +1,8 @@
/*
* PinboardPoster.kt
*
- * Copyright (c) 2017-2025, Erik C. Thauvin (erik@thauvin.net)
+ * Copyright (c) 2017-2018, Erik C. Thauvin (erik@thauvin.net)
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -28,23 +29,17 @@
* 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.pinboard
-import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
+import okhttp3.HttpUrl
import okhttp3.OkHttpClient
import okhttp3.Request
-import okhttp3.logging.HttpLoggingInterceptor
import org.xml.sax.InputSource
import java.io.File
-import java.io.IOException
import java.io.StringReader
-import java.net.URI
-import java.net.URISyntaxException
+import java.net.URL
import java.nio.file.Files
import java.nio.file.Path
-import java.time.ZonedDateTime
-import java.time.format.DateTimeFormatter
import java.util.*
import java.util.logging.Level
import java.util.logging.Logger
@@ -54,7 +49,6 @@ import javax.xml.parsers.DocumentBuilderFactory
object Constants {
/** The Pinboard API endpoint URL. **/
const val API_ENDPOINT = "https://api.pinboard.in/v1/"
-
/** The API token environment variable. **/
const val ENV_API_TOKEN = "PINBOARD_API_TOKEN"
}
@@ -64,7 +58,7 @@ object Constants {
*
* @constructor Creates a new instance.
*
- * @author Erik C. Thauvin
+ * @author [Erik C. Thauvin](https://erik.thauvin.net/)
*/
open class PinboardPoster() {
/**
@@ -82,6 +76,7 @@ open class PinboardPoster() {
* @param properties The properties.
* @param key The property key.
*/
+ @Suppress("unused")
@JvmOverloads
constructor(properties: Properties, key: String = Constants.ENV_API_TOKEN) : this() {
apiToken = properties.getProperty(key, apiToken)
@@ -115,7 +110,7 @@ open class PinboardPoster() {
constructor(propertiesFile: File, key: String = Constants.ENV_API_TOKEN) : this(propertiesFile.toPath(), key)
/** The API token. **/
- var apiToken: String = System.getenv(Constants.ENV_API_TOKEN) ?: ""
+ var apiToken: String = if (System.getenv(Constants.ENV_API_TOKEN).isNullOrBlank()) "" else System.getenv(Constants.ENV_API_TOKEN)
/** The API end point. **/
var apiEndPoint: String = Constants.API_ENDPOINT
@@ -123,31 +118,7 @@ open class PinboardPoster() {
/** The logger instance. **/
val logger: Logger by lazy { Logger.getLogger(PinboardPoster::class.java.simpleName) }
- private val client by lazy {
- OkHttpClient.Builder().apply {
- if (logger.isLoggable(Level.FINE)) {
- addInterceptor(HttpLoggingInterceptor().apply {
- level = HttpLoggingInterceptor.Level.BODY
- })
- }
- }.build()
- }
-
- /**
- * Adds a bookmark to Pinboard using a [PinConfig] builder.
- */
- fun addPin(config: PinConfig): Boolean {
- return addPin(
- url = config.url,
- description = config.description,
- extended = config.extended,
- tags = config.tags,
- dt = config.dt,
- replace = config.replace,
- shared = config.shared,
- toRead = config.toRead
- )
- }
+ private val client by lazy { OkHttpClient() }
/**
* Adds a bookmark to Pinboard.
@@ -158,39 +129,37 @@ open class PinboardPoster() {
* @param description The title of the bookmark.
* @param extended The description of the bookmark.
* @param tags A list of up to 100 tags.
- * @param dt The creation time of the bookmark.
- * @param replace Replace any existing bookmark with the specified URL. Default `true`.
- * @param shared Make bookmark public. Default is `true`.
+ * @param dt The creation time of the bookmark.
+ * @param replace Replace any existing bookmark with the specified URL. Default `true`.
+ * @param shared Make bookmark public. Default is `true`.
* @param toRead Mark the bookmark as unread. Default is `false`.
*
* @return `true` if bookmark was successfully added.
*/
@JvmOverloads
- fun addPin(
- url: String,
- description: String,
- extended: String = "",
- vararg tags: String = emptyArray(),
- dt: ZonedDateTime = ZonedDateTime.now(),
- replace: Boolean = true,
- shared: Boolean = true,
- toRead: Boolean = false
- ): Boolean {
+ fun addPin(url: String,
+ description: String,
+ extended: String = "",
+ tags: String = "",
+ dt: String = "",
+ replace: Boolean = true,
+ shared: Boolean = true,
+ toRead: Boolean = false): Boolean {
if (validate()) {
if (!validateUrl(url)) {
logger.severe("Please specify a valid URL to pin.")
} else if (description.isBlank()) {
- logger.severe("Please specify a valid description to pin: `$url`")
+ logger.severe("Please specify a valid description.")
} else {
- val params = mapOf(
- "url" to url,
- "description" to description,
- "extended" to extended,
- "tags" to tags.joinToString(","),
- "dt" to DateTimeFormatter.ISO_INSTANT.format(dt.withNano(0)),
- "replace" to yesNo(replace),
- "shared" to yesNo(shared),
- "toread" to yesNo(toRead)
+ val params = listOf(
+ Pair("url", url),
+ Pair("description", description),
+ Pair("extended", extended),
+ Pair("tags", tags),
+ Pair("dt", dt),
+ Pair("replace", yesNo(replace)),
+ Pair("shared", yesNo(shared)),
+ Pair("toread", yesNo(toRead))
)
return executeMethod("posts/add", params)
}
@@ -213,109 +182,103 @@ open class PinboardPoster() {
if (!validateUrl(url)) {
logger.severe("Please specify a valid URL to delete.")
} else {
- return executeMethod("posts/delete", mapOf("url" to url))
+ return executeMethod("posts/delete", listOf(Pair("url", url)))
}
}
return false
}
- @Throws(IOException::class)
- internal fun parseMethodResponse(method: String, response: String) {
- val factory = DocumentBuilderFactory.newInstance().apply {
- isValidating = false
- isIgnoringElementContentWhitespace = true
- isIgnoringComments = true
- isCoalescing = false
- isNamespaceAware = false
- }
+ private fun executeMethod(method: String, params: List>): Boolean {
+ val apiUrl = HttpUrl.parse(cleanEndPoint(method))
+ if (apiUrl != null) {
+ val httpUrl = apiUrl.newBuilder().apply {
+ params.forEach {
+ if (it.second.isNotBlank()) {
+ addQueryParameter(it.first, it.second)
+ }
+ }
+ addQueryParameter("auth_token", apiToken)
+ }.build()
- if (response.isEmpty()) {
- throw IOException("Response for $method is empty.")
- }
+ val request = Request.Builder().url(httpUrl).build()
+ val result = client.newCall(request).execute()
- try {
- val document = factory.newDocumentBuilder().parse(InputSource(StringReader(response)))
+ logHttp(method, "HTTP Result: ${result.code()}")
- val code = document.getElementsByTagName("result")?.item(0)?.attributes?.getNamedItem("code")?.nodeValue
+ val response = result.body()?.string()
- if (!code.isNullOrBlank()) {
- throw IOException("An error has occurred while executing $method: $code")
- } else {
- throw IOException("An error has occurred while executing $method.")
+ if (response != null) {
+ logHttp(method, "HTTP Response:\n$response")
+ if (response.contains("done")) {
+ return true
+ } else {
+ val factory = DocumentBuilderFactory.newInstance().apply {
+ isValidating = false
+ isIgnoringElementContentWhitespace = true
+ isIgnoringComments = true
+ isCoalescing = false
+ isNamespaceAware = false
+ }
+
+ try {
+ val document = factory.newDocumentBuilder().parse(InputSource(StringReader(response)))
+
+ val code = document.getElementsByTagName("result")?.item(0)?.attributes?.getNamedItem("code")?.nodeValue
+
+ if (code != null && code.isNotBlank()) {
+ logger.severe("An error has occurred while executing $method: $code")
+ } else {
+ logger.severe("An error has occurred while executing $method.")
+ }
+ } catch (e: Exception) {
+ logger.log(Level.SEVERE, "Could not parse $method XML response.", e)
+ }
+ }
}
- } catch (e: org.xml.sax.SAXException) {
- throw IOException("Could not parse $method response.", e)
- } catch (e: IllegalArgumentException) {
- throw IOException("Invalid input source for $method response", e)
+ } else {
+ logger.severe("Invalid API end point: $apiEndPoint")
}
+
+ return false
}
private fun cleanEndPoint(method: String): String {
- return if (apiEndPoint.last() == '/') {
+ return if (apiEndPoint.endsWith('/')) {
"$apiEndPoint$method"
} else {
"$apiEndPoint/$method"
}
}
- private fun executeMethod(method: String, params: Map): Boolean {
- try {
- val apiUrl = cleanEndPoint(method).toHttpUrlOrNull()
- if (apiUrl != null) {
- val httpUrl = apiUrl.newBuilder().apply {
- params.forEach {
- addQueryParameter(it.key, it.value)
- }
- addQueryParameter("auth_token", apiToken)
- }.build()
-
- val request = Request.Builder().url(httpUrl).build()
- client.newCall(request).execute().use { result ->
- result.body?.string()?.let { response ->
- if (response.contains("done")) {
- return true
- } else {
- parseMethodResponse(method, response)
- }
- }
- }
- } else {
- logger.severe("Invalid API end point: $apiEndPoint")
- }
- } catch (e: IOException) {
- logger.log(Level.SEVERE, e.message, e)
- }
-
- return false
+ private fun logHttp(method: String, msg: String) {
+ logger.logp(Level.FINE, PinboardPoster::class.java.name, "executeMethod($method)", msg)
}
- /**
- * Ensures that the API token and end point are valid.
- */
- fun validate(): Boolean {
- var isValid = true
- if (!apiToken.contains(':')) {
+ private fun validate(): Boolean {
+ if (apiToken.isBlank() || !apiToken.contains(':')) {
logger.severe("Please specify a valid API token. (eg. user:TOKEN)")
- isValid = false
+ return false
} else if (!validateUrl(apiEndPoint)) {
logger.severe("Please specify a valid API end point. (eg. ${Constants.API_ENDPOINT})")
- isValid = false
+ return false
}
- return isValid
+ return true
}
private fun validateUrl(url: String): Boolean {
- var isValid = url.isNotBlank()
- if (isValid) {
- try {
- URI(url)
- } catch (e: URISyntaxException) {
- logger.log(Level.FINE, "Invalid URL: $url", e)
- isValid = false
- }
+ if (url.isBlank()) {
+ return false
}
- return isValid
+
+ try {
+ URL(url)
+ } catch (e: Exception) {
+ logger.log(Level.FINE, "Invalid URL: $url", e)
+ return false
+ }
+
+ return true
}
private fun yesNo(bool: Boolean): String {
@@ -325,4 +288,4 @@ open class PinboardPoster() {
"no"
}
}
-}
+}
\ No newline at end of file
diff --git a/src/test/kotlin/net/thauvin/erik/pinboard/PinboardPosterTest.kt b/src/test/kotlin/net/thauvin/erik/pinboard/PinboardPosterTest.kt
index 9281df5..83c417e 100644
--- a/src/test/kotlin/net/thauvin/erik/pinboard/PinboardPosterTest.kt
+++ b/src/test/kotlin/net/thauvin/erik/pinboard/PinboardPosterTest.kt
@@ -1,7 +1,8 @@
/*
* PinboardPosterTest.kt
*
- * Copyright (c) 2017-2025, Erik C. Thauvin (erik@thauvin.net)
+ * Copyright (c) 2017-2018, Erik C. Thauvin (erik@thauvin.net)
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -28,127 +29,43 @@
* 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.pinboard
-import org.junit.jupiter.api.assertThrows
-import java.io.IOException
-import java.nio.file.Files
+import org.testng.Assert
+import org.testng.annotations.Test
import java.nio.file.Paths
-import java.time.ZonedDateTime
-import java.util.*
-import java.util.logging.Level
-import kotlin.test.Test
-import kotlin.test.assertFalse
-import kotlin.test.assertTrue
class PinboardPosterTest {
- private val url = randomUrl()
+ private val url = "http://www.foo.com/"
private val desc = "This is a test."
private val localProps = Paths.get("local.properties")
- private val isCi = "true" == System.getenv("CI")
-
- private fun randomUrl(): String = "https://www.example.com/?random=" + (1000..10000).random()
@Test
fun testAddPin() {
var poster = PinboardPoster("")
- poster.logger.level = Level.FINE
- assertFalse(poster.addPin(url, desc), "apiToken: ")
+ Assert.assertFalse(poster.addPin(url, desc), "apiToken: ")
poster.apiToken = "foo"
- assertFalse(poster.addPin(url, desc), "apiToken: ${poster.apiToken}")
+ Assert.assertFalse(poster.addPin(url, desc), "apiToken: ${poster.apiToken}")
- // poster.apiToken = "foo:TESTING"
- // assertFalse(poster.addPin(url, desc), "apiToken: ${poster.apiToken}")
+ //poster.apiToken = "foo:TESTING"
+ //Assert.assertFalse(poster.addPin(url, desc), "apiToken: ${poster.apiToken}")
poster = PinboardPoster(localProps)
- if (!isCi) {
- poster.logger.level = Level.FINE
- }
-
- assertTrue(poster.validate(), "validate()")
-
- assertTrue(poster.addPin(url, desc), "addPin($url, $desc)")
-
- assertTrue(poster.deletePin(url), "deletePin($url)")
- }
-
- @Test
- fun testAddPinConfig() {
- val poster = PinboardPoster(localProps)
- if (!isCi) {
- poster.logger.level = Level.FINE
- }
-
- assertTrue(poster.validate(), "validate()")
-
- var config = PinConfig.Builder(url, desc).extended("extra")
-
- assertTrue(poster.addPin(config.build()), "apiToken: ${Constants.ENV_API_TOKEN}")
-
- config = config.tags("foo", "bar")
- assertTrue(poster.addPin(config.build()), "tags(foo,bar)")
-
- config = config.shared(false)
- assertTrue(poster.addPin(config.build()), "shared(false)")
-
- try {
- assertFalse(poster.addPin(config.replace(false).build()))
- } catch (e: IOException) {
- assertTrue(e.message!!.contains("item already exists"))
- }
-
- config = config.description("Yet another test.").replace(true).toRead(true)
- assertTrue(poster.addPin(config.build()), "toRead(true)")
-
- config = config.dt(ZonedDateTime.now())
- assertTrue(poster.addPin(config.build()), "dt(now)")
-
- assertTrue(poster.deletePin(url), "deletePin($url)")
-
- config = config.url(randomUrl())
- assertTrue(poster.addPin(config.build()), "add($url)")
- assertTrue(poster.deletePin(config.url), "delete($url)")
+ Assert.assertTrue(poster.addPin(url, desc), "apiToken: ${Constants.ENV_API_TOKEN}")
}
@Test
fun testDeletePin() {
- val props = if (Files.exists(localProps)) {
- Properties().apply {
- Files.newInputStream(localProps).use { nis -> load(nis) }
- }
- } else {
- Properties().apply {
- setProperty(Constants.ENV_API_TOKEN, System.getenv(Constants.ENV_API_TOKEN))
- }
- }
-
- var poster = PinboardPoster(props)
- if (!isCi) {
- poster.logger.level = Level.FINE
- }
-
- assertTrue(poster.validate(), "validate()")
+ val poster = PinboardPoster(localProps)
poster.apiEndPoint = ""
- assertFalse(poster.deletePin(url), "apiEndPoint: ")
-
- poster = PinboardPoster(localProps, Constants.ENV_API_TOKEN)
+ Assert.assertFalse(poster.deletePin(url), "apiEndPoint: ")
poster.apiEndPoint = Constants.API_ENDPOINT
- assertTrue(poster.addPin(url, desc), "addPin($url, $desc)")
- assertTrue(poster.deletePin(url), "deletePin($url)")
+ Assert.assertTrue(poster.deletePin(url), "apiEndPoint: ${Constants.API_ENDPOINT}")
- assertThrows {
- poster.parseMethodResponse("post/delete", " ")
- }
-
- assertThrows {
- poster.parseMethodResponse("post/delete", "")
- }
-
- assertFalse(poster.deletePin("foo.com"), "deletePin(foo.com)")
+ Assert.assertFalse(poster.deletePin("foo.com"), "url: foo.com")
}
}