Misc. updates (whitespace, editorconfig, IDEA, etc.)

This commit is contained in:
Erik C. Thauvin 2018-07-13 01:09:09 -07:00
parent f501e6c073
commit 290bf5cf93
20 changed files with 369 additions and 406 deletions

2
.editorconfig Normal file
View file

@ -0,0 +1,2 @@
[*]
insert_final_newline=true

View file

@ -5,10 +5,8 @@
<output-test url="file://$MODULE_DIR$/../../out/test/classes" />
<exclude-output />
<content url="file://$MODULE_DIR$/../..">
<sourceFolder url="file://$MODULE_DIR$/../../src/generated/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/../../src/annotationProcessor/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/../../src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/../../src/test/resources" type="java-test-resource" />
<excludeFolder url="file://$MODULE_DIR$/../../.gradle" />
@ -18,30 +16,33 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: pircbot:pircbot:1.5.0" level="project" />
<orderEntry type="library" name="Gradle: pircbot:pircbot:1.5.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: pircbot:pircbot:1.5.0:sources" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: org.apache.logging.log4j:log4j-slf4j-impl:2.10.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: org.apache.logging.log4j:log4j-core:2.10.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: org.apache.logging.log4j:log4j-api:2.10.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: commons-cli:commons-cli:1.4" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: commons-net:commons-net:3.6" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: net.thauvin.erik:pinboard-poster:0.9.3" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: com.squareup.okhttp3:okhttp:3.9.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: com.rometools:rome:1.9.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: org.json:json:20171018" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: org.ostermiller:utils:1.07.00" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: org.jsoup:jsoup:1.11.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: net.objecthunter:exp4j:0.4.8" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: org.twitter4j:twitter4j-core:4.0.6" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: net.thauvin.erik:semver:1.0.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: com.rometools:rome-utils:1.9.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: org.slf4j:slf4j-api:1.8.0-alpha2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: com.squareup.okio:okio:1.13.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: org.jdom:jdom2:2.0.6" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib:1.1.51" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: com.github.spullara.mustache.java:compiler:0.9.4" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: org.jetbrains:annotations:13.0" level="project" />
<orderEntry type="module-library" scope="PROVIDED">
<orderEntry type="library" name="Gradle: org.apache.logging.log4j:log4j-slf4j-impl:2.11.0" level="project" />
<orderEntry type="library" name="Gradle: org.apache.logging.log4j:log4j-core:2.11.0" level="project" />
<orderEntry type="library" name="Gradle: org.apache.logging.log4j:log4j-api:2.11.0" level="project" />
<orderEntry type="library" name="Gradle: commons-cli:commons-cli:1.4" level="project" />
<orderEntry type="library" name="Gradle: commons-net:commons-net:3.6" level="project" />
<orderEntry type="library" name="Gradle: net.thauvin.erik:pinboard-poster:1.0.0" level="project" />
<orderEntry type="library" name="Gradle: com.squareup.okhttp3:okhttp:3.10.0" level="project" />
<orderEntry type="library" name="Gradle: com.rometools:rome:1.11.0" level="project" />
<orderEntry type="library" name="Gradle: org.json:json:20180130" level="project" />
<orderEntry type="library" name="Gradle: org.ostermiller:utils:1.07.00" level="project" />
<orderEntry type="library" name="Gradle: org.jsoup:jsoup:1.11.3" level="project" />
<orderEntry type="library" name="Gradle: net.objecthunter:exp4j:0.4.8" level="project" />
<orderEntry type="library" name="Gradle: org.twitter4j:twitter4j-core:4.0.6" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: net.thauvin.erik:semver:1.1.0-beta" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: com.github.spotbugs:spotbugs-annotations:3.1.5" level="project" />
<orderEntry type="library" name="Gradle: com.rometools:rome-utils:1.11.0" level="project" />
<orderEntry type="library" name="Gradle: org.slf4j:slf4j-api:1.8.0-alpha2" level="project" />
<orderEntry type="library" name="Gradle: com.squareup.okio:okio:1.14.0" level="project" />
<orderEntry type="library" name="Gradle: org.jdom:jdom2:2.0.6" level="project" />
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib:1.2.50" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: com.github.spullara.mustache.java:compiler:0.9.5" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: com.google.code.findbugs:jsr305:3.0.2" level="project" />
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib-common:1.2.50" level="project" />
<orderEntry type="library" name="Gradle: org.jetbrains:annotations:13.0" level="project" />
<orderEntry type="module-library">
<library name="Gradle: owm-japis-2.5.0.5">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../lib/owm-japis-2.5.0.5.jar!/" />
@ -50,66 +51,9 @@
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" scope="RUNTIME" name="Gradle: pircbot:pircbot:1.5.0" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: org.apache.logging.log4j:log4j-slf4j-impl:2.10.0" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: org.apache.logging.log4j:log4j-core:2.10.0" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: org.apache.logging.log4j:log4j-api:2.10.0" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: commons-cli:commons-cli:1.4" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: commons-net:commons-net:3.6" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: net.thauvin.erik:pinboard-poster:0.9.3" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: com.squareup.okhttp3:okhttp:3.9.1" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: com.rometools:rome:1.9.0" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: org.json:json:20171018" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: org.ostermiller:utils:1.07.00" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: org.jsoup:jsoup:1.11.2" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: net.objecthunter:exp4j:0.4.8" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: org.twitter4j:twitter4j-core:4.0.6" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: com.rometools:rome-utils:1.9.0" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: org.slf4j:slf4j-api:1.8.0-alpha2" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: com.squareup.okio:okio:1.13.0" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: org.jdom:jdom2:2.0.6" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib:1.1.51" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: org.jetbrains:annotations:13.0" level="project" />
<orderEntry type="module-library" scope="RUNTIME">
<library name="Gradle: owm-japis-2.5.0.5">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../lib/owm-japis-2.5.0.5.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" scope="TEST" name="Gradle: pircbot:pircbot:1.5.0" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.apache.logging.log4j:log4j-slf4j-impl:2.10.0" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.apache.logging.log4j:log4j-core:2.10.0" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.apache.logging.log4j:log4j-api:2.10.0" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: commons-cli:commons-cli:1.4" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: commons-net:commons-net:3.6" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: net.thauvin.erik:pinboard-poster:0.9.3" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: com.squareup.okhttp3:okhttp:3.9.1" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: com.rometools:rome:1.9.0" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.json:json:20171018" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.ostermiller:utils:1.07.00" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.jsoup:jsoup:1.11.2" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: net.objecthunter:exp4j:0.4.8" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.twitter4j:twitter4j-core:4.0.6" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.testng:testng:6.13.1" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.assertj:assertj-core:3.9.0" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: com.rometools:rome-utils:1.9.0" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.slf4j:slf4j-api:1.8.0-alpha2" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: com.squareup.okio:okio:1.13.0" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.jdom:jdom2:2.0.6" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib:1.1.51" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.testng:testng:6.14.3" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.assertj:assertj-core:3.10.0" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: com.beust:jcommander:1.72" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.jetbrains:annotations:13.0" level="project" />
<orderEntry type="module-library" scope="TEST">
<library name="Gradle: owm-japis-2.5.0.5">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../lib/owm-japis-2.5.0.5.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" scope="TEST" name="Gradle: org.apache-extras.beanshell:bsh:2.0b6" level="project" />
</component>
</module>

View file

@ -21,7 +21,7 @@ final def semverProcessor = "net.thauvin.erik:semver:1.1.0-beta"
mainClassName = packageName + '.Mobibot'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
compileJava.options.annotationProcessorGeneratedSourcesDirectory = file("${projectDir}/src/generated")
compileJava.options.annotationProcessorGeneratedSourcesDirectory = file("${projectDir}/src/generated/java")
repositories {
mavenLocal()

View file

@ -151,8 +151,6 @@
<option name="SUGGEST_PRIVATE_FOR_INNERS" value="false" />
</inspection_tool>
</profile>
<option name="useProjectProfile" value="false" />
<option name="PROJECT_PROFILE" />
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</component>
@ -162,7 +160,7 @@
<option name="autoDownloadKobalt" value="true" />
<option name="downloadSources" value="false" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="kobaltHome" value="$USER_HOME$/.kobalt/wrapper/dist/kobalt-1.0.100" />
<option name="kobaltHome" value="$USER_HOME$/.kobalt/wrapper/dist/kobalt-1.0.114" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
@ -224,7 +222,7 @@
<module fileurl="file://$PROJECT_DIR$/.idea/modules/mobibot.iml" filepath="$PROJECT_DIR$/.idea/modules/mobibot.iml" />
</modules>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8.x" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" project-jdk-name="10" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="PropertiesComponent">
@ -338,49 +336,67 @@
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.beust/jcommander/1.72/7ef123d5dfb6f839b41265648ff1be34982d50f8/jcommander-1.72-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: com.github.spullara.mustache.java:compiler:0.9.4">
<library name="Gradle: com.github.spotbugs:spotbugs-annotations:3.1.5">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.github.spullara.mustache.java/compiler/0.9.4/1d1fab03f31a75018fc30ec248859a5c89cd342f/compiler-0.9.4.jar!/" />
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.github.spotbugs/spotbugs-annotations/3.1.5/4e2e5448fba7b4aa298d4eb9af25a9ba707bcb0e/spotbugs-annotations-3.1.5.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.github.spullara.mustache.java/compiler/0.9.4/599674a480f9940ff5e25b375c6f59d14d8a4bfa/compiler-0.9.4-sources.jar!/" />
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.github.spotbugs/spotbugs-annotations/3.1.5/da4048bfca28ece42ea0affc28c8362927aa0ee4/spotbugs-annotations-3.1.5-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: com.rometools:rome-utils:1.9.0">
<library name="Gradle: com.github.spullara.mustache.java:compiler:0.9.5">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.rometools/rome-utils/1.9.0/9f2291327c641cd78d3111d50e9b03022f6c1090/rome-utils-1.9.0.jar!/" />
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.github.spullara.mustache.java/compiler/0.9.5/2d13ba8f4e9e578ef3636c064dae4ed675c8de7d/compiler-0.9.5.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.rometools/rome-utils/1.9.0/905649e08280147d3655b51454c76e99ed4f54b1/rome-utils-1.9.0-sources.jar!/" />
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.github.spullara.mustache.java/compiler/0.9.5/45e36f16202869f7b3e335cb9497318380a3f59a/compiler-0.9.5-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: com.rometools:rome:1.9.0">
<library name="Gradle: com.google.code.findbugs:jsr305:3.0.2">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.rometools/rome/1.9.0/4546a79a6fb470c5235806c877d9438140f3bb61/rome-1.9.0.jar!/" />
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.code.findbugs/jsr305/3.0.2/25ea2e8b0c338a877313bd4672d3fe056ea78f0d/jsr305-3.0.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.rometools/rome/1.9.0/b54fdebe24f1df782e714c20e238619a8bdbee71/rome-1.9.0-sources.jar!/" />
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.code.findbugs/jsr305/3.0.2/b19b5927c2c25b6c70f093767041e641ae0b1b35/jsr305-3.0.2-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: com.squareup.okhttp3:okhttp:3.9.1">
<library name="Gradle: com.rometools:rome-utils:1.11.0">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.squareup.okhttp3/okhttp/3.9.1/84b4b7d1c4a238e7899972b7446c250691e65f1f/okhttp-3.9.1.jar!/" />
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.rometools/rome-utils/1.11.0/a35a96278cb585b3875c25c45bd2b438058392a7/rome-utils-1.11.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.squareup.okhttp3/okhttp/3.9.1/7539531ecf9b6e082fcab195f0835d4f69ead95e/okhttp-3.9.1-sources.jar!/" />
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.rometools/rome-utils/1.11.0/1e1d75cf40c8b75679814829fb37ed8210d4fffe/rome-utils-1.11.0-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: com.squareup.okio:okio:1.13.0">
<library name="Gradle: com.rometools:rome:1.11.0">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.squareup.okio/okio/1.13.0/a9283170b7305c8d92d25aff02a6ab7e45d06cbe/okio-1.13.0.jar!/" />
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.rometools/rome/1.11.0/245e0d8e5b3461b2842fa739b2693b0e7a4f0a46/rome-1.11.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.squareup.okio/okio/1.13.0/f4c91e12121af963e3ef76e81c82aa75ba6e8533/okio-1.13.0-sources.jar!/" />
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.rometools/rome/1.11.0/77c6cb39cfd14bd0b02ccbc6bbb23a13e7300d48/rome-1.11.0-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: com.squareup.okhttp3:okhttp:3.10.0">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.squareup.okhttp3/okhttp/3.10.0/7ef0f1d95bf4c0b3ba30bbae25e0e562b05cf75e/okhttp-3.10.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.squareup.okhttp3/okhttp/3.10.0/e99b7b608968f16b07104b93e62cb90701174d0/okhttp-3.10.0-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: com.squareup.okio:okio:1.14.0">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.squareup.okio/okio/1.14.0/102d7be47241d781ef95f1581d414b0943053130/okio-1.14.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.squareup.okio/okio/1.14.0/e7c96b4fe5651490d8f3c022042940d743a3bdd9/okio-1.14.0-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: commons-cli:commons-cli:1.4">
@ -410,58 +426,67 @@
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.objecthunter/exp4j/0.4.8/8d86f148ff1f0d5b624eae9bb0882198ab5cd07/exp4j-0.4.8-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: net.thauvin.erik:pinboard-poster:0.9.3">
<library name="Gradle: net.thauvin.erik:pinboard-poster:1.0.0">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/net/thauvin/erik/pinboard-poster/0.9.3/pinboard-poster-0.9.3.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/net/thauvin/erik/pinboard-poster/1.0.0/pinboard-poster-1.0.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/net/thauvin/erik/pinboard-poster/0.9.3/pinboard-poster-0.9.3-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/net/thauvin/erik/pinboard-poster/1.0.0/pinboard-poster-1.0.0-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: net.thauvin.erik:semver:1.0.1">
<library name="Gradle: net.thauvin.erik:semver:1.1.0-beta">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/net/thauvin/erik/semver/1.0.1/semver-1.0.1.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/net/thauvin/erik/semver/1.1.0-beta/semver-1.1.0-beta.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/net/thauvin/erik/semver/1.0.1/semver-1.0.1-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/net/thauvin/erik/semver/1.1.0-beta/semver-1.1.0-beta-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: org.apache.logging.log4j:log4j-api:2.10.0">
<library name="Gradle: org.apache-extras.beanshell:bsh:2.0b6">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-api/2.10.0/fec5797a55b786184a537abd39c3fa1449d752d6/log4j-api-2.10.0.jar!/" />
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache-extras.beanshell/bsh/2.0b6/fb418f9b33a0b951e9a2978b4b6ee93b2707e72f/bsh-2.0b6.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-api/2.10.0/fd42afa6acbfb3801accec744106ee28b9342567/log4j-api-2.10.0-sources.jar!/" />
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache-extras.beanshell/bsh/2.0b6/76a65f674e8f2df409934824c49ca338987c63ae/bsh-2.0b6-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: org.apache.logging.log4j:log4j-core:2.10.0">
<library name="Gradle: org.apache.logging.log4j:log4j-api:2.11.0">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-core/2.10.0/c90b597163cd28ab6d9687edd53db601b6ea75a1/log4j-core-2.10.0.jar!/" />
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-api/2.11.0/bede79a3f150711634a3047985517431bf6499f2/log4j-api-2.11.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-core/2.10.0/a2041b29bc3e761fba750c0df933cd48f76f5b3a/log4j-core-2.10.0-sources.jar!/" />
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-api/2.11.0/97f6fb29d69b48fe4bdb47cc21c834b4536cf752/log4j-api-2.11.0-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: org.apache.logging.log4j:log4j-slf4j-impl:2.10.0">
<library name="Gradle: org.apache.logging.log4j:log4j-core:2.11.0">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-slf4j-impl/2.10.0/8e4e0a30736175e31c7f714d95032c1734cfbdea/log4j-slf4j-impl-2.10.0.jar!/" />
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-core/2.11.0/e6b751e02120c08702d98750f6a80bc25343b7f5/log4j-core-2.11.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-slf4j-impl/2.10.0/51e9adc49fcb32d961c66170c9b4b092ee809d9c/log4j-slf4j-impl-2.10.0-sources.jar!/" />
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-core/2.11.0/932392dc515dae4e750ac4a96c39ba69d5e81db3/log4j-core-2.11.0-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: org.assertj:assertj-core:3.9.0">
<library name="Gradle: org.apache.logging.log4j:log4j-slf4j-impl:2.11.0">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.assertj/assertj-core/3.9.0/de324a44efe19b9222d2218f7ac3102d728497d8/assertj-core-3.9.0.jar!/" />
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-slf4j-impl/2.11.0/9ba207b78e470fe7765ebee14f1f0336c9cbcc18/log4j-slf4j-impl-2.11.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.assertj/assertj-core/3.9.0/7eefa834515f5adb0a14713b9c3cf9aa565530d8/assertj-core-3.9.0-sources.jar!/" />
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-slf4j-impl/2.11.0/eaf7016f6df9069dbc295a9c7a5d6424a1f237c2/log4j-slf4j-impl-2.11.0-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: org.assertj:assertj-core:3.10.0">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.assertj/assertj-core/3.10.0/4898fc7b9a2f7f8457bd380f917b08416df313f7/assertj-core-3.10.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.assertj/assertj-core/3.10.0/31def12d16eb0ce1478b77ca94c55e2b7e97b114/assertj-core-3.10.0-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: org.jdom:jdom2:2.0.6">
@ -473,13 +498,22 @@
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jdom/jdom2/2.0.6/3dcf8ba7582eeac3b67ed5155ee3659e16c8dadc/jdom2-2.0.6-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: org.jetbrains.kotlin:kotlin-stdlib:1.1.51">
<library name="Gradle: org.jetbrains.kotlin:kotlin-stdlib-common:1.2.50" type="kotlin.common">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.1.51/e34fe80c9714240525f665113dd3749415515655/kotlin-stdlib-1.1.51.jar!/" />
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.2.50/6b19a2fcc29d34878b3aab33fd5fcf70458a73df/kotlin-stdlib-common-1.2.50.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.1.51/b44aed5fe16fe27bb75488a2274d435e875fdb44/kotlin-stdlib-1.1.51-sources.jar!/" />
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.2.50/d3189b4b8c72c7f3a327e3c21dca8dbcba267359/kotlin-stdlib-common-1.2.50-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: org.jetbrains.kotlin:kotlin-stdlib:1.2.50">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.2.50/66d47b004c5b8a1d2d1df9e463187390ed741316/kotlin-stdlib-1.2.50.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.2.50/9ec9cf82e5e18d990a4b4fb3b5763cd3637b6d63/kotlin-stdlib-1.2.50-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: org.jetbrains:annotations:13.0">
@ -491,22 +525,22 @@
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/5991ca87ef1fb5544943d9abc5a9a37583fabe03/annotations-13.0-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: org.json:json:20171018">
<library name="Gradle: org.json:json:20180130">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.json/json/20171018/36ced462c97f0845b4a7b266a25cebe95d18baa3/json-20171018.jar!/" />
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.json/json/20180130/26ba2ec0e791a32ea5dfbedfcebf36447ee5b12c/json-20180130.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.json/json/20171018/b4a63d74bc32f012342173c1a1da6fbe90065d69/json-20171018-sources.jar!/" />
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.json/json/20180130/66ab57acbb9086d16201c2eafa2145d2b914bb26/json-20180130-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: org.jsoup:jsoup:1.11.2">
<library name="Gradle: org.jsoup:jsoup:1.11.3">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jsoup/jsoup/1.11.2/e3eeb8a0b4ce1db246059a41e353cd7413dad226/jsoup-1.11.2.jar!/" />
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jsoup/jsoup/1.11.3/36da09a8f68484523fa2aaa100399d612b247d67/jsoup-1.11.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jsoup/jsoup/1.11.2/f0f1f0d1ceb2cd515c98649d9ad6b8b9814899b2/jsoup-1.11.2-sources.jar!/" />
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jsoup/jsoup/1.11.3/871302b15d8cee9bfb393c4f1d0386b17646d8d1/jsoup-1.11.3-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: org.ostermiller:utils:1.07.00">
@ -527,13 +561,13 @@
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-api/1.8.0-alpha2/5818a2c13c12c71c2861315d90888104a875f438/slf4j-api-1.8.0-alpha2-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: org.testng:testng:6.13.1">
<library name="Gradle: org.testng:testng:6.14.3">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.testng/testng/6.13.1/2495393a0b4b7d7a4b49ea1f8516376f70f482c/testng-6.13.1.jar!/" />
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.testng/testng/6.14.3/d24515dc253e77e54b73df97e1fb2eb7faf34fdd/testng-6.14.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.testng/testng/6.13.1/a2b77dfee647263d2c1010215441bfa3e28c4b9c/testng-6.13.1-sources.jar!/" />
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.testng/testng/6.14.3/bfd2538501a129a142fe8366169c48b91609dc0b/testng-6.14.3-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: org.twitter4j:twitter4j-core:4.0.6">

View file

@ -4,28 +4,26 @@
*/
package net.thauvin.erik.mobibot;
import java.time.*;
import java.util.Date;
/**
* Provides semantic version information.
*
* @author <a href="https://github.com/ethauvin/semver">Semantic Version
* Annotation Processor</a>
* @author <a href="https://github.com/ethauvin/semver">Semantic Version Annotation Processor</a>
*/
public final class ReleaseInfo {
public final static String PRERELEASE_PREFIX = "-";
public final static String BUILDMETA_PREFIX = "+";
public final static String PROJECT = "mobibot";
public final static LocalDateTime BUILDDATE =
LocalDateTime.ofInstant(Instant.ofEpochMilli(1529959364831L), ZoneId.systemDefault());
public final static String PROJECT = "";
public final static Date BUILDDATE = new Date(1531467929376L);
public final static int MAJOR = 0;
public final static int MINOR = 7;
public final static int PATCH = 2;
public final static int PATCH = 3;
public final static String PRERELEASE = "beta";
public final static String BUILDMETA = "030";
public final static String BUILDMETA = "1";
/**
/**
* The full version string.
* <p>
* Formatted as:

View file

@ -160,7 +160,7 @@ final public class Commands {
* @throws UnsupportedOperationException If the constructor is called.
*/
private Commands()
throws UnsupportedOperationException {
throws UnsupportedOperationException {
throw new UnsupportedOperationException("Illegal constructor call.");
}
}

View file

@ -74,7 +74,7 @@ final class EntriesMgr {
* @throws UnsupportedOperationException If the constructor is called.
*/
private EntriesMgr()
throws UnsupportedOperationException {
throws UnsupportedOperationException {
throw new UnsupportedOperationException("Illegal constructor call.");
}
@ -141,13 +141,13 @@ final class EntriesMgr {
for (int i = items.size() - 1; i >= 0; i--) {
item = (SyndEntryImpl) items.get(i);
author = item.getAuthor()
.substring(item.getAuthor().lastIndexOf('(') + 1, item.getAuthor().length() - 1);
.substring(item.getAuthor().lastIndexOf('(') + 1, item.getAuthor().length() - 1);
entry = new EntryLink(item.getLink(),
item.getTitle(),
author,
channel,
item.getPublishedDate(),
item.getCategories());
item.getTitle(),
author,
channel,
item.getPublishedDate(),
item.getCategories());
description = item.getDescription();
comments = description.getValue().split("<br/>");
@ -209,8 +209,8 @@ final class EntriesMgr {
entry = entries.get(i);
buff = new StringBuffer(
"Posted by <b>" + entry.getNick() + "</b> on <a href=\"irc://" + bot.getIrcServer() + '/'
+ entry.getChannel() + "\"><b>" + entry.getChannel() + "</b></a>");
"Posted by <b>" + entry.getNick() + "</b> on <a href=\"irc://" + bot.getIrcServer() + '/'
+ entry.getChannel() + "\"><b>" + entry.getChannel() + "</b></a>");
if (entry.getCommentsCount() > 0) {
buff.append(" <br/><br/>");
@ -236,7 +236,7 @@ final class EntriesMgr {
item.setTitle(entry.getTitle());
item.setPublishedDate(entry.getDate());
item.setAuthor(
bot.getChannel().substring(1) + '@' + bot.getIrcServer() + " (" + entry.getNick() + ')');
bot.getChannel().substring(1) + '@' + bot.getIrcServer() + " (" + entry.getNick() + ')');
item.setCategories(entry.getTags());
items.add(item);
@ -304,7 +304,7 @@ final class EntriesMgr {
bot.getLogger().warn("Unable to generate the backlogs feed. No property configured.");
}
}
} catch (Exception e) {
} catch (FeedException | IOException e) {
bot.getLogger().warn("Unable to generate the entries feed.", e);
} finally {
try {
@ -317,7 +317,7 @@ final class EntriesMgr {
}
} else {
bot.getLogger()
.warn("Unable to generate the entries feed. At least one of the required property is missing.");
.warn("Unable to generate the entries feed. At least one of the required property is missing.");
}
}
}

View file

@ -120,7 +120,7 @@ public class EntryLink implements Serializable {
this.title = title;
this.nick = nick;
this.channel = channel;
this.date = date;
this.date = new Date(date.getTime());
setTags(tags);
}
@ -202,23 +202,7 @@ public class EntryLink implements Serializable {
* @return The date.
*/
public final Date getDate() {
return date;
}
/**
* Returns the tags formatted for pinboard.in
*
* @return The tags as a comma-delimited string.
*/
public final String getPinboardTags() {
final StringBuilder tags = new StringBuilder(nick);
for (final Object tag : this.tags) {
tags.append(',');
tags.append(((SyndCategoryImpl) tag).getName());
}
return tags.toString();
return new Date(date.getTime());
}
/**
@ -276,6 +260,22 @@ public class EntryLink implements Serializable {
this.nick = nick;
}
/**
* Returns the tags formatted for pinboard.in
*
* @return The tags as a comma-delimited string.
*/
public final String getPinboardTags() {
final StringBuilder tags = new StringBuilder(nick);
for (final Object tag : this.tags) {
tags.append(',');
tags.append(((SyndCategoryImpl) tag).getName());
}
return tags.toString();
}
/**
* Returns the tags.
*
@ -288,10 +288,44 @@ public class EntryLink implements Serializable {
/**
* Sets the tags.
*
* @param tags The tags.
* @param tags The space-delimited tags.
*/
private void setTags(final List<SyndCategory> tags) {
this.tags.addAll(tags);
public final void setTags(final String tags) {
if (tags != null) {
final String[] parts = tags.replaceAll(", ", " ").replaceAll(",", " ").split(" ");
SyndCategoryImpl tag;
String part;
char mod;
for (final String rawPart : parts) {
part = rawPart.trim();
if (part.length() >= 2) {
tag = new SyndCategoryImpl();
tag.setName(part.substring(1).toLowerCase());
mod = part.charAt(0);
if (mod == '-') {
// Don't remove the channel tag, if any.
if (!tag.getName().equals(channel.substring(1))) {
this.tags.remove(tag);
}
} else if (mod == '+') {
if (!this.tags.contains(tag)) {
this.tags.add(tag);
}
} else {
tag.setName(part.trim().toLowerCase());
if (!this.tags.contains(tag)) {
this.tags.add(tag);
}
}
}
}
}
}
/**
@ -346,44 +380,10 @@ public class EntryLink implements Serializable {
/**
* Sets the tags.
*
* @param tags The space-delimited tags.
* @param tags The tags.
*/
public final void setTags(final String tags) {
if (tags != null) {
final String[] parts = tags.replaceAll(", ", " ").replaceAll(",", " ").split(" ");
SyndCategoryImpl tag;
String part;
char mod;
for (final String rawPart : parts) {
part = rawPart.trim();
if (part.length() >= 2) {
tag = new SyndCategoryImpl();
tag.setName(part.substring(1).toLowerCase());
mod = part.charAt(0);
if (mod == '-') {
// Don't remove the channel tag, if any.
if (!tag.getName().equals(channel.substring(1))) {
this.tags.remove(tag);
}
} else if (mod == '+') {
if (!this.tags.contains(tag)) {
this.tags.add(tag);
}
} else {
tag.setName(part.trim().toLowerCase());
if (!this.tags.contains(tag)) {
this.tags.add(tag);
}
}
}
}
}
private void setTags(final List<SyndCategory> tags) {
this.tags.addAll(tags);
}
/**
@ -394,7 +394,7 @@ public class EntryLink implements Serializable {
public final String toString() {
return super.toString() + "[ channel -> '" + channel + '\'' + ", comments -> " + comments + ", date -> " + date
+ ", link -> '" + link + '\'' + ", login -> '" + login + '\'' + ", nick -> '" + nick + '\''
+ ", tags -> " + tags + ", title -> '" + title + '\'' + " ]";
+ ", link -> '" + link + '\'' + ", login -> '" + login + '\'' + ", nick -> '" + nick + '\''
+ ", tags -> " + tags + ", title -> '" + title + '\'' + " ]";
}
}

View file

@ -75,8 +75,8 @@ public class Mobibot extends PircBot {
// The info strings.
private static final String[] INFO_STRS = {
ReleaseInfo.PROJECT + " v" + ReleaseInfo.VERSION + " by Erik C. Thauvin (erik@thauvin.net)",
"https://www.mobitopia.org/mobibot/"
ReleaseInfo.PROJECT + " v" + ReleaseInfo.VERSION + " by Erik C. Thauvin (erik@thauvin.net)",
"https://www.mobitopia.org/mobibot/"
};
// The link match string.
@ -105,34 +105,31 @@ public class Mobibot extends PircBot {
// The version strings.
private static final String[] VERSION_STRS = {
"Version: "
+ ReleaseInfo.VERSION
+ " ("
+ Utils.isoLocalDate(ReleaseInfo.BUILDDATE) + ')',
"Platform: "
+ System.getProperty("os.name")
+ " ("
+ System.getProperty("os.version")
+ ", "
+ System.getProperty("os.arch")
+ ", "
+ System.getProperty("user.country") + ')',
"Runtime: "
+ System.getProperty("java.runtime.name")
+ " (build "
+ System.getProperty("java.runtime.version")
+ ')',
"VM: "
+ System.getProperty("java.vm.name")
+ " (build "
+ System.getProperty("java.vm.version")
+ ", "
+ System.getProperty("java.vm.info")
+ ')'
"Version: "
+ ReleaseInfo.VERSION
+ " ("
+ Utils.isoLocalDate(ReleaseInfo.BUILDDATE) + ')',
"Platform: "
+ System.getProperty("os.name")
+ " ("
+ System.getProperty("os.version")
+ ", "
+ System.getProperty("os.arch")
+ ", "
+ System.getProperty("user.country") + ')',
"Runtime: "
+ System.getProperty("java.runtime.name")
+ " (build "
+ System.getProperty("java.runtime.version")
+ ')',
"VM: "
+ System.getProperty("java.vm.name")
+ " (build "
+ System.getProperty("java.vm.version")
+ ", "
+ System.getProperty("java.vm.info")
+ ')'
};
// The tell object.
private static Tell tell;
// The commands list.
private final List<String> commandsList = new ArrayList<>();
// The entries array.
@ -145,43 +142,32 @@ public class Mobibot extends PircBot {
private final String ircChannel;
// The IRC port.
private final int ircPort;
// The IRC server.
private final String ircServer;
// The logger.
private final Logger logger = LogManager.getLogger(Mobibot.class);
// The logger default level.
private final Level loggerLevel;
// The log directory.
private final String logsDir;
// The recap array.
private final List<String> recap = new ArrayList<>(0);
// The backlogs URL.
private String backLogsUrl = "";
// The default tags/categories.
private String defaultTags = "";
// The feed URL.
private String feedURL = "";
// The ident message.
private String identMsg = "";
// The ident nick.
private String identNick = "";
// The NickServ ident password.
private String identPwd = "";
// The pinboard posts handler.
private Pinboard pinboard = null;
// The tell object.
private Tell tell;
// Today's date.
private String today = Utils.today();
@ -245,7 +231,7 @@ public class Mobibot extends PircBot {
setVersion(p.getProperty("weblog", ""));
setMessageDelay(MESSAGE_DELAY);
setIdentity(p.getProperty("ident", ""), p.getProperty("ident-nick", ""),
p.getProperty("ident-msg", ""));
p.getProperty("ident-msg", ""));
// Set the URLs
setWeblogUrl(getVersion());
@ -271,11 +257,11 @@ public class Mobibot extends PircBot {
// Load the modules properties
MODULES.stream().filter(AbstractModule::hasProperties).forEach(
module -> {
for (final String s : module.getPropertyKeys()) {
module.setProperty(s, p.getProperty(s, ""));
}
});
module -> {
for (final String s : module.getPropertyKeys()) {
module.setProperty(s, p.getProperty(s, ""));
}
});
// Get the tell command settings
tell = new Tell(this, p.getProperty("tell-max-days"), p.getProperty("tell-max-size"));
@ -330,7 +316,7 @@ public class Mobibot extends PircBot {
final Properties p = new Properties();
try (final FileInputStream fis = new FileInputStream(
new File(line.getOptionValue(Commands.PROPS_ARG.charAt(0), "./mobibot.properties")))) {
line.getOptionValue(Commands.PROPS_ARG.charAt(0), "./mobibot.properties"))) {
// Load the properties files
p.load(fis);
} catch (FileNotFoundException e) {
@ -353,7 +339,7 @@ public class Mobibot extends PircBot {
try {
stdout = new PrintStream(new FileOutputStream(
logsDir + channel.substring(1) + '.' + Utils.today() + ".log", true));
logsDir + channel.substring(1) + '.' + Utils.today() + ".log", true));
} catch (IOException e) {
System.err.println("Unable to open output (stdout) log file.");
e.printStackTrace(System.err);
@ -364,7 +350,7 @@ public class Mobibot extends PircBot {
try {
stderr = new PrintStream(
new FileOutputStream(logsDir + nickname + ".err", true));
new FileOutputStream(logsDir + nickname + ".err", true));
} catch (IOException e) {
System.err.println("Unable to open error (stderr) log file.");
e.printStackTrace(System.err);
@ -436,8 +422,8 @@ public class Mobibot extends PircBot {
if (retries == MAX_RECONNECT) {
if (logger.isDebugEnabled()) {
logger.debug(
"Unable to reconnect to " + ircServer + " after " + MAX_RECONNECT + " retries.",
ex);
"Unable to reconnect to " + ircServer + " after " + MAX_RECONNECT + " retries.",
ex);
}
e.printStackTrace(System.err);
@ -550,9 +536,9 @@ public class Mobibot extends PircBot {
for (final char c : getNick().toCharArray()) {
if (Character.isLetter(c)) {
buff.append('[')
.append(String.valueOf(c).toLowerCase())
.append(String.valueOf(c).toUpperCase())
.append(']');
.append(String.valueOf(c).toLowerCase())
.append(String.valueOf(c).toUpperCase())
.append(']');
} else {
buff.append(c);
}
@ -699,7 +685,7 @@ public class Mobibot extends PircBot {
commandsList.add(Commands.VIEW_CMD);
MODULES.stream().filter(AbstractModule::isEnabled).forEach(
module -> commandsList.addAll(module.getCommands()));
module -> commandsList.addAll(module.getCommands()));
if (tell.isEnabled()) {
commandsList.add(Tell.TELL_CMD);
@ -729,11 +715,11 @@ public class Mobibot extends PircBot {
if (isOp(sender)) {
send(sender, "The op commands are:");
send(sender, helpIndent(
Commands.CYCLE_CMD + " "
+ Commands.ME_CMD + " "
+ Commands.MSG_CMD + " "
+ Commands.SAY_CMD + " "
+ Commands.VERSION_CMD));
Commands.CYCLE_CMD + " "
+ Commands.ME_CMD + " "
+ Commands.MSG_CMD + " "
+ Commands.SAY_CMD + " "
+ Commands.VERSION_CMD));
}
}
}
@ -1524,7 +1510,7 @@ public class Mobibot extends PircBot {
*/
private void storeRecap(final String sender, final String message, final boolean isAction) {
recap.add(Utils.utcDateTime(LocalDateTime.now(Clock.systemUTC())) + " -> " + sender + (isAction ? " " : ": ")
+ message);
+ message);
if (recap.size() > MAX_RECAP) {
recap.remove(0);
@ -1624,13 +1610,13 @@ public class Mobibot extends PircBot {
if (lcArgs.length() > 0) {
if ((entry.getLink().toLowerCase().contains(lcArgs)) ||
(entry.getTitle().toLowerCase().contains(lcArgs)) ||
(entry.getNick().toLowerCase().contains(lcArgs))) {
(entry.getTitle().toLowerCase().contains(lcArgs)) ||
(entry.getNick().toLowerCase().contains(lcArgs))) {
if (sent > MAX_ENTRIES) {
send(sender,
"To view more, try: " + Utils
.bold(getNick() + ": " + Commands.VIEW_CMD + ' ' + (i + 1) + ' ' + lcArgs),
isPrivate);
"To view more, try: " + Utils
.bold(getNick() + ": " + Commands.VIEW_CMD + ' ' + (i + 1) + ' ' + lcArgs),
isPrivate);
break;
}
@ -1641,9 +1627,9 @@ public class Mobibot extends PircBot {
} else {
if (sent > MAX_ENTRIES) {
send(sender,
"To view more, try: " + Utils
.bold(getNick() + ": " + Commands.VIEW_CMD + ' ' + (i + 1)),
isPrivate);
"To view more, try: " + Utils
.bold(getNick() + ": " + Commands.VIEW_CMD + ' ' + (i + 1)),
isPrivate);
break;
}

View file

@ -82,12 +82,12 @@ class Pinboard {
final SwingWorker<Boolean, Void> worker = new SwingWorker<Boolean, Void>() {
@Override
protected Boolean doInBackground()
throws Exception {
throws Exception {
return pinboard.addPin(entry.getLink(),
entry.getTitle(),
postedBy(entry),
entry.getPinboardTags(),
formatDate(entry.getDate()));
entry.getTitle(),
postedBy(entry),
entry.getPinboardTags(),
formatDate(entry.getDate()));
}
};
@ -105,7 +105,7 @@ class Pinboard {
final SwingWorker<Boolean, Void> worker = new SwingWorker<Boolean, Void>() {
@Override
protected Boolean doInBackground()
throws Exception {
throws Exception {
return pinboard.deletePin(link);
}
};
@ -143,23 +143,23 @@ class Pinboard {
final SwingWorker<Boolean, Void> worker = new SwingWorker<Boolean, Void>() {
@Override
protected Boolean doInBackground()
throws Exception {
throws Exception {
if (!oldUrl.equals(entry.getLink())) {
pinboard.deletePin(oldUrl);
return pinboard.addPin(entry.getLink(),
entry.getTitle(),
postedBy(entry),
entry.getPinboardTags(),
formatDate(entry.getDate()));
entry.getTitle(),
postedBy(entry),
entry.getPinboardTags(),
formatDate(entry.getDate()));
} else {
return pinboard.addPin(entry.getLink(),
entry.getTitle(),
postedBy(entry),
entry.getPinboardTags(),
formatDate(entry.getDate()),
true,
true);
entry.getTitle(),
postedBy(entry),
entry.getPinboardTags(),
formatDate(entry.getDate()),
true,
true);
}
}
};

View file

@ -146,9 +146,9 @@ public class Tell {
if (messages.size() > 0) {
for (final TellMessage message : messages) {
bot.send(sender, Utils.bold(message.getSender()) + " --> " + Utils.bold(message.getRecipient())
+ " [ID: " + message.getId() + ", "
+ (message.isReceived() ? "DELIVERED" : "QUEUED") + ']',
true);
+ " [ID: " + message.getId() + ", "
+ (message.isReceived() ? "DELIVERED" : "QUEUED") + ']',
true);
}
} else {
bot.send(sender, "There are no messages in the queue.", true);
@ -165,17 +165,17 @@ public class Tell {
if (message.isReceived()) {
bot.send(sender,
Utils.bold(message.getSender()) + " --> " + Utils.bold(message.getRecipient())
+ " [" + Utils.utcDateTime(message.getReceived()) + ", ID: "
+ message.getId() + ", DELIVERED]",
true);
Utils.bold(message.getSender()) + " --> " + Utils.bold(message.getRecipient())
+ " [" + Utils.utcDateTime(message.getReceived()) + ", ID: "
+ message.getId() + ", DELIVERED]",
true);
} else {
bot.send(sender,
Utils.bold(message.getSender()) + " --> " + Utils.bold(message.getRecipient())
+ " [" + Utils.utcDateTime(message.getQueued()) + ", ID: "
+ message.getId() + ", QUEUED]",
true);
Utils.bold(message.getSender()) + " --> " + Utils.bold(message.getRecipient())
+ " [" + Utils.utcDateTime(message.getQueued()) + ", ID: "
+ message.getId() + ", QUEUED]",
true);
}
bot.send(sender, bot.helpIndent(message.getMessage(), false), true);
@ -187,10 +187,10 @@ public class Tell {
} else {
bot.send(sender, "To delete one or all delivered messages:");
bot.send(sender,
bot.helpIndent(bot.getNick() + ": " + TELL_CMD + ' ' + TELL_DEL_KEYWORD + " <id|"
+ TELL_ALL_KEYWORD + '>'));
bot.helpIndent(bot.getNick() + ": " + TELL_CMD + ' ' + TELL_DEL_KEYWORD + " <id|"
+ TELL_ALL_KEYWORD + '>'));
bot.send(sender, "Messages are kept for " + Utils.bold(maxDays)
+ Utils.plural(maxDays, " day.", " days."));
+ Utils.plural(maxDays, " day.", " days."));
}
}
} else if (cmds.startsWith(TELL_DEL_KEYWORD + ' ')) {
@ -254,7 +254,7 @@ public class Tell {
save();
bot.send(sender, "Message [ID " + message.getId() + "] was queued for "
+ Utils.bold(message.getRecipient()), true);
+ Utils.bold(message.getRecipient()), true);
} else {
bot.send(sender, "Sorry, the messages queue is currently full.", true);
}
@ -282,42 +282,42 @@ public class Tell {
public void send(final String nickname, final boolean isMessage) {
if (!nickname.equals(bot.getNick()) && isEnabled()) {
messages.stream().filter(message -> message.isMatch(nickname)).forEach(
message -> {
if (message.getRecipient().equalsIgnoreCase(nickname) && !message.isReceived()) {
if (message.getSender().equals(nickname)) {
if (!isMessage) {
bot.send(nickname, Utils.bold("You") + " wanted me to remind you: "
+ Utils.reverseColor(message.getMessage()),
true);
message.setIsReceived();
message.setIsNotified();
save();
}
} else {
bot.send(nickname, message.getSender() + " wanted me to tell you: "
+ Utils.reverseColor(message.getMessage()),
true);
message -> {
if (message.getRecipient().equalsIgnoreCase(nickname) && !message.isReceived()) {
if (message.getSender().equals(nickname)) {
if (!isMessage) {
bot.send(nickname, Utils.bold("You") + " wanted me to remind you: "
+ Utils.reverseColor(message.getMessage()),
true);
message.setIsReceived();
message.setIsNotified();
save();
}
} else if (message.getSender().equalsIgnoreCase(nickname) && message.isReceived()
&& !message.isNotified()) {
bot.send(nickname,
"Your message "
+ Utils.reverseColor("[ID " + message.getId() + ']') + " was sent to "
+ Utils.bold(message.getRecipient()) + " on "
+ Utils.utcDateTime(message.getReceived()),
true);
} else {
bot.send(nickname, message.getSender() + " wanted me to tell you: "
+ Utils.reverseColor(message.getMessage()),
true);
message.setIsNotified();
message.setIsReceived();
save();
}
});
} else if (message.getSender().equalsIgnoreCase(nickname) && message.isReceived()
&& !message.isNotified()) {
bot.send(nickname,
"Your message "
+ Utils.reverseColor("[ID " + message.getId() + ']') + " was sent to "
+ Utils.bold(message.getRecipient()) + " on "
+ Utils.utcDateTime(message.getReceived()),
true);
message.setIsNotified();
save();
}
});
}
}

View file

@ -53,7 +53,7 @@ final class TellMessagesMgr {
* @throws UnsupportedOperationException If the constructor is called.
*/
private TellMessagesMgr()
throws UnsupportedOperationException {
throws UnsupportedOperationException {
throw new UnsupportedOperationException("Illegal constructor call.");
}

View file

@ -43,17 +43,17 @@ public final class TwitterOAuth {
System.out.print("Enter the PIN (if available) or just hit enter.[PIN]:");
final String pin = br.readLine();
try {
if (pin.length() > 0) {
if (pin != null && pin.length() > 0) {
accessToken = twitter.getOAuthAccessToken(requestToken, pin);
} else {
accessToken = twitter.getOAuthAccessToken();
}
System.out.println(
"Please add the following to the bot's property file:" + "\n\n" + "twitter-consumerKey="
+ args[0] + '\n' + "twitter-consumerSecret=" + args[1] + '\n' + "twitter-token="
+ accessToken.getToken() + '\n' + "twitter-tokenSecret=" + accessToken
.getTokenSecret());
"Please add the following to the bot's property file:" + "\n\n" + "twitter-consumerKey="
+ args[0] + '\n' + "twitter-consumerSecret=" + args[1] + '\n' + "twitter-token="
+ accessToken.getToken() + '\n' + "twitter-tokenSecret=" + accessToken
.getTokenSecret());
} catch (TwitterException te) {
if (401 == te.getStatusCode()) {
System.out.println("Unable to get the access token.");

View file

@ -53,7 +53,7 @@ final public class Utils {
* @throws UnsupportedOperationException If the constructor is called.
*/
private Utils()
throws UnsupportedOperationException {
throws UnsupportedOperationException {
throw new UnsupportedOperationException("Illegal constructor call.");
}
@ -87,7 +87,7 @@ final public class Utils {
*/
static String buildComment(final int entryIndex, final int commentIndex, final EntryComment comment) {
return (Commands.LINK_CMD + (entryIndex + 1) + '.' + (commentIndex + 1) + ": [" + comment.getNick() + "] "
+ comment.getComment());
+ comment.getComment());
}
/**

View file

@ -137,8 +137,8 @@ final public class CurrencyConverter extends AbstractModule {
for (final Object rawCube : cubes) {
cube = (Element) rawCube;
EXCHANGE_RATES.put(
cube.getAttribute("currency").getValue(),
cube.getAttribute("rate").getValue());
cube.getAttribute("currency").getValue(),
cube.getAttribute("rate").getValue());
}
EXCHANGE_RATES.put("EUR", "1");
@ -148,7 +148,7 @@ final public class CurrencyConverter extends AbstractModule {
} catch (IOException e) {
bot.getLogger().debug("Unable to fetch the exchange rates table.", e);
bot.send(sender,
"An error has occurred while fetching the exchange rates table: " + e.getMessage());
"An error has occurred while fetching the exchange rates table: " + e.getMessage());
}
}
@ -170,18 +170,18 @@ final public class CurrencyConverter extends AbstractModule {
final double to = Double.parseDouble(EXCHANGE_RATES.get(cmds[3].toUpperCase()));
bot.send(bot.getChannel(),
NumberFormat.getCurrencyInstance(Locale.US).format(amt).substring(1)
+ ' '
+ cmds[1].toUpperCase()
+ " = "
+ NumberFormat.getCurrencyInstance(Locale.US)
.format((amt * to) / from)
.substring(1)
+ ' '
+ cmds[3].toUpperCase());
NumberFormat.getCurrencyInstance(Locale.US).format(amt).substring(1)
+ ' '
+ cmds[1].toUpperCase()
+ " = "
+ NumberFormat.getCurrencyInstance(Locale.US)
.format((amt * to) / from)
.substring(1)
+ ' '
+ cmds[3].toUpperCase());
} catch (NullPointerException ignored) {
bot.send(sender,
"The supported currencies are: " + EXCHANGE_RATES.keySet().toString());
"The supported currencies are: " + EXCHANGE_RATES.keySet().toString());
}
}
}

View file

@ -71,7 +71,7 @@ final public class Lookup extends AbstractModule {
* @throws java.net.UnknownHostException If the host is unknown.
*/
public static String lookup(final String query)
throws UnknownHostException {
throws UnknownHostException {
final StringBuilder buffer = new StringBuilder("");
final InetAddress[] results = InetAddress.getAllByName(query);
@ -106,7 +106,7 @@ final public class Lookup extends AbstractModule {
* @throws java.io.IOException If a connection error occurs.
*/
private static String[] whois(final String query)
throws IOException {
throws IOException {
return whois(query, WHOIS_HOST);
}
@ -118,9 +118,9 @@ final public class Lookup extends AbstractModule {
* @return The IP whois data, if any.
* @throws java.io.IOException If a connection error occurs.
*/
@SuppressWarnings("WeakerAccess, SameParameterValue")
@SuppressWarnings("SameParameterValue")
public static String[] whois(final String query, final String host)
throws IOException {
throws IOException {
final WhoisClient whois = new WhoisClient();
final String[] lines;
@ -157,8 +157,8 @@ final public class Lookup extends AbstractModule {
bot.send(bot.getChannel(), Lookup.lookup(args));
} catch (UnknownHostException ignore) {
if (args.matches(
"(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\." +
"(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)")) {
"(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\." +
"(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)")) {
try {
final String[] lines = Lookup.whois(args);

View file

@ -106,18 +106,18 @@ final public class Twitter extends AbstractModule {
try {
final ConfigurationBuilder cb = new ConfigurationBuilder();
cb.setDebugEnabled(true)
.setOAuthConsumerKey(properties.get(CONSUMER_KEY_PROP))
.setOAuthConsumerSecret(properties.get(CONSUMER_SECRET_PROP))
.setOAuthAccessToken(properties.get(TOKEN_PROP))
.setOAuthAccessTokenSecret(properties.get(TOKEN_SECRET_PROP));
.setOAuthConsumerKey(properties.get(CONSUMER_KEY_PROP))
.setOAuthConsumerSecret(properties.get(CONSUMER_SECRET_PROP))
.setOAuthAccessToken(properties.get(TOKEN_PROP))
.setOAuthAccessTokenSecret(properties.get(TOKEN_SECRET_PROP));
final TwitterFactory tf = new TwitterFactory(cb.build());
final twitter4j.Twitter twitter = tf.getInstance();
final Status status = twitter.updateStatus(message + " (" + sender + ')');
bot.send(sender,
"You message was posted to http://twitter.com/" + twitter.getScreenName() + "/statuses/" + status
.getId());
"You message was posted to http://twitter.com/" + twitter.getScreenName() + "/statuses/" + status
.getId());
} catch (Exception e) {
bot.getLogger().warn("Unable to post to Twitter: " + message, e);
bot.send(sender, "An error has occurred: " + e.getMessage());

View file

@ -143,8 +143,8 @@ final public class WorldTime extends AbstractModule {
COUNTRIES_MAP.put("BEATS", BEATS_KEYWORD);
ZoneId.getAvailableZoneIds().stream().filter(
tz -> !tz.contains("/") && tz.length() == 3 && !COUNTRIES_MAP.containsKey(tz)).forEach(
tz -> COUNTRIES_MAP.put(tz, tz));
tz -> !tz.contains("/") && tz.length() == 3 && !COUNTRIES_MAP.containsKey(tz)).forEach(
tz -> COUNTRIES_MAP.put(tz, tz));
}
/**
@ -166,8 +166,8 @@ final public class WorldTime extends AbstractModule {
response = ("The current Internet Time is: " + internetTime() + ' ' + BEATS_KEYWORD);
} else {
response = ZonedDateTime.now().withZoneSameInstant(ZoneId.of(tz)).format(
DateTimeFormatter.ofPattern("'The time is 'HH:mm' on 'EEEE, d MMMM yyyy' in '"))
+ tz.substring(tz.indexOf('/') + 1).replace('_', ' ');
DateTimeFormatter.ofPattern("'The time is 'HH:mm' on 'EEEE, d MMMM yyyy' in '"))
+ tz.substring(tz.indexOf('/') + 1).replace('_', ' ');
}
} else {
isInvalidTz = true;
@ -205,7 +205,7 @@ final public class WorldTime extends AbstractModule {
private String internetTime() {
final ZonedDateTime zdt = ZonedDateTime.now(ZoneId.of("UTC+01:00"));
final int beats = (int) ((zdt.get(ChronoField.SECOND_OF_MINUTE) + (zdt.get(ChronoField.MINUTE_OF_HOUR) * 60)
+ (zdt.get(ChronoField.HOUR_OF_DAY) * 3600)) / 86.4);
+ (zdt.get(ChronoField.HOUR_OF_DAY) * 3600)) / 86.4);
return String.format("%c%03d", '@', beats);
}

View file

@ -50,11 +50,11 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
public class UtilsTest {
static final String ASCII =
" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~";
" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~";
final Calendar cal = Calendar.getInstance();
final LocalDateTime localDateTime =
LocalDateTime.of(1952, 2, 17, 12, 30, 0);
LocalDateTime.of(1952, 2, 17, 12, 30, 0);
@BeforeClass
public void setUp() {
@ -76,9 +76,9 @@ public class UtilsTest {
@Test
public void testEnsureDir() throws Exception {
assertThat(Utils.ensureDir("dir", false)).as("ensureDir(dir, false)")
.isEqualTo("dir" + File.separatorChar);
.isEqualTo("dir" + File.separatorChar);
assertThat(Utils.ensureDir("https://erik.thauvin.net", true))
.as("ensureDir(erik.thauvin.net, true)").isEqualTo("https://erik.thauvin.net/");
.as("ensureDir(erik.thauvin.net, true)").isEqualTo("https://erik.thauvin.net/");
}
@Test
@ -131,13 +131,13 @@ public class UtilsTest {
@Test
public void testUnescapeXml() throws Exception {
assertThat(Utils.unescapeXml("&lt;a name=&quot;test &amp; &apos;&#39;&quot;&gt;"))
.isEqualTo("<a name=\"test & ''\">");
.isEqualTo("<a name=\"test & ''\">");
}
@Test
public void testUtcDateTime() throws Exception {
assertThat(Utils.utcDateTime(cal.getTime())).as("utcDateTime(date)").isEqualTo("1952-02-17 12:30");
assertThat(Utils.utcDateTime(localDateTime)).as("utcDateTime(localDate)")
.isEqualTo("1952-02-17 12:30");
.isEqualTo("1952-02-17 12:30");
}
}

View file

@ -1,8 +1,7 @@
#Sun, 29 Oct 2017 09:38:57 -0700
#Mon Dec 07 01:31:00 PST 2015
version.project=mobibot
#Generated by the Semver Plugin for Gradle
#Fri Jul 13 00:45:23 PDT 2018
version.prerelease=beta
version.buildmeta=1
version.patch=3
version.major=0
version.minor=7
version.patch=2
version.prerelease=beta
version.buildmeta=030