aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2017-06-29 14:03:04 +0300
committerGravatar Vitaly Takmazov2017-06-29 14:03:04 +0300
commit02723131139806c761539a42a5fa80b68ecadee8 (patch)
treeca66f22993908758385f708eb2da4e4aeb20510a
parent4cc4b08f4377b7db697abdb533c625da608eb3d3 (diff)
project structure: split server into jdbc + web
-rw-r--r--juick-api/build.gradle5
-rw-r--r--juick-api/src/main/java/com/juick/api/configuration/ApiSecurityConfig.java3
-rw-r--r--juick-api/src/main/java/com/juick/api/controllers/Messages.java2
-rw-r--r--juick-api/src/main/java/com/juick/api/controllers/Notifications.java2
-rw-r--r--juick-api/src/main/java/com/juick/api/controllers/Others.java2
-rw-r--r--juick-api/src/main/java/com/juick/api/controllers/PM.java4
-rw-r--r--juick-api/src/main/java/com/juick/api/controllers/Post.java5
-rw-r--r--juick-api/src/main/java/com/juick/api/controllers/Subscriptions.java2
-rw-r--r--juick-api/src/main/java/com/juick/api/controllers/Tags.java2
-rw-r--r--juick-api/src/main/java/com/juick/api/controllers/Users.java4
-rw-r--r--juick-crosspost/build.gradle2
-rw-r--r--juick-notifications/build.gradle2
-rw-r--r--juick-notifications/src/main/java/com/juick/components/service/NotificationsTokenService.java1
-rw-r--r--juick-rss/build.gradle3
-rw-r--r--juick-server-core/build.gradle61
-rw-r--r--juick-server-core/src/main/java/com/juick/server/helpers/AnonymousUser.java (renamed from juick-server/src/main/java/com/juick/server/security/entities/AnonymousUser.java)2
-rw-r--r--juick-server-core/src/main/java/com/juick/server/helpers/ApplicationStatus.java (renamed from juick-server/src/main/java/com/juick/server/helpers/ApplicationStatus.java)0
-rw-r--r--juick-server-core/src/main/java/com/juick/server/helpers/Auth.java (renamed from juick-server/src/main/java/com/juick/server/helpers/Auth.java)0
-rw-r--r--juick-server-core/src/main/java/com/juick/server/helpers/EmailOpts.java (renamed from juick-server/src/main/java/com/juick/server/helpers/EmailOpts.java)0
-rw-r--r--juick-server-core/src/main/java/com/juick/server/helpers/NotifyOpts.java (renamed from juick-server/src/main/java/com/juick/server/helpers/NotifyOpts.java)0
-rw-r--r--juick-server-core/src/main/java/com/juick/server/helpers/PrivacyOpts.java (renamed from juick-server/src/main/java/com/juick/server/helpers/PrivacyOpts.java)0
-rw-r--r--juick-server-core/src/main/java/com/juick/server/helpers/PrivateChats.java (renamed from juick-server/src/main/java/com/juick/server/helpers/PrivateChats.java)0
-rw-r--r--juick-server-core/src/main/java/com/juick/server/helpers/ResponseReply.java (renamed from juick-server/src/main/java/com/juick/server/helpers/ResponseReply.java)0
-rw-r--r--juick-server-core/src/main/java/com/juick/server/helpers/TagStats.java (renamed from juick-server/src/main/java/com/juick/server/helpers/TagStats.java)0
-rw-r--r--juick-server-core/src/main/java/com/juick/server/helpers/UserInfo.java (renamed from juick-server/src/main/java/com/juick/server/helpers/UserInfo.java)0
-rw-r--r--juick-server-core/src/main/java/com/juick/server/protocol/JuickProtocol.java (renamed from juick-server/src/main/java/com/juick/server/protocol/JuickProtocol.java)2
-rw-r--r--juick-server-core/src/main/java/com/juick/server/protocol/ProtocolListener.java (renamed from juick-server/src/main/java/com/juick/server/protocol/ProtocolListener.java)0
-rw-r--r--juick-server-core/src/main/java/com/juick/server/protocol/annotation/UserCommand.java (renamed from juick-server/src/main/java/com/juick/server/protocol/annotation/UserCommand.java)0
-rw-r--r--juick-server-core/src/main/java/com/juick/server/util/HashUtils.java19
-rw-r--r--juick-server-core/src/main/java/com/juick/server/util/TagUtils.java (renamed from juick-server/src/main/java/com/juick/util/TagUtils.java)2
-rw-r--r--juick-server-core/src/main/java/com/juick/service/CrosspostService.java (renamed from juick-server/src/main/java/com/juick/service/CrosspostService.java)0
-rw-r--r--juick-server-core/src/main/java/com/juick/service/EmailService.java (renamed from juick-server/src/main/java/com/juick/service/EmailService.java)0
-rw-r--r--juick-server-core/src/main/java/com/juick/service/MessagesService.java (renamed from juick-server/src/main/java/com/juick/service/MessagesService.java)2
-rw-r--r--juick-server-core/src/main/java/com/juick/service/PMQueriesService.java (renamed from juick-server/src/main/java/com/juick/service/PMQueriesService.java)0
-rw-r--r--juick-server-core/src/main/java/com/juick/service/PrivacyQueriesService.java (renamed from juick-server/src/main/java/com/juick/service/PrivacyQueriesService.java)0
-rw-r--r--juick-server-core/src/main/java/com/juick/service/PushQueriesService.java (renamed from juick-server/src/main/java/com/juick/service/PushQueriesService.java)0
-rw-r--r--juick-server-core/src/main/java/com/juick/service/ShowQueriesService.java (renamed from juick-server/src/main/java/com/juick/service/ShowQueriesService.java)0
-rw-r--r--juick-server-core/src/main/java/com/juick/service/SubscriptionService.java (renamed from juick-server/src/main/java/com/juick/service/SubscriptionService.java)0
-rw-r--r--juick-server-core/src/main/java/com/juick/service/TagService.java (renamed from juick-server/src/main/java/com/juick/service/TagService.java)0
-rw-r--r--juick-server-core/src/main/java/com/juick/service/TelegramService.java (renamed from juick-server/src/main/java/com/juick/service/TelegramService.java)0
-rw-r--r--juick-server-core/src/main/java/com/juick/service/UserService.java (renamed from juick-server/src/main/java/com/juick/service/UserService.java)0
-rw-r--r--juick-server-core/src/main/java/com/juick/service/search/SearchService.java (renamed from juick-server/src/main/java/com/juick/service/search/SearchService.java)0
-rw-r--r--juick-server-core/src/main/resources/juick.conf.example (renamed from juick-server/src/main/resources/juick.conf.example)0
-rw-r--r--juick-server-core/src/main/resources/logback.xml.example (renamed from juick-server/src/main/resources/logback.xml.example)0
-rw-r--r--juick-server-core/src/main/resources/schema.sql (renamed from juick-server/src/main/resources/schema.sql)0
-rw-r--r--juick-server-core/src/main/resources/update.sql (renamed from juick-server/src/main/resources/update.sql)0
-rw-r--r--juick-server-jdbc/build.gradle (renamed from juick-server/build.gradle)2
-rw-r--r--juick-server-jdbc/src/main/java/com/juick/configuration/DataConfiguration.java (renamed from juick-server/src/main/java/com/juick/configuration/DataConfiguration.java)1
-rw-r--r--juick-server-jdbc/src/main/java/com/juick/configuration/SearchConfiguration.java (renamed from juick-server/src/main/java/com/juick/configuration/SearchConfiguration.java)0
-rw-r--r--juick-server-jdbc/src/main/java/com/juick/configuration/UpdaterConfiguration.java (renamed from juick-server/src/main/java/com/juick/configuration/UpdaterConfiguration.java)0
-rw-r--r--juick-server-jdbc/src/main/java/com/juick/database/MySqlUpdater.java (renamed from juick-server/src/main/java/com/juick/database/MySqlUpdater.java)0
-rw-r--r--juick-server-jdbc/src/main/java/com/juick/service/BaseJdbcService.java (renamed from juick-server/src/main/java/com/juick/service/BaseJdbcService.java)0
-rw-r--r--juick-server-jdbc/src/main/java/com/juick/service/CrosspostServiceImpl.java (renamed from juick-server/src/main/java/com/juick/service/CrosspostServiceImpl.java)0
-rw-r--r--juick-server-jdbc/src/main/java/com/juick/service/EmailServiceImpl.java (renamed from juick-server/src/main/java/com/juick/service/EmailServiceImpl.java)0
-rw-r--r--juick-server-jdbc/src/main/java/com/juick/service/MessagesServiceImpl.java (renamed from juick-server/src/main/java/com/juick/service/MessagesServiceImpl.java)0
-rw-r--r--juick-server-jdbc/src/main/java/com/juick/service/PMQueriesServiceImpl.java (renamed from juick-server/src/main/java/com/juick/service/PMQueriesServiceImpl.java)0
-rw-r--r--juick-server-jdbc/src/main/java/com/juick/service/PrivacyQueriesServiceImpl.java (renamed from juick-server/src/main/java/com/juick/service/PrivacyQueriesServiceImpl.java)0
-rw-r--r--juick-server-jdbc/src/main/java/com/juick/service/PushQueriesServiceImpl.java (renamed from juick-server/src/main/java/com/juick/service/PushQueriesServiceImpl.java)0
-rw-r--r--juick-server-jdbc/src/main/java/com/juick/service/ShowQueriesServiceImpl.java (renamed from juick-server/src/main/java/com/juick/service/ShowQueriesServiceImpl.java)0
-rw-r--r--juick-server-jdbc/src/main/java/com/juick/service/SubscriptionServiceImpl.java (renamed from juick-server/src/main/java/com/juick/service/SubscriptionServiceImpl.java)0
-rw-r--r--juick-server-jdbc/src/main/java/com/juick/service/TagServiceImpl.java (renamed from juick-server/src/main/java/com/juick/service/TagServiceImpl.java)0
-rw-r--r--juick-server-jdbc/src/main/java/com/juick/service/TelegramServiceImpl.java (renamed from juick-server/src/main/java/com/juick/service/TelegramServiceImpl.java)0
-rw-r--r--juick-server-jdbc/src/main/java/com/juick/service/UserServiceImpl.java (renamed from juick-server/src/main/java/com/juick/service/UserServiceImpl.java)6
-rw-r--r--juick-server-jdbc/src/main/java/com/juick/service/search/SphinxSearchServiceImpl.java (renamed from juick-server/src/main/java/com/juick/service/search/SphinxSearchServiceImpl.java)0
-rw-r--r--juick-server-jdbc/src/main/java/rocks/xmpp/core/session/debug/LogbackDebugger.java (renamed from juick-server/src/main/java/rocks/xmpp/core/session/debug/LogbackDebugger.java)0
-rw-r--r--juick-server-jdbc/src/test/java/com/juick/configuration/MockDataConfiguration.java (renamed from juick-server/src/test/java/com/juick/configuration/MockDataConfiguration.java)0
-rw-r--r--juick-server-jdbc/src/test/java/com/juick/configuration/RepositoryConfiguration.java (renamed from juick-server/src/test/java/com/juick/configuration/RepositoryConfiguration.java)0
-rw-r--r--juick-server-jdbc/src/test/java/com/juick/service/MessageServiceTest.java (renamed from juick-server/src/test/java/com/juick/service/MessageServiceTest.java)0
-rw-r--r--juick-server-jdbc/src/test/java/com/juick/tests/util/MockUtils.java (renamed from juick-server/src/test/java/com/juick/tests/util/MockUtils.java)0
-rw-r--r--juick-server-web/build.gradle76
-rw-r--r--juick-server-web/src/main/java/com/juick/server/util/HttpBadRequestException.java (renamed from juick-server/src/main/java/com/juick/server/util/HttpBadRequestException.java)0
-rw-r--r--juick-server-web/src/main/java/com/juick/server/util/HttpForbiddenException.java (renamed from juick-server/src/main/java/com/juick/server/util/HttpForbiddenException.java)0
-rw-r--r--juick-server-web/src/main/java/com/juick/server/util/HttpNotFoundException.java (renamed from juick-server/src/main/java/com/juick/server/util/HttpNotFoundException.java)0
-rw-r--r--juick-server-web/src/main/java/com/juick/server/util/HttpUtils.java (renamed from juick-server/src/main/java/com/juick/server/util/HttpUtils.java)0
-rw-r--r--juick-server-web/src/main/java/com/juick/server/util/ImageUtils.java (renamed from juick-server/src/main/java/com/juick/server/util/ImageUtils.java)0
-rw-r--r--juick-server-web/src/main/java/com/juick/server/util/UserUtils.java (renamed from juick-server/src/main/java/com/juick/util/UserUtils.java)19
-rw-r--r--juick-server-web/src/main/java/com/juick/server/util/WebUtils.java (renamed from juick-server/src/main/java/com/juick/util/WebUtils.java)2
-rw-r--r--juick-server-web/src/main/java/com/juick/service/BaseRestService.java (renamed from juick-notifications/src/main/java/com/juick/components/service/BaseRestService.java)2
-rw-r--r--juick-server-web/src/main/java/com/juick/service/security/HashParamAuthenticationFilter.java (renamed from juick-server/src/main/java/com/juick/server/security/HashParamAuthenticationFilter.java)4
-rw-r--r--juick-server-web/src/main/java/com/juick/service/security/JuickUserDetailsService.java (renamed from juick-server/src/main/java/com/juick/service/security/JuickUserDetailsService.java)2
-rw-r--r--juick-server-web/src/main/java/com/juick/service/security/NotAuthorizedAuthenticationEntryPoint.java (renamed from juick-server/src/main/java/com/juick/server/security/NotAuthorizedAuthenticationEntryPoint.java)2
-rw-r--r--juick-server-web/src/main/java/com/juick/service/security/NullUserDetailsService.java (renamed from juick-server/src/main/java/com/juick/service/security/NullUserDetailsService.java)0
-rw-r--r--juick-server-web/src/main/java/com/juick/service/security/deprecated/CookieSimpleHashRememberMeServices.java (renamed from juick-server/src/main/java/com/juick/service/security/deprecated/CookieSimpleHashRememberMeServices.java)6
-rw-r--r--juick-server-web/src/main/java/com/juick/service/security/deprecated/RequestParamHashRememberMeServices.java (renamed from juick-server/src/main/java/com/juick/service/security/deprecated/RequestParamHashRememberMeServices.java)2
-rw-r--r--juick-server-web/src/main/java/com/juick/service/security/entities/JuickUser.java (renamed from juick-server/src/main/java/com/juick/server/security/entities/JuickUser.java)3
-rw-r--r--juick-ws/build.gradle2
-rw-r--r--juick-www/build.gradle5
-rw-r--r--juick-www/src/main/java/com/juick/www/configuration/WebSecurityConfig.java4
-rw-r--r--juick-www/src/main/java/com/juick/www/controllers/Help.java2
-rw-r--r--juick-www/src/main/java/com/juick/www/controllers/Home.java4
-rw-r--r--juick-www/src/main/java/com/juick/www/controllers/Login.java2
-rw-r--r--juick-www/src/main/java/com/juick/www/controllers/NewMessage.java2
-rw-r--r--juick-www/src/main/java/com/juick/www/controllers/PM.java5
-rw-r--r--juick-www/src/main/java/com/juick/www/controllers/Settings.java7
-rw-r--r--juick-www/src/main/java/com/juick/www/controllers/SignUp.java2
-rw-r--r--juick-www/src/main/java/com/juick/www/controllers/Tags.java2
-rw-r--r--juick-www/src/main/java/com/juick/www/controllers/User.java2
-rw-r--r--juick-www/src/main/java/com/juick/www/controllers/UserThread.java2
-rw-r--r--juick-www/src/main/java/com/juick/www/controllers/XMPPPost.java2
-rw-r--r--juick-xmpp-bot/build.gradle2
-rw-r--r--juick-xmpp/build.gradle2
-rw-r--r--settings.gradle2
102 files changed, 222 insertions, 81 deletions
diff --git a/juick-api/build.gradle b/juick-api/build.gradle
index bcf4bd25..b85bb4fc 100644
--- a/juick-api/build.gradle
+++ b/juick-api/build.gradle
@@ -9,7 +9,8 @@ apply plugin: 'war'
apply plugin: 'org.akhikhl.gretty'
dependencies {
- compile project(':juick-server')
+ compile project(':juick-server-jdbc')
+ compile project(':juick-server-web')
compile "org.springframework:spring-webmvc:${rootProject.springFrameworkVersion}"
compile "org.springframework:spring-websocket:${rootProject.springFrameworkVersion}"
@@ -19,7 +20,7 @@ dependencies {
compile 'org.imgscalr:imgscalr-lib:4.2'
providedRuntime 'mysql:mysql-connector-java:5.1.40'
- testCompile project(path: ':juick-server', configuration: 'testArtifacts')
+ testCompile project(path: ':juick-server-jdbc', configuration: 'testArtifacts')
testRuntime 'org.apache.tomcat:tomcat-websocket:8.5.15'
testRuntime 'com.jayway.jsonpath:json-path:2.2.0'
diff --git a/juick-api/src/main/java/com/juick/api/configuration/ApiSecurityConfig.java b/juick-api/src/main/java/com/juick/api/configuration/ApiSecurityConfig.java
index f1dcf30a..969ebd03 100644
--- a/juick-api/src/main/java/com/juick/api/configuration/ApiSecurityConfig.java
+++ b/juick-api/src/main/java/com/juick/api/configuration/ApiSecurityConfig.java
@@ -1,6 +1,6 @@
package com.juick.api.configuration;
-import com.juick.server.security.NotAuthorizedAuthenticationEntryPoint;
+import com.juick.service.security.NotAuthorizedAuthenticationEntryPoint;
import com.juick.service.UserService;
import com.juick.service.security.JuickUserDetailsService;
import com.juick.service.security.deprecated.RequestParamHashRememberMeServices;
@@ -8,7 +8,6 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
-import org.springframework.core.env.Environment;
import org.springframework.http.HttpMethod;
import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
diff --git a/juick-api/src/main/java/com/juick/api/controllers/Messages.java b/juick-api/src/main/java/com/juick/api/controllers/Messages.java
index 76bbb5be..0d77bb74 100644
--- a/juick-api/src/main/java/com/juick/api/controllers/Messages.java
+++ b/juick-api/src/main/java/com/juick/api/controllers/Messages.java
@@ -9,7 +9,7 @@ import com.juick.server.util.HttpForbiddenException;
import com.juick.service.MessagesService;
import com.juick.service.TagService;
import com.juick.service.UserService;
-import com.juick.util.UserUtils;
+import com.juick.server.util.UserUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
diff --git a/juick-api/src/main/java/com/juick/api/controllers/Notifications.java b/juick-api/src/main/java/com/juick/api/controllers/Notifications.java
index 2f0dc335..c121efb6 100644
--- a/juick-api/src/main/java/com/juick/api/controllers/Notifications.java
+++ b/juick-api/src/main/java/com/juick/api/controllers/Notifications.java
@@ -9,7 +9,7 @@ import com.juick.server.util.HttpForbiddenException;
import com.juick.service.MessagesService;
import com.juick.service.PushQueriesService;
import com.juick.service.SubscriptionService;
-import com.juick.util.UserUtils;
+import com.juick.server.util.UserUtils;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
diff --git a/juick-api/src/main/java/com/juick/api/controllers/Others.java b/juick-api/src/main/java/com/juick/api/controllers/Others.java
index 722653a5..4f646af8 100644
--- a/juick-api/src/main/java/com/juick/api/controllers/Others.java
+++ b/juick-api/src/main/java/com/juick/api/controllers/Others.java
@@ -6,7 +6,7 @@ import com.juick.server.util.HttpForbiddenException;
import com.juick.server.util.HttpNotFoundException;
import com.juick.service.PMQueriesService;
import com.juick.service.UserService;
-import com.juick.util.UserUtils;
+import com.juick.server.util.UserUtils;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
diff --git a/juick-api/src/main/java/com/juick/api/controllers/PM.java b/juick-api/src/main/java/com/juick/api/controllers/PM.java
index 9faf05ea..f4bf2763 100644
--- a/juick-api/src/main/java/com/juick/api/controllers/PM.java
+++ b/juick-api/src/main/java/com/juick/api/controllers/PM.java
@@ -6,8 +6,8 @@ import com.juick.server.util.HttpBadRequestException;
import com.juick.server.util.HttpForbiddenException;
import com.juick.service.PMQueriesService;
import com.juick.service.UserService;
-import com.juick.util.UserUtils;
-import com.juick.util.WebUtils;
+import com.juick.server.util.UserUtils;
+import com.juick.server.util.WebUtils;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
diff --git a/juick-api/src/main/java/com/juick/api/controllers/Post.java b/juick-api/src/main/java/com/juick/api/controllers/Post.java
index cbd5ac0c..ffabe9ad 100644
--- a/juick-api/src/main/java/com/juick/api/controllers/Post.java
+++ b/juick-api/src/main/java/com/juick/api/controllers/Post.java
@@ -10,7 +10,7 @@ import com.juick.server.util.ImageUtils;
import com.juick.service.MessagesService;
import com.juick.service.SubscriptionService;
import com.juick.service.UserService;
-import com.juick.util.UserUtils;
+import com.juick.server.util.UserUtils;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
@@ -28,13 +28,10 @@ import rocks.xmpp.extensions.nick.model.Nickname;
import rocks.xmpp.extensions.oob.model.x.OobX;
import javax.inject.Inject;
-import javax.mail.MessagingException;
import javax.mail.Session;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import javax.servlet.http.HttpServletRequest;
-import java.io.BufferedInputStream;
-import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URI;
diff --git a/juick-api/src/main/java/com/juick/api/controllers/Subscriptions.java b/juick-api/src/main/java/com/juick/api/controllers/Subscriptions.java
index fcae3373..c4a214d9 100644
--- a/juick-api/src/main/java/com/juick/api/controllers/Subscriptions.java
+++ b/juick-api/src/main/java/com/juick/api/controllers/Subscriptions.java
@@ -7,7 +7,7 @@ import com.juick.server.util.HttpForbiddenException;
import com.juick.service.MessagesService;
import com.juick.service.SubscriptionService;
import com.juick.service.UserService;
-import com.juick.util.UserUtils;
+import com.juick.server.util.UserUtils;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
diff --git a/juick-api/src/main/java/com/juick/api/controllers/Tags.java b/juick-api/src/main/java/com/juick/api/controllers/Tags.java
index 7b1ce313..ab2ee7ce 100644
--- a/juick-api/src/main/java/com/juick/api/controllers/Tags.java
+++ b/juick-api/src/main/java/com/juick/api/controllers/Tags.java
@@ -4,7 +4,7 @@ import com.juick.User;
import com.juick.server.helpers.TagStats;
import com.juick.service.TagService;
import com.juick.service.UserService;
-import com.juick.util.UserUtils;
+import com.juick.server.util.UserUtils;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
diff --git a/juick-api/src/main/java/com/juick/api/controllers/Users.java b/juick-api/src/main/java/com/juick/api/controllers/Users.java
index 3805b2ef..b84f375f 100644
--- a/juick-api/src/main/java/com/juick/api/controllers/Users.java
+++ b/juick-api/src/main/java/com/juick/api/controllers/Users.java
@@ -4,8 +4,8 @@ import com.juick.User;
import com.juick.server.util.HttpForbiddenException;
import com.juick.server.util.HttpNotFoundException;
import com.juick.service.UserService;
-import com.juick.util.UserUtils;
-import com.juick.util.WebUtils;
+import com.juick.server.util.UserUtils;
+import com.juick.server.util.WebUtils;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
diff --git a/juick-crosspost/build.gradle b/juick-crosspost/build.gradle
index a0987f5b..c704cbdb 100644
--- a/juick-crosspost/build.gradle
+++ b/juick-crosspost/build.gradle
@@ -3,7 +3,7 @@ apply plugin: 'war'
apply plugin: 'org.akhikhl.gretty'
dependencies {
- compile project(':juick-server')
+ compile project(':juick-server-jdbc')
compile "org.springframework:spring-webmvc:${rootProject.springFrameworkVersion}"
compile "org.springframework:spring-websocket:${rootProject.springFrameworkVersion}"
providedRuntime 'mysql:mysql-connector-java:5.1.40'
diff --git a/juick-notifications/build.gradle b/juick-notifications/build.gradle
index 7b97f05b..9c99557d 100644
--- a/juick-notifications/build.gradle
+++ b/juick-notifications/build.gradle
@@ -3,7 +3,7 @@ apply plugin: 'war'
apply plugin: 'org.akhikhl.gretty'
dependencies {
- compile project(':juick-core')
+ compile project(':juick-server-web')
compile 'com.ganyo:gcm-server:1.1.0'
compile 'com.notnoop.apns:apns:1.0.0.Beta6'
compile "org.springframework:spring-webmvc:${rootProject.springFrameworkVersion}"
diff --git a/juick-notifications/src/main/java/com/juick/components/service/NotificationsTokenService.java b/juick-notifications/src/main/java/com/juick/components/service/NotificationsTokenService.java
index 9ea3fd3e..4dd949c3 100644
--- a/juick-notifications/src/main/java/com/juick/components/service/NotificationsTokenService.java
+++ b/juick-notifications/src/main/java/com/juick/components/service/NotificationsTokenService.java
@@ -1,6 +1,7 @@
package com.juick.components.service;
import com.juick.TokensList;
+import com.juick.service.BaseRestService;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
diff --git a/juick-rss/build.gradle b/juick-rss/build.gradle
index 61fb4ba6..3a1b82ab 100644
--- a/juick-rss/build.gradle
+++ b/juick-rss/build.gradle
@@ -3,7 +3,8 @@ apply plugin: 'war'
apply plugin: 'org.akhikhl.gretty'
dependencies {
- compile project(':juick-server')
+ compile project(':juick-server-jdbc')
+ compile project(':juick-server-web')
compile "org.springframework:spring-webmvc:${rootProject.springFrameworkVersion}"
compile 'com.rometools:rome:1.7.3'
compile 'com.rometools:rome-modules:1.7.3'
diff --git a/juick-server-core/build.gradle b/juick-server-core/build.gradle
new file mode 100644
index 00000000..b93fb533
--- /dev/null
+++ b/juick-server-core/build.gradle
@@ -0,0 +1,61 @@
+apply plugin: 'java'
+apply plugin: 'war'
+
+sourceCompatibility = 1.8
+
+dependencies {
+ compile project(':juick-core')
+
+ compile "com.fasterxml.jackson.core:jackson-core:${rootProject.jacksonVersion}"
+ compile "com.fasterxml.jackson.core:jackson-databind:${rootProject.jacksonVersion}"
+ compile "com.fasterxml.jackson.core:jackson-annotations:${rootProject.jacksonVersion}"
+ compile "com.fasterxml.jackson.datatype:jackson-datatype-jdk8:${rootProject.jacksonVersion}"
+
+ providedCompile "ch.qos.logback:logback-classic:${rootProject.logbackVersion}"
+ providedCompile "ch.qos.logback:logback-core:${rootProject.logbackVersion}"
+ providedCompile "ch.qos.logback:logback-access:${rootProject.logbackVersion}"
+
+ providedCompile "org.slf4j:slf4j-api:${rootProject.slf4jVersion}"
+ providedCompile "org.slf4j:jcl-over-slf4j:${rootProject.slf4jVersion}"
+ providedCompile "org.slf4j:log4j-over-slf4j:${rootProject.slf4jVersion}"
+ providedCompile "org.slf4j:jul-to-slf4j:${rootProject.slf4jVersion}"
+
+ compile "org.apache.httpcomponents:httpclient:4.5.3"
+ providedCompile "org.apache.commons:commons-lang3:3.6"
+ providedCompile "org.apache.commons:commons-collections4:4.1"
+ providedCompile "org.apache.commons:commons-text:1.1"
+ providedCompile "commons-io:commons-io:2.5"
+ providedCompile "commons-codec:commons-codec:1.10"
+
+ compile 'org.imgscalr:imgscalr-lib:4.2'
+
+ compile "javax.inject:javax.inject:1"
+
+ providedCompile "javax.servlet:javax.servlet-api:3.1.0"
+
+ providedRuntime "commons-fileupload:commons-fileupload:1.3.3"
+
+ testCompile "ch.vorburger.mariaDB4j:mariaDB4j:2.2.3"
+ testCompile "junit:junit:${rootProject.junitVersion}"
+ testCompile "org.hamcrest:hamcrest-all:${rootProject.hamcrestVersion}"
+ testCompile "org.mockito:mockito-core:${rootProject.mockitoVersion}"
+
+ testRuntime "mysql:mysql-connector-java:5.1.40"
+}
+
+compileJava.options.encoding = 'UTF-8'
+
+configurations {
+ all*.exclude module: 'commons-logging'
+}
+
+configurations {
+ testArtifacts.extendsFrom testRuntime
+}
+task testJar(type: Jar) {
+ classifier "test"
+ from sourceSets.test.output
+}
+artifacts {
+ testArtifacts testJar
+}
diff --git a/juick-server/src/main/java/com/juick/server/security/entities/AnonymousUser.java b/juick-server-core/src/main/java/com/juick/server/helpers/AnonymousUser.java
index 5ee9527f..1ce1c2c2 100644
--- a/juick-server/src/main/java/com/juick/server/security/entities/AnonymousUser.java
+++ b/juick-server-core/src/main/java/com/juick/server/helpers/AnonymousUser.java
@@ -1,4 +1,4 @@
-package com.juick.server.security.entities;
+package com.juick.server.helpers;
import com.juick.User;
diff --git a/juick-server/src/main/java/com/juick/server/helpers/ApplicationStatus.java b/juick-server-core/src/main/java/com/juick/server/helpers/ApplicationStatus.java
index 61109c47..61109c47 100644
--- a/juick-server/src/main/java/com/juick/server/helpers/ApplicationStatus.java
+++ b/juick-server-core/src/main/java/com/juick/server/helpers/ApplicationStatus.java
diff --git a/juick-server/src/main/java/com/juick/server/helpers/Auth.java b/juick-server-core/src/main/java/com/juick/server/helpers/Auth.java
index 3e1f0bd9..3e1f0bd9 100644
--- a/juick-server/src/main/java/com/juick/server/helpers/Auth.java
+++ b/juick-server-core/src/main/java/com/juick/server/helpers/Auth.java
diff --git a/juick-server/src/main/java/com/juick/server/helpers/EmailOpts.java b/juick-server-core/src/main/java/com/juick/server/helpers/EmailOpts.java
index 679d1a8d..679d1a8d 100644
--- a/juick-server/src/main/java/com/juick/server/helpers/EmailOpts.java
+++ b/juick-server-core/src/main/java/com/juick/server/helpers/EmailOpts.java
diff --git a/juick-server/src/main/java/com/juick/server/helpers/NotifyOpts.java b/juick-server-core/src/main/java/com/juick/server/helpers/NotifyOpts.java
index 377b0a50..377b0a50 100644
--- a/juick-server/src/main/java/com/juick/server/helpers/NotifyOpts.java
+++ b/juick-server-core/src/main/java/com/juick/server/helpers/NotifyOpts.java
diff --git a/juick-server/src/main/java/com/juick/server/helpers/PrivacyOpts.java b/juick-server-core/src/main/java/com/juick/server/helpers/PrivacyOpts.java
index 66cf9410..66cf9410 100644
--- a/juick-server/src/main/java/com/juick/server/helpers/PrivacyOpts.java
+++ b/juick-server-core/src/main/java/com/juick/server/helpers/PrivacyOpts.java
diff --git a/juick-server/src/main/java/com/juick/server/helpers/PrivateChats.java b/juick-server-core/src/main/java/com/juick/server/helpers/PrivateChats.java
index b1bfccf8..b1bfccf8 100644
--- a/juick-server/src/main/java/com/juick/server/helpers/PrivateChats.java
+++ b/juick-server-core/src/main/java/com/juick/server/helpers/PrivateChats.java
diff --git a/juick-server/src/main/java/com/juick/server/helpers/ResponseReply.java b/juick-server-core/src/main/java/com/juick/server/helpers/ResponseReply.java
index f941c743..f941c743 100644
--- a/juick-server/src/main/java/com/juick/server/helpers/ResponseReply.java
+++ b/juick-server-core/src/main/java/com/juick/server/helpers/ResponseReply.java
diff --git a/juick-server/src/main/java/com/juick/server/helpers/TagStats.java b/juick-server-core/src/main/java/com/juick/server/helpers/TagStats.java
index e8720991..e8720991 100644
--- a/juick-server/src/main/java/com/juick/server/helpers/TagStats.java
+++ b/juick-server-core/src/main/java/com/juick/server/helpers/TagStats.java
diff --git a/juick-server/src/main/java/com/juick/server/helpers/UserInfo.java b/juick-server-core/src/main/java/com/juick/server/helpers/UserInfo.java
index 5a4b6894..5a4b6894 100644
--- a/juick-server/src/main/java/com/juick/server/helpers/UserInfo.java
+++ b/juick-server-core/src/main/java/com/juick/server/helpers/UserInfo.java
diff --git a/juick-server/src/main/java/com/juick/server/protocol/JuickProtocol.java b/juick-server-core/src/main/java/com/juick/server/protocol/JuickProtocol.java
index ef8641f8..6ac05624 100644
--- a/juick-server/src/main/java/com/juick/server/protocol/JuickProtocol.java
+++ b/juick-server-core/src/main/java/com/juick/server/protocol/JuickProtocol.java
@@ -6,8 +6,8 @@ import com.juick.User;
import com.juick.formatters.PlainTextFormatter;
import com.juick.server.helpers.TagStats;
import com.juick.server.protocol.annotation.UserCommand;
+import com.juick.server.util.TagUtils;
import com.juick.service.*;
-import com.juick.util.TagUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
import org.apache.commons.lang3.reflect.MethodUtils;
diff --git a/juick-server/src/main/java/com/juick/server/protocol/ProtocolListener.java b/juick-server-core/src/main/java/com/juick/server/protocol/ProtocolListener.java
index 11231e04..11231e04 100644
--- a/juick-server/src/main/java/com/juick/server/protocol/ProtocolListener.java
+++ b/juick-server-core/src/main/java/com/juick/server/protocol/ProtocolListener.java
diff --git a/juick-server/src/main/java/com/juick/server/protocol/annotation/UserCommand.java b/juick-server-core/src/main/java/com/juick/server/protocol/annotation/UserCommand.java
index 42a9bb59..42a9bb59 100644
--- a/juick-server/src/main/java/com/juick/server/protocol/annotation/UserCommand.java
+++ b/juick-server-core/src/main/java/com/juick/server/protocol/annotation/UserCommand.java
diff --git a/juick-server-core/src/main/java/com/juick/server/util/HashUtils.java b/juick-server-core/src/main/java/com/juick/server/util/HashUtils.java
new file mode 100644
index 00000000..7e166d43
--- /dev/null
+++ b/juick-server-core/src/main/java/com/juick/server/util/HashUtils.java
@@ -0,0 +1,19 @@
+package com.juick.server.util;
+
+import java.util.Random;
+
+/**
+ * Created by vitalyster on 29.06.2017.
+ */
+public class HashUtils {
+ private static final String ABCDEF = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+
+ public static String generateHash(final int len) {
+ Random rnd = new Random();
+ StringBuilder sb = new StringBuilder(len);
+ for (int i = 0; i < len; i++) {
+ sb.append(ABCDEF.charAt(rnd.nextInt(ABCDEF.length())));
+ }
+ return sb.toString();
+ }
+}
diff --git a/juick-server/src/main/java/com/juick/util/TagUtils.java b/juick-server-core/src/main/java/com/juick/server/util/TagUtils.java
index fec59f29..1a92d6d1 100644
--- a/juick-server/src/main/java/com/juick/util/TagUtils.java
+++ b/juick-server-core/src/main/java/com/juick/server/util/TagUtils.java
@@ -1,4 +1,4 @@
-package com.juick.util;
+package com.juick.server.util;
import com.juick.Tag;
import org.apache.commons.collections4.CollectionUtils;
diff --git a/juick-server/src/main/java/com/juick/service/CrosspostService.java b/juick-server-core/src/main/java/com/juick/service/CrosspostService.java
index 467d1cbe..467d1cbe 100644
--- a/juick-server/src/main/java/com/juick/service/CrosspostService.java
+++ b/juick-server-core/src/main/java/com/juick/service/CrosspostService.java
diff --git a/juick-server/src/main/java/com/juick/service/EmailService.java b/juick-server-core/src/main/java/com/juick/service/EmailService.java
index 67925ec1..67925ec1 100644
--- a/juick-server/src/main/java/com/juick/service/EmailService.java
+++ b/juick-server-core/src/main/java/com/juick/service/EmailService.java
diff --git a/juick-server/src/main/java/com/juick/service/MessagesService.java b/juick-server-core/src/main/java/com/juick/service/MessagesService.java
index 8e9d916b..37ca5eac 100644
--- a/juick-server/src/main/java/com/juick/service/MessagesService.java
+++ b/juick-server-core/src/main/java/com/juick/service/MessagesService.java
@@ -1,9 +1,7 @@
package com.juick.service;
-import com.juick.Message;
import com.juick.User;
import com.juick.server.helpers.ResponseReply;
-import org.springframework.jdbc.core.JdbcTemplate;
import java.util.Collection;
import java.util.List;
diff --git a/juick-server/src/main/java/com/juick/service/PMQueriesService.java b/juick-server-core/src/main/java/com/juick/service/PMQueriesService.java
index e20bb3a5..e20bb3a5 100644
--- a/juick-server/src/main/java/com/juick/service/PMQueriesService.java
+++ b/juick-server-core/src/main/java/com/juick/service/PMQueriesService.java
diff --git a/juick-server/src/main/java/com/juick/service/PrivacyQueriesService.java b/juick-server-core/src/main/java/com/juick/service/PrivacyQueriesService.java
index 61eb199b..61eb199b 100644
--- a/juick-server/src/main/java/com/juick/service/PrivacyQueriesService.java
+++ b/juick-server-core/src/main/java/com/juick/service/PrivacyQueriesService.java
diff --git a/juick-server/src/main/java/com/juick/service/PushQueriesService.java b/juick-server-core/src/main/java/com/juick/service/PushQueriesService.java
index 7d4bc295..7d4bc295 100644
--- a/juick-server/src/main/java/com/juick/service/PushQueriesService.java
+++ b/juick-server-core/src/main/java/com/juick/service/PushQueriesService.java
diff --git a/juick-server/src/main/java/com/juick/service/ShowQueriesService.java b/juick-server-core/src/main/java/com/juick/service/ShowQueriesService.java
index a7e1c364..a7e1c364 100644
--- a/juick-server/src/main/java/com/juick/service/ShowQueriesService.java
+++ b/juick-server-core/src/main/java/com/juick/service/ShowQueriesService.java
diff --git a/juick-server/src/main/java/com/juick/service/SubscriptionService.java b/juick-server-core/src/main/java/com/juick/service/SubscriptionService.java
index 074c73f5..074c73f5 100644
--- a/juick-server/src/main/java/com/juick/service/SubscriptionService.java
+++ b/juick-server-core/src/main/java/com/juick/service/SubscriptionService.java
diff --git a/juick-server/src/main/java/com/juick/service/TagService.java b/juick-server-core/src/main/java/com/juick/service/TagService.java
index 2fcc7097..2fcc7097 100644
--- a/juick-server/src/main/java/com/juick/service/TagService.java
+++ b/juick-server-core/src/main/java/com/juick/service/TagService.java
diff --git a/juick-server/src/main/java/com/juick/service/TelegramService.java b/juick-server-core/src/main/java/com/juick/service/TelegramService.java
index b23e3405..b23e3405 100644
--- a/juick-server/src/main/java/com/juick/service/TelegramService.java
+++ b/juick-server-core/src/main/java/com/juick/service/TelegramService.java
diff --git a/juick-server/src/main/java/com/juick/service/UserService.java b/juick-server-core/src/main/java/com/juick/service/UserService.java
index a6db9f82..a6db9f82 100644
--- a/juick-server/src/main/java/com/juick/service/UserService.java
+++ b/juick-server-core/src/main/java/com/juick/service/UserService.java
diff --git a/juick-server/src/main/java/com/juick/service/search/SearchService.java b/juick-server-core/src/main/java/com/juick/service/search/SearchService.java
index 21deb0b1..21deb0b1 100644
--- a/juick-server/src/main/java/com/juick/service/search/SearchService.java
+++ b/juick-server-core/src/main/java/com/juick/service/search/SearchService.java
diff --git a/juick-server/src/main/resources/juick.conf.example b/juick-server-core/src/main/resources/juick.conf.example
index f89ca82b..f89ca82b 100644
--- a/juick-server/src/main/resources/juick.conf.example
+++ b/juick-server-core/src/main/resources/juick.conf.example
diff --git a/juick-server/src/main/resources/logback.xml.example b/juick-server-core/src/main/resources/logback.xml.example
index 05a3cfdf..05a3cfdf 100644
--- a/juick-server/src/main/resources/logback.xml.example
+++ b/juick-server-core/src/main/resources/logback.xml.example
diff --git a/juick-server/src/main/resources/schema.sql b/juick-server-core/src/main/resources/schema.sql
index 90bb4ed4..90bb4ed4 100644
--- a/juick-server/src/main/resources/schema.sql
+++ b/juick-server-core/src/main/resources/schema.sql
diff --git a/juick-server/src/main/resources/update.sql b/juick-server-core/src/main/resources/update.sql
index 13a62c3d..13a62c3d 100644
--- a/juick-server/src/main/resources/update.sql
+++ b/juick-server-core/src/main/resources/update.sql
diff --git a/juick-server/build.gradle b/juick-server-jdbc/build.gradle
index 30e31541..fde15afe 100644
--- a/juick-server/build.gradle
+++ b/juick-server-jdbc/build.gradle
@@ -4,7 +4,7 @@ apply plugin: 'war'
sourceCompatibility = 1.8
dependencies {
- compile project(':juick-core')
+ compile project(':juick-server-core')
compile "com.fasterxml.jackson.core:jackson-core:${rootProject.jacksonVersion}"
compile "com.fasterxml.jackson.core:jackson-databind:${rootProject.jacksonVersion}"
diff --git a/juick-server/src/main/java/com/juick/configuration/DataConfiguration.java b/juick-server-jdbc/src/main/java/com/juick/configuration/DataConfiguration.java
index 4258703d..b3c8c6bd 100644
--- a/juick-server/src/main/java/com/juick/configuration/DataConfiguration.java
+++ b/juick-server-jdbc/src/main/java/com/juick/configuration/DataConfiguration.java
@@ -1,6 +1,5 @@
package com.juick.configuration;
-import com.juick.database.MySqlUpdater;
import com.juick.service.search.SearchService;
import org.apache.commons.dbcp2.BasicDataSource;
import org.apache.commons.lang3.StringUtils;
diff --git a/juick-server/src/main/java/com/juick/configuration/SearchConfiguration.java b/juick-server-jdbc/src/main/java/com/juick/configuration/SearchConfiguration.java
index e6b446b6..e6b446b6 100644
--- a/juick-server/src/main/java/com/juick/configuration/SearchConfiguration.java
+++ b/juick-server-jdbc/src/main/java/com/juick/configuration/SearchConfiguration.java
diff --git a/juick-server/src/main/java/com/juick/configuration/UpdaterConfiguration.java b/juick-server-jdbc/src/main/java/com/juick/configuration/UpdaterConfiguration.java
index b3c0424c..b3c0424c 100644
--- a/juick-server/src/main/java/com/juick/configuration/UpdaterConfiguration.java
+++ b/juick-server-jdbc/src/main/java/com/juick/configuration/UpdaterConfiguration.java
diff --git a/juick-server/src/main/java/com/juick/database/MySqlUpdater.java b/juick-server-jdbc/src/main/java/com/juick/database/MySqlUpdater.java
index 2027d9f1..2027d9f1 100644
--- a/juick-server/src/main/java/com/juick/database/MySqlUpdater.java
+++ b/juick-server-jdbc/src/main/java/com/juick/database/MySqlUpdater.java
diff --git a/juick-server/src/main/java/com/juick/service/BaseJdbcService.java b/juick-server-jdbc/src/main/java/com/juick/service/BaseJdbcService.java
index e3784345..e3784345 100644
--- a/juick-server/src/main/java/com/juick/service/BaseJdbcService.java
+++ b/juick-server-jdbc/src/main/java/com/juick/service/BaseJdbcService.java
diff --git a/juick-server/src/main/java/com/juick/service/CrosspostServiceImpl.java b/juick-server-jdbc/src/main/java/com/juick/service/CrosspostServiceImpl.java
index 965f2b51..965f2b51 100644
--- a/juick-server/src/main/java/com/juick/service/CrosspostServiceImpl.java
+++ b/juick-server-jdbc/src/main/java/com/juick/service/CrosspostServiceImpl.java
diff --git a/juick-server/src/main/java/com/juick/service/EmailServiceImpl.java b/juick-server-jdbc/src/main/java/com/juick/service/EmailServiceImpl.java
index b0bf9e20..b0bf9e20 100644
--- a/juick-server/src/main/java/com/juick/service/EmailServiceImpl.java
+++ b/juick-server-jdbc/src/main/java/com/juick/service/EmailServiceImpl.java
diff --git a/juick-server/src/main/java/com/juick/service/MessagesServiceImpl.java b/juick-server-jdbc/src/main/java/com/juick/service/MessagesServiceImpl.java
index 318b5805..318b5805 100644
--- a/juick-server/src/main/java/com/juick/service/MessagesServiceImpl.java
+++ b/juick-server-jdbc/src/main/java/com/juick/service/MessagesServiceImpl.java
diff --git a/juick-server/src/main/java/com/juick/service/PMQueriesServiceImpl.java b/juick-server-jdbc/src/main/java/com/juick/service/PMQueriesServiceImpl.java
index e6a8617d..e6a8617d 100644
--- a/juick-server/src/main/java/com/juick/service/PMQueriesServiceImpl.java
+++ b/juick-server-jdbc/src/main/java/com/juick/service/PMQueriesServiceImpl.java
diff --git a/juick-server/src/main/java/com/juick/service/PrivacyQueriesServiceImpl.java b/juick-server-jdbc/src/main/java/com/juick/service/PrivacyQueriesServiceImpl.java
index 4f19c70f..4f19c70f 100644
--- a/juick-server/src/main/java/com/juick/service/PrivacyQueriesServiceImpl.java
+++ b/juick-server-jdbc/src/main/java/com/juick/service/PrivacyQueriesServiceImpl.java
diff --git a/juick-server/src/main/java/com/juick/service/PushQueriesServiceImpl.java b/juick-server-jdbc/src/main/java/com/juick/service/PushQueriesServiceImpl.java
index 73f98abf..73f98abf 100644
--- a/juick-server/src/main/java/com/juick/service/PushQueriesServiceImpl.java
+++ b/juick-server-jdbc/src/main/java/com/juick/service/PushQueriesServiceImpl.java
diff --git a/juick-server/src/main/java/com/juick/service/ShowQueriesServiceImpl.java b/juick-server-jdbc/src/main/java/com/juick/service/ShowQueriesServiceImpl.java
index 2362e948..2362e948 100644
--- a/juick-server/src/main/java/com/juick/service/ShowQueriesServiceImpl.java
+++ b/juick-server-jdbc/src/main/java/com/juick/service/ShowQueriesServiceImpl.java
diff --git a/juick-server/src/main/java/com/juick/service/SubscriptionServiceImpl.java b/juick-server-jdbc/src/main/java/com/juick/service/SubscriptionServiceImpl.java
index d1eef338..d1eef338 100644
--- a/juick-server/src/main/java/com/juick/service/SubscriptionServiceImpl.java
+++ b/juick-server-jdbc/src/main/java/com/juick/service/SubscriptionServiceImpl.java
diff --git a/juick-server/src/main/java/com/juick/service/TagServiceImpl.java b/juick-server-jdbc/src/main/java/com/juick/service/TagServiceImpl.java
index b5bd0ae8..b5bd0ae8 100644
--- a/juick-server/src/main/java/com/juick/service/TagServiceImpl.java
+++ b/juick-server-jdbc/src/main/java/com/juick/service/TagServiceImpl.java
diff --git a/juick-server/src/main/java/com/juick/service/TelegramServiceImpl.java b/juick-server-jdbc/src/main/java/com/juick/service/TelegramServiceImpl.java
index a698e2e8..a698e2e8 100644
--- a/juick-server/src/main/java/com/juick/service/TelegramServiceImpl.java
+++ b/juick-server-jdbc/src/main/java/com/juick/service/TelegramServiceImpl.java
diff --git a/juick-server/src/main/java/com/juick/service/UserServiceImpl.java b/juick-server-jdbc/src/main/java/com/juick/service/UserServiceImpl.java
index 6a3bb40c..4013be59 100644
--- a/juick-server/src/main/java/com/juick/service/UserServiceImpl.java
+++ b/juick-server-jdbc/src/main/java/com/juick/service/UserServiceImpl.java
@@ -1,11 +1,11 @@
package com.juick.service;
import com.juick.User;
+import com.juick.server.helpers.AnonymousUser;
import com.juick.server.helpers.Auth;
import com.juick.server.helpers.EmailOpts;
import com.juick.server.helpers.UserInfo;
-import com.juick.server.security.entities.AnonymousUser;
-import com.juick.util.UserUtils;
+import com.juick.server.util.HashUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.dao.DuplicateKeyException;
@@ -310,7 +310,7 @@ public class UserServiceImpl extends BaseJdbcService implements UserService {
"SELECT hash FROM logins WHERE user_id = ?", String.class, uid);
if (list.isEmpty()) {
- String hash = UserUtils.generateHash(16);
+ String hash = HashUtils.generateHash(16);
getJdbcTemplate().update("INSERT INTO logins(user_id, hash) VALUES (?, ?)", uid, hash);
return hash;
}
diff --git a/juick-server/src/main/java/com/juick/service/search/SphinxSearchServiceImpl.java b/juick-server-jdbc/src/main/java/com/juick/service/search/SphinxSearchServiceImpl.java
index aa903545..aa903545 100644
--- a/juick-server/src/main/java/com/juick/service/search/SphinxSearchServiceImpl.java
+++ b/juick-server-jdbc/src/main/java/com/juick/service/search/SphinxSearchServiceImpl.java
diff --git a/juick-server/src/main/java/rocks/xmpp/core/session/debug/LogbackDebugger.java b/juick-server-jdbc/src/main/java/rocks/xmpp/core/session/debug/LogbackDebugger.java
index 3da660b2..3da660b2 100644
--- a/juick-server/src/main/java/rocks/xmpp/core/session/debug/LogbackDebugger.java
+++ b/juick-server-jdbc/src/main/java/rocks/xmpp/core/session/debug/LogbackDebugger.java
diff --git a/juick-server/src/test/java/com/juick/configuration/MockDataConfiguration.java b/juick-server-jdbc/src/test/java/com/juick/configuration/MockDataConfiguration.java
index bd2f3f50..bd2f3f50 100644
--- a/juick-server/src/test/java/com/juick/configuration/MockDataConfiguration.java
+++ b/juick-server-jdbc/src/test/java/com/juick/configuration/MockDataConfiguration.java
diff --git a/juick-server/src/test/java/com/juick/configuration/RepositoryConfiguration.java b/juick-server-jdbc/src/test/java/com/juick/configuration/RepositoryConfiguration.java
index 4a74349f..4a74349f 100644
--- a/juick-server/src/test/java/com/juick/configuration/RepositoryConfiguration.java
+++ b/juick-server-jdbc/src/test/java/com/juick/configuration/RepositoryConfiguration.java
diff --git a/juick-server/src/test/java/com/juick/service/MessageServiceTest.java b/juick-server-jdbc/src/test/java/com/juick/service/MessageServiceTest.java
index 5f2c2b05..5f2c2b05 100644
--- a/juick-server/src/test/java/com/juick/service/MessageServiceTest.java
+++ b/juick-server-jdbc/src/test/java/com/juick/service/MessageServiceTest.java
diff --git a/juick-server/src/test/java/com/juick/tests/util/MockUtils.java b/juick-server-jdbc/src/test/java/com/juick/tests/util/MockUtils.java
index 5344dd23..5344dd23 100644
--- a/juick-server/src/test/java/com/juick/tests/util/MockUtils.java
+++ b/juick-server-jdbc/src/test/java/com/juick/tests/util/MockUtils.java
diff --git a/juick-server-web/build.gradle b/juick-server-web/build.gradle
new file mode 100644
index 00000000..fde15afe
--- /dev/null
+++ b/juick-server-web/build.gradle
@@ -0,0 +1,76 @@
+apply plugin: 'java'
+apply plugin: 'war'
+
+sourceCompatibility = 1.8
+
+dependencies {
+ compile project(':juick-server-core')
+
+ compile "com.fasterxml.jackson.core:jackson-core:${rootProject.jacksonVersion}"
+ compile "com.fasterxml.jackson.core:jackson-databind:${rootProject.jacksonVersion}"
+ compile "com.fasterxml.jackson.core:jackson-annotations:${rootProject.jacksonVersion}"
+ compile "com.fasterxml.jackson.datatype:jackson-datatype-jdk8:${rootProject.jacksonVersion}"
+
+ providedCompile "ch.qos.logback:logback-classic:${rootProject.logbackVersion}"
+ providedCompile "ch.qos.logback:logback-core:${rootProject.logbackVersion}"
+ providedCompile "ch.qos.logback:logback-access:${rootProject.logbackVersion}"
+
+ providedCompile "org.slf4j:slf4j-api:${rootProject.slf4jVersion}"
+ providedCompile "org.slf4j:jcl-over-slf4j:${rootProject.slf4jVersion}"
+ providedCompile "org.slf4j:log4j-over-slf4j:${rootProject.slf4jVersion}"
+ providedCompile "org.slf4j:jul-to-slf4j:${rootProject.slf4jVersion}"
+
+ compile "org.apache.httpcomponents:httpclient:4.5.3"
+ providedCompile "org.apache.commons:commons-lang3:3.6"
+ providedCompile "org.apache.commons:commons-collections4:4.1"
+ providedCompile "org.apache.commons:commons-text:1.1"
+ providedCompile "commons-io:commons-io:2.5"
+ providedCompile "commons-codec:commons-codec:1.10"
+
+ compile 'com.github.ben-manes.caffeine:caffeine:2.5.2'
+
+ compile "org.springframework:spring-context:${rootProject.springFrameworkVersion}"
+ compile "org.springframework:spring-jdbc:${rootProject.springFrameworkVersion}"
+
+ compile "org.springframework.security:spring-security-web:${rootProject.springSecurityVersion}"
+ compile "org.springframework.security:spring-security-config:${rootProject.springSecurityVersion}"
+
+ providedCompile "org.apache.commons:commons-dbcp2:2.1.1"
+ compile "com.googlecode.log4jdbc:log4jdbc:1.2"
+ compile "javax.inject:javax.inject:1"
+
+ compile "rocks.xmpp:xmpp-core-client:0.7.4"
+ compile "rocks.xmpp:xmpp-extensions-client:0.7.4"
+
+ compile 'org.imgscalr:imgscalr-lib:4.2'
+
+ providedCompile "javax.servlet:javax.servlet-api:3.1.0"
+
+ providedRuntime "commons-fileupload:commons-fileupload:1.3.3"
+
+ testCompile "ch.vorburger.mariaDB4j:mariaDB4j:2.2.3"
+ testCompile "junit:junit:${rootProject.junitVersion}"
+ testCompile "org.hamcrest:hamcrest-all:${rootProject.hamcrestVersion}"
+ testCompile "org.mockito:mockito-core:${rootProject.mockitoVersion}"
+ testCompile "org.springframework:spring-test:${rootProject.springFrameworkVersion}"
+ testCompile "org.springframework.security:spring-security-test:${rootProject.springSecurityVersion}"
+
+ testRuntime "mysql:mysql-connector-java:5.1.40"
+}
+
+compileJava.options.encoding = 'UTF-8'
+
+configurations {
+ all*.exclude module: 'commons-logging'
+}
+
+configurations {
+ testArtifacts.extendsFrom testRuntime
+}
+task testJar(type: Jar) {
+ classifier "test"
+ from sourceSets.test.output
+}
+artifacts {
+ testArtifacts testJar
+}
diff --git a/juick-server/src/main/java/com/juick/server/util/HttpBadRequestException.java b/juick-server-web/src/main/java/com/juick/server/util/HttpBadRequestException.java
index 1ba1aecb..1ba1aecb 100644
--- a/juick-server/src/main/java/com/juick/server/util/HttpBadRequestException.java
+++ b/juick-server-web/src/main/java/com/juick/server/util/HttpBadRequestException.java
diff --git a/juick-server/src/main/java/com/juick/server/util/HttpForbiddenException.java b/juick-server-web/src/main/java/com/juick/server/util/HttpForbiddenException.java
index 733453ba..733453ba 100644
--- a/juick-server/src/main/java/com/juick/server/util/HttpForbiddenException.java
+++ b/juick-server-web/src/main/java/com/juick/server/util/HttpForbiddenException.java
diff --git a/juick-server/src/main/java/com/juick/server/util/HttpNotFoundException.java b/juick-server-web/src/main/java/com/juick/server/util/HttpNotFoundException.java
index 942d90e2..942d90e2 100644
--- a/juick-server/src/main/java/com/juick/server/util/HttpNotFoundException.java
+++ b/juick-server-web/src/main/java/com/juick/server/util/HttpNotFoundException.java
diff --git a/juick-server/src/main/java/com/juick/server/util/HttpUtils.java b/juick-server-web/src/main/java/com/juick/server/util/HttpUtils.java
index 31a68962..31a68962 100644
--- a/juick-server/src/main/java/com/juick/server/util/HttpUtils.java
+++ b/juick-server-web/src/main/java/com/juick/server/util/HttpUtils.java
diff --git a/juick-server/src/main/java/com/juick/server/util/ImageUtils.java b/juick-server-web/src/main/java/com/juick/server/util/ImageUtils.java
index 61677750..61677750 100644
--- a/juick-server/src/main/java/com/juick/server/util/ImageUtils.java
+++ b/juick-server-web/src/main/java/com/juick/server/util/ImageUtils.java
diff --git a/juick-server/src/main/java/com/juick/util/UserUtils.java b/juick-server-web/src/main/java/com/juick/server/util/UserUtils.java
index 3d78b5b5..eb86370e 100644
--- a/juick-server/src/main/java/com/juick/util/UserUtils.java
+++ b/juick-server-web/src/main/java/com/juick/server/util/UserUtils.java
@@ -1,13 +1,11 @@
-package com.juick.util;
+package com.juick.server.util;
import com.juick.User;
-import com.juick.server.security.entities.AnonymousUser;
-import com.juick.server.security.entities.JuickUser;
+import com.juick.server.helpers.AnonymousUser;
+import com.juick.service.security.entities.JuickUser;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
-import java.util.Random;
-
/**
* Created by aalexeev on 11/14/16.
*/
@@ -16,17 +14,6 @@ public class UserUtils {
throw new IllegalStateException();
}
- private static final String ABCDEF = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
-
- public static String generateHash(final int len) {
- Random rnd = new Random();
- StringBuilder sb = new StringBuilder(len);
- for (int i = 0; i < len; i++) {
- sb.append(ABCDEF.charAt(rnd.nextInt(ABCDEF.length())));
- }
- return sb.toString();
- }
-
public static Authentication getAuthentication() {
return SecurityContextHolder.getContext().getAuthentication();
}
diff --git a/juick-server/src/main/java/com/juick/util/WebUtils.java b/juick-server-web/src/main/java/com/juick/server/util/WebUtils.java
index 8e240c5d..7f50c89c 100644
--- a/juick-server/src/main/java/com/juick/util/WebUtils.java
+++ b/juick-server-web/src/main/java/com/juick/server/util/WebUtils.java
@@ -1,4 +1,4 @@
-package com.juick.util;
+package com.juick.server.util;
import java.util.regex.Pattern;
diff --git a/juick-notifications/src/main/java/com/juick/components/service/BaseRestService.java b/juick-server-web/src/main/java/com/juick/service/BaseRestService.java
index d4bc369c..4ccc3959 100644
--- a/juick-notifications/src/main/java/com/juick/components/service/BaseRestService.java
+++ b/juick-server-web/src/main/java/com/juick/service/BaseRestService.java
@@ -1,4 +1,4 @@
-package com.juick.components.service;
+package com.juick.service;
import org.springframework.web.client.RestTemplate;
diff --git a/juick-server/src/main/java/com/juick/server/security/HashParamAuthenticationFilter.java b/juick-server-web/src/main/java/com/juick/service/security/HashParamAuthenticationFilter.java
index b384a8c8..86e21d01 100644
--- a/juick-server/src/main/java/com/juick/server/security/HashParamAuthenticationFilter.java
+++ b/juick-server-web/src/main/java/com/juick/service/security/HashParamAuthenticationFilter.java
@@ -1,7 +1,7 @@
-package com.juick.server.security;
+package com.juick.service.security;
import com.juick.User;
-import com.juick.server.security.entities.JuickUser;
+import com.juick.service.security.entities.JuickUser;
import com.juick.service.UserService;
import org.springframework.security.authentication.AnonymousAuthenticationToken;
import org.springframework.security.authentication.RememberMeAuthenticationToken;
diff --git a/juick-server/src/main/java/com/juick/service/security/JuickUserDetailsService.java b/juick-server-web/src/main/java/com/juick/service/security/JuickUserDetailsService.java
index 6f9ece7e..4e645ac0 100644
--- a/juick-server/src/main/java/com/juick/service/security/JuickUserDetailsService.java
+++ b/juick-server-web/src/main/java/com/juick/service/security/JuickUserDetailsService.java
@@ -1,7 +1,7 @@
package com.juick.service.security;
-import com.juick.server.security.entities.JuickUser;
import com.juick.service.UserService;
+import com.juick.service.security.entities.JuickUser;
import org.apache.commons.lang3.StringUtils;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
diff --git a/juick-server/src/main/java/com/juick/server/security/NotAuthorizedAuthenticationEntryPoint.java b/juick-server-web/src/main/java/com/juick/service/security/NotAuthorizedAuthenticationEntryPoint.java
index d9dc6d61..b456a3d0 100644
--- a/juick-server/src/main/java/com/juick/server/security/NotAuthorizedAuthenticationEntryPoint.java
+++ b/juick-server-web/src/main/java/com/juick/service/security/NotAuthorizedAuthenticationEntryPoint.java
@@ -1,4 +1,4 @@
-package com.juick.server.security;
+package com.juick.service.security;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.AuthenticationEntryPoint;
diff --git a/juick-server/src/main/java/com/juick/service/security/NullUserDetailsService.java b/juick-server-web/src/main/java/com/juick/service/security/NullUserDetailsService.java
index 49e9effc..49e9effc 100644
--- a/juick-server/src/main/java/com/juick/service/security/NullUserDetailsService.java
+++ b/juick-server-web/src/main/java/com/juick/service/security/NullUserDetailsService.java
diff --git a/juick-server/src/main/java/com/juick/service/security/deprecated/CookieSimpleHashRememberMeServices.java b/juick-server-web/src/main/java/com/juick/service/security/deprecated/CookieSimpleHashRememberMeServices.java
index 25ea645b..189877fd 100644
--- a/juick-server/src/main/java/com/juick/service/security/deprecated/CookieSimpleHashRememberMeServices.java
+++ b/juick-server-web/src/main/java/com/juick/service/security/deprecated/CookieSimpleHashRememberMeServices.java
@@ -1,10 +1,10 @@
package com.juick.service.security.deprecated;
import com.juick.User;
-import com.juick.server.security.entities.JuickUser;
+import com.juick.server.util.HashUtils;
+import com.juick.service.security.entities.JuickUser;
import com.juick.service.UserService;
import com.juick.service.security.NullUserDetailsService;
-import com.juick.util.UserUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -67,7 +67,7 @@ public class CookieSimpleHashRememberMeServices extends AbstractRememberMeServic
Assert.isTrue(uid > 0);
- String hash = UserUtils.generateHash(16);
+ String hash = HashUtils.generateHash(16);
userService.setLoginForUser(uid, hash);
diff --git a/juick-server/src/main/java/com/juick/service/security/deprecated/RequestParamHashRememberMeServices.java b/juick-server-web/src/main/java/com/juick/service/security/deprecated/RequestParamHashRememberMeServices.java
index 0e635927..4874ebcf 100644
--- a/juick-server/src/main/java/com/juick/service/security/deprecated/RequestParamHashRememberMeServices.java
+++ b/juick-server-web/src/main/java/com/juick/service/security/deprecated/RequestParamHashRememberMeServices.java
@@ -1,7 +1,7 @@
package com.juick.service.security.deprecated;
import com.juick.User;
-import com.juick.server.security.entities.JuickUser;
+import com.juick.service.security.entities.JuickUser;
import com.juick.service.UserService;
import com.juick.service.security.NullUserDetailsService;
import org.apache.commons.lang3.StringUtils;
diff --git a/juick-server/src/main/java/com/juick/server/security/entities/JuickUser.java b/juick-server-web/src/main/java/com/juick/service/security/entities/JuickUser.java
index b86d94dd..2c409a1d 100644
--- a/juick-server/src/main/java/com/juick/server/security/entities/JuickUser.java
+++ b/juick-server-web/src/main/java/com/juick/service/security/entities/JuickUser.java
@@ -1,6 +1,7 @@
-package com.juick.server.security.entities;
+package com.juick.service.security.entities;
import com.juick.User;
+import com.juick.server.helpers.AnonymousUser;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
diff --git a/juick-ws/build.gradle b/juick-ws/build.gradle
index a0987f5b..c704cbdb 100644
--- a/juick-ws/build.gradle
+++ b/juick-ws/build.gradle
@@ -3,7 +3,7 @@ apply plugin: 'war'
apply plugin: 'org.akhikhl.gretty'
dependencies {
- compile project(':juick-server')
+ compile project(':juick-server-jdbc')
compile "org.springframework:spring-webmvc:${rootProject.springFrameworkVersion}"
compile "org.springframework:spring-websocket:${rootProject.springFrameworkVersion}"
providedRuntime 'mysql:mysql-connector-java:5.1.40'
diff --git a/juick-www/build.gradle b/juick-www/build.gradle
index 5a11e9e2..4c26f754 100644
--- a/juick-www/build.gradle
+++ b/juick-www/build.gradle
@@ -18,7 +18,8 @@ apply plugin: 'war'
apply plugin: 'org.akhikhl.gretty'
dependencies {
- compile project(':juick-server')
+ compile project(':juick-server-web')
+ compile project(':juick-server-jdbc')
compile 'com.github.scribejava:scribejava-apis:4.1.1'
compile 'com.github.ooxi:serialized-php-parser:0.5.0'
compile 'com.sun.mail:javax.mail:1.5.6'
@@ -28,7 +29,7 @@ dependencies {
providedCompile 'javax.servlet:javax.servlet-api:3.1.0'
providedRuntime 'mysql:mysql-connector-java:5.1.40'
- testCompile project(path: ':juick-server', configuration: 'testArtifacts')
+ testCompile project(path: ':juick-server-jdbc', configuration: 'testArtifacts')
// htmlunit 2.25 isn't compatible with spring-test 4.3.6
testCompile ('net.sourceforge.htmlunit:htmlunit:2.24')
diff --git a/juick-www/src/main/java/com/juick/www/configuration/WebSecurityConfig.java b/juick-www/src/main/java/com/juick/www/configuration/WebSecurityConfig.java
index c6357c90..757aeb06 100644
--- a/juick-www/src/main/java/com/juick/www/configuration/WebSecurityConfig.java
+++ b/juick-www/src/main/java/com/juick/www/configuration/WebSecurityConfig.java
@@ -1,7 +1,7 @@
package com.juick.www.configuration;
-import com.juick.server.security.HashParamAuthenticationFilter;
-import com.juick.server.security.entities.JuickUser;
+import com.juick.service.security.HashParamAuthenticationFilter;
+import com.juick.service.security.entities.JuickUser;
import com.juick.service.UserService;
import com.juick.service.security.JuickUserDetailsService;
import org.springframework.beans.factory.annotation.Value;
diff --git a/juick-www/src/main/java/com/juick/www/controllers/Help.java b/juick-www/src/main/java/com/juick/www/controllers/Help.java
index 602850de..f40c3b96 100644
--- a/juick-www/src/main/java/com/juick/www/controllers/Help.java
+++ b/juick-www/src/main/java/com/juick/www/controllers/Help.java
@@ -2,7 +2,7 @@ package com.juick.www.controllers;
import com.juick.server.util.HttpNotFoundException;
import com.juick.service.MessagesService;
-import com.juick.util.UserUtils;
+import com.juick.server.util.UserUtils;
import com.juick.www.HelpService;
import com.juick.www.WebApp;
import org.springframework.stereotype.Controller;
diff --git a/juick-www/src/main/java/com/juick/www/controllers/Home.java b/juick-www/src/main/java/com/juick/www/controllers/Home.java
index ebf56b73..d42531e5 100644
--- a/juick-www/src/main/java/com/juick/www/controllers/Home.java
+++ b/juick-www/src/main/java/com/juick/www/controllers/Home.java
@@ -21,8 +21,8 @@ import com.juick.server.util.HttpNotFoundException;
import com.juick.service.MessagesService;
import com.juick.service.TagService;
import com.juick.service.UserService;
-import com.juick.util.UserUtils;
-import com.juick.util.WebUtils;
+import com.juick.server.util.UserUtils;
+import com.juick.server.util.WebUtils;
import com.juick.www.Utils;
import com.juick.www.WebApp;
import org.apache.commons.codec.CharEncoding;
diff --git a/juick-www/src/main/java/com/juick/www/controllers/Login.java b/juick-www/src/main/java/com/juick/www/controllers/Login.java
index e664c1d9..ce9572fa 100644
--- a/juick-www/src/main/java/com/juick/www/controllers/Login.java
+++ b/juick-www/src/main/java/com/juick/www/controllers/Login.java
@@ -18,7 +18,7 @@
package com.juick.www.controllers;
import com.juick.service.UserService;
-import com.juick.util.UserUtils;
+import com.juick.server.util.UserUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
diff --git a/juick-www/src/main/java/com/juick/www/controllers/NewMessage.java b/juick-www/src/main/java/com/juick/www/controllers/NewMessage.java
index 24e100ce..e34207a0 100644
--- a/juick-www/src/main/java/com/juick/www/controllers/NewMessage.java
+++ b/juick-www/src/main/java/com/juick/www/controllers/NewMessage.java
@@ -26,7 +26,7 @@ import com.juick.server.util.HttpNotFoundException;
import com.juick.server.util.HttpUtils;
import com.juick.server.util.ImageUtils;
import com.juick.service.*;
-import com.juick.util.UserUtils;
+import com.juick.server.util.UserUtils;
import com.juick.www.Utils;
import com.juick.www.WebApp;
import org.apache.commons.codec.CharEncoding;
diff --git a/juick-www/src/main/java/com/juick/www/controllers/PM.java b/juick-www/src/main/java/com/juick/www/controllers/PM.java
index 0afe5f14..7695226a 100644
--- a/juick-www/src/main/java/com/juick/www/controllers/PM.java
+++ b/juick-www/src/main/java/com/juick/www/controllers/PM.java
@@ -23,9 +23,8 @@ import com.juick.service.MessagesService;
import com.juick.service.PMQueriesService;
import com.juick.service.TagService;
import com.juick.service.UserService;
-import com.juick.util.MessageUtils;
-import com.juick.util.UserUtils;
-import com.juick.util.WebUtils;
+import com.juick.server.util.UserUtils;
+import com.juick.server.util.WebUtils;
import com.juick.www.WebApp;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
diff --git a/juick-www/src/main/java/com/juick/www/controllers/Settings.java b/juick-www/src/main/java/com/juick/www/controllers/Settings.java
index 6fa3fd2e..21df9d6e 100644
--- a/juick-www/src/main/java/com/juick/www/controllers/Settings.java
+++ b/juick-www/src/main/java/com/juick/www/controllers/Settings.java
@@ -19,11 +19,12 @@ package com.juick.www.controllers;
import com.juick.server.helpers.NotifyOpts;
import com.juick.server.helpers.UserInfo;
+import com.juick.server.util.HashUtils;
+import com.juick.service.*;
import com.juick.server.util.HttpBadRequestException;
import com.juick.server.util.HttpUtils;
import com.juick.server.util.ImageUtils;
-import com.juick.service.*;
-import com.juick.util.UserUtils;
+import com.juick.server.util.UserUtils;
import com.juick.www.WebApp;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
@@ -183,7 +184,7 @@ public class Settings {
break;
case "email-add":
if (!emailService.verifyAddressByCode(visitor.getUid(), request.getParameter("account"))) {
- String authCode = UserUtils.generateHash(8);
+ String authCode = HashUtils.generateHash(8);
if (emailService.addVerificationCode(visitor.getUid(), request.getParameter("account"), authCode)) {
Session session = Session.getDefaultInstance(System.getProperties());
try {
diff --git a/juick-www/src/main/java/com/juick/www/controllers/SignUp.java b/juick-www/src/main/java/com/juick/www/controllers/SignUp.java
index 77971165..cfbd9ca2 100644
--- a/juick-www/src/main/java/com/juick/www/controllers/SignUp.java
+++ b/juick-www/src/main/java/com/juick/www/controllers/SignUp.java
@@ -22,7 +22,7 @@ import com.juick.server.util.HttpForbiddenException;
import com.juick.service.CrosspostService;
import com.juick.service.MessagesService;
import com.juick.service.UserService;
-import com.juick.util.UserUtils;
+import com.juick.server.util.UserUtils;
import com.juick.www.WebApp;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
diff --git a/juick-www/src/main/java/com/juick/www/controllers/Tags.java b/juick-www/src/main/java/com/juick/www/controllers/Tags.java
index c3ef5153..16f71959 100644
--- a/juick-www/src/main/java/com/juick/www/controllers/Tags.java
+++ b/juick-www/src/main/java/com/juick/www/controllers/Tags.java
@@ -19,7 +19,7 @@ package com.juick.www.controllers;
import com.juick.service.MessagesService;
import com.juick.service.TagService;
-import com.juick.util.UserUtils;
+import com.juick.server.util.UserUtils;
import com.juick.www.Utils;
import com.juick.www.WebApp;
import org.apache.commons.codec.CharEncoding;
diff --git a/juick-www/src/main/java/com/juick/www/controllers/User.java b/juick-www/src/main/java/com/juick/www/controllers/User.java
index a249d8d0..8bde9bee 100644
--- a/juick-www/src/main/java/com/juick/www/controllers/User.java
+++ b/juick-www/src/main/java/com/juick/www/controllers/User.java
@@ -22,7 +22,7 @@ import com.juick.server.util.HttpNotFoundException;
import com.juick.service.MessagesService;
import com.juick.service.TagService;
import com.juick.service.UserService;
-import com.juick.util.UserUtils;
+import com.juick.server.util.UserUtils;
import com.juick.www.Utils;
import com.juick.www.WebApp;
import org.apache.commons.codec.CharEncoding;
diff --git a/juick-www/src/main/java/com/juick/www/controllers/UserThread.java b/juick-www/src/main/java/com/juick/www/controllers/UserThread.java
index 1d854b8f..cc476309 100644
--- a/juick-www/src/main/java/com/juick/www/controllers/UserThread.java
+++ b/juick-www/src/main/java/com/juick/www/controllers/UserThread.java
@@ -24,7 +24,7 @@ import com.juick.service.MessagesService;
import com.juick.service.TagService;
import com.juick.service.UserService;
import com.juick.util.MessageUtils;
-import com.juick.util.UserUtils;
+import com.juick.server.util.UserUtils;
import com.juick.www.WebApp;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
diff --git a/juick-www/src/main/java/com/juick/www/controllers/XMPPPost.java b/juick-www/src/main/java/com/juick/www/controllers/XMPPPost.java
index 45fff7ce..8436fd14 100644
--- a/juick-www/src/main/java/com/juick/www/controllers/XMPPPost.java
+++ b/juick-www/src/main/java/com/juick/www/controllers/XMPPPost.java
@@ -4,7 +4,7 @@ import com.juick.server.util.HttpBadRequestException;
import com.juick.server.util.HttpForbiddenException;
import com.juick.server.util.HttpUtils;
import com.juick.service.TagService;
-import com.juick.util.UserUtils;
+import com.juick.server.util.UserUtils;
import com.juick.www.WebApp;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
diff --git a/juick-xmpp-bot/build.gradle b/juick-xmpp-bot/build.gradle
index bc6dce3c..25199b05 100644
--- a/juick-xmpp-bot/build.gradle
+++ b/juick-xmpp-bot/build.gradle
@@ -3,7 +3,7 @@ apply plugin: 'war'
apply plugin: 'org.akhikhl.gretty'
dependencies {
- compile project(':juick-server')
+ compile project(':juick-server-jdbc')
compile "org.springframework:spring-webmvc:${rootProject.springFrameworkVersion}"
providedRuntime 'mysql:mysql-connector-java:5.1.40'
}
diff --git a/juick-xmpp/build.gradle b/juick-xmpp/build.gradle
index 1758e97e..cd0e6ec2 100644
--- a/juick-xmpp/build.gradle
+++ b/juick-xmpp/build.gradle
@@ -3,7 +3,7 @@ apply plugin: 'war'
apply plugin: 'org.akhikhl.gretty'
dependencies {
- compile project(':juick-server')
+ compile project(':juick-server-jdbc')
compile 'com.github.juick:com.juick.xmpp:483936e0bd'
compile "org.slf4j:slf4j-api:${rootProject.slf4jVersion}"
compile "org.springframework:spring-webmvc:${rootProject.springFrameworkVersion}"
diff --git a/settings.gradle b/settings.gradle
index 43dd810f..3ba77cfb 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1,4 +1,4 @@
rootProject.name = "Juick"
-include ':juick-core', 'juick-server', ':juick-api', ':juick-www', ':juick-rss', ':juick-ws', ':juick-notifications', ':juick-crosspost', ':juick-xmpp', ':juick-xmpp-bot'
+include ':juick-core', ':juick-server-core', ':juick-server-jdbc', ':juick-server-web', ':juick-api', ':juick-www', ':juick-rss', ':juick-ws', ':juick-notifications', ':juick-crosspost', ':juick-xmpp', ':juick-xmpp-bot'