diff options
author | James Moger <james.moger@gitblit.com> | 2013-11-21 18:32:21 -0500 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2013-11-29 11:05:51 -0500 |
commit | 7bf6e183ff8abd0c35eeb29f399da12389562ecb (patch) | |
tree | c06c5176d7d44ec6f4bcd7b79d34519266f49490 /src/main/java/com | |
parent | 269c5043ab8f66f67d5719ac5149a436ca1baa2b (diff) | |
download | gitblit-7bf6e183ff8abd0c35eeb29f399da12389562ecb.tar.gz gitblit-7bf6e183ff8abd0c35eeb29f399da12389562ecb.zip |
Moved servlets and services to separate packages
Change-Id: I5f0f50f4ae7d332e9f724a2e6f074fa71f646035
Diffstat (limited to 'src/main/java/com')
41 files changed, 170 insertions, 82 deletions
diff --git a/src/main/java/com/gitblit/Constants.java b/src/main/java/com/gitblit/Constants.java index 1451ccf1..43c60a39 100644 --- a/src/main/java/com/gitblit/Constants.java +++ b/src/main/java/com/gitblit/Constants.java @@ -395,7 +395,7 @@ public class Constants { public static enum SearchObjectType {
commit, blob;
- static SearchObjectType fromName(String name) {
+ public static SearchObjectType fromName(String name) {
for (SearchObjectType value : values()) {
if (value.name().equals(name)) {
return value;
diff --git a/src/main/java/com/gitblit/DaggerModule.java b/src/main/java/com/gitblit/DaggerModule.java index 0cbb739a..1fad779f 100644 --- a/src/main/java/com/gitblit/DaggerModule.java +++ b/src/main/java/com/gitblit/DaggerModule.java @@ -38,6 +38,21 @@ import com.gitblit.manager.RuntimeManager; import com.gitblit.manager.ServicesManager; import com.gitblit.manager.SessionManager; import com.gitblit.manager.UserManager; +import com.gitblit.servlet.BranchGraphServlet; +import com.gitblit.servlet.DownloadZipFilter; +import com.gitblit.servlet.DownloadZipServlet; +import com.gitblit.servlet.EnforceAuthenticationFilter; +import com.gitblit.servlet.FederationServlet; +import com.gitblit.servlet.GitFilter; +import com.gitblit.servlet.LogoServlet; +import com.gitblit.servlet.PagesFilter; +import com.gitblit.servlet.PagesServlet; +import com.gitblit.servlet.RobotsTxtServlet; +import com.gitblit.servlet.RpcFilter; +import com.gitblit.servlet.RpcServlet; +import com.gitblit.servlet.SparkleShareInviteServlet; +import com.gitblit.servlet.SyndicationFilter; +import com.gitblit.servlet.SyndicationServlet; import com.gitblit.wicket.GitBlitWebApp; import com.gitblit.wicket.GitblitWicketFilter; diff --git a/src/main/java/com/gitblit/FederationClient.java b/src/main/java/com/gitblit/FederationClient.java index f32fa0f2..66b378ab 100644 --- a/src/main/java/com/gitblit/FederationClient.java +++ b/src/main/java/com/gitblit/FederationClient.java @@ -29,6 +29,7 @@ import com.gitblit.manager.RepositoryManager; import com.gitblit.manager.RuntimeManager;
import com.gitblit.manager.UserManager;
import com.gitblit.models.FederationModel;
+import com.gitblit.service.FederationPullService;
import com.gitblit.utils.FederationUtils;
import com.gitblit.utils.StringUtils;
@@ -95,7 +96,7 @@ public class FederationClient { RepositoryManager repositories = new RepositoryManager(runtime, users).start();
FederationManager federation = new FederationManager(runtime, notifications, users, repositories).start();
- FederationPullExecutor puller = new FederationPullExecutor(federation.getFederationRegistrations()) {
+ FederationPullService puller = new FederationPullService(federation.getFederationRegistrations()) {
@Override
public void reschedule(FederationModel registration) {
// NOOP
diff --git a/src/main/java/com/gitblit/GitBlitServer.java b/src/main/java/com/gitblit/GitBlitServer.java index fe29804d..522fb579 100644 --- a/src/main/java/com/gitblit/GitBlitServer.java +++ b/src/main/java/com/gitblit/GitBlitServer.java @@ -61,6 +61,7 @@ import com.beust.jcommander.ParameterException; import com.beust.jcommander.Parameters;
import com.gitblit.authority.GitblitAuthority;
import com.gitblit.authority.NewCertificateConfig;
+import com.gitblit.servlet.GitblitContext;
import com.gitblit.utils.StringUtils;
import com.gitblit.utils.TimeUtils;
import com.gitblit.utils.X509Utils;
@@ -410,7 +411,7 @@ public class GitBlitServer { }
// Setup the Gitblit context
- GitBlit gitblit = newGitblit(settings, baseFolder);
+ GitblitContext gitblit = newGitblit(settings, baseFolder);
rootContext.addEventListener(gitblit);
try {
@@ -429,8 +430,8 @@ public class GitBlitServer { }
}
- protected GitBlit newGitblit(IStoredSettings settings, File baseFolder) {
- return new GitBlit(settings, baseFolder);
+ protected GitblitContext newGitblit(IStoredSettings settings, File baseFolder) {
+ return new GitblitContext(settings, baseFolder);
}
/**
diff --git a/src/main/java/com/gitblit/authority/GitblitAuthority.java b/src/main/java/com/gitblit/authority/GitblitAuthority.java index 668ca982..36c016de 100644 --- a/src/main/java/com/gitblit/authority/GitblitAuthority.java +++ b/src/main/java/com/gitblit/authority/GitblitAuthority.java @@ -90,10 +90,10 @@ import com.gitblit.FileSettings; import com.gitblit.IStoredSettings;
import com.gitblit.IUserService;
import com.gitblit.Keys;
-import com.gitblit.MailExecutor;
import com.gitblit.client.HeaderPanel;
import com.gitblit.client.Translation;
import com.gitblit.models.UserModel;
+import com.gitblit.service.MailService;
import com.gitblit.utils.ArrayUtils;
import com.gitblit.utils.FileUtils;
import com.gitblit.utils.StringUtils;
@@ -131,7 +131,7 @@ public class GitblitAuthority extends JFrame implements X509Log { private TableRowSorter<UserCertificateTableModel> defaultSorter;
- private MailExecutor mail;
+ private MailService mail;
private JButton certificateDefaultsButton;
@@ -258,7 +258,7 @@ public class GitblitAuthority extends JFrame implements X509Log { return null;
}
gitblitSettings = new FileSettings(file.getAbsolutePath());
- mail = new MailExecutor(gitblitSettings);
+ mail = new MailService(gitblitSettings);
String us = gitblitSettings.getString(Keys.realm.userService, "${baseFolder}/users.conf");
String ext = us.substring(us.lastIndexOf(".") + 1).toLowerCase();
IUserService service = null;
diff --git a/src/main/java/com/gitblit/dagger/DaggerContextListener.java b/src/main/java/com/gitblit/dagger/DaggerContextListener.java index 3c268860..6a04e4a7 100644 --- a/src/main/java/com/gitblit/dagger/DaggerContextListener.java +++ b/src/main/java/com/gitblit/dagger/DaggerContextListener.java @@ -18,7 +18,7 @@ package com.gitblit.dagger; import javax.servlet.ServletContext; import javax.servlet.ServletContextEvent; -import com.gitblit.InjectionContextListener; +import com.gitblit.servlet.InjectionContextListener; import dagger.ObjectGraph; diff --git a/src/main/java/com/gitblit/manager/NotificationManager.java b/src/main/java/com/gitblit/manager/NotificationManager.java index e38e1f1f..a226d1a0 100644 --- a/src/main/java/com/gitblit/manager/NotificationManager.java +++ b/src/main/java/com/gitblit/manager/NotificationManager.java @@ -32,7 +32,7 @@ import org.slf4j.LoggerFactory; import com.gitblit.IStoredSettings; import com.gitblit.Keys; -import com.gitblit.MailExecutor; +import com.gitblit.service.MailService; /** * The notification manager dispatches notifications. Currently, email is the @@ -50,11 +50,11 @@ public class NotificationManager implements INotificationManager { private final IStoredSettings settings; - private final MailExecutor mailExecutor; + private final MailService mailExecutor; public NotificationManager(IStoredSettings settings) { this.settings = settings; - this.mailExecutor = new MailExecutor(settings); + this.mailExecutor = new MailService(settings); } @Override diff --git a/src/main/java/com/gitblit/manager/RepositoryManager.java b/src/main/java/com/gitblit/manager/RepositoryManager.java index 4845e23e..438d885c 100644 --- a/src/main/java/com/gitblit/manager/RepositoryManager.java +++ b/src/main/java/com/gitblit/manager/RepositoryManager.java @@ -63,12 +63,9 @@ import com.gitblit.Constants.CommitMessageRenderer; import com.gitblit.Constants.FederationStrategy; import com.gitblit.Constants.PermissionType; import com.gitblit.Constants.RegistrantType; -import com.gitblit.GCExecutor; import com.gitblit.GitBlitException; import com.gitblit.IStoredSettings; import com.gitblit.Keys; -import com.gitblit.LuceneExecutor; -import com.gitblit.MirrorExecutor; import com.gitblit.models.ForkModel; import com.gitblit.models.Metric; import com.gitblit.models.RefModel; @@ -77,6 +74,9 @@ import com.gitblit.models.RepositoryModel; import com.gitblit.models.SearchResult; import com.gitblit.models.TeamModel; import com.gitblit.models.UserModel; +import com.gitblit.service.GarbageCollectorService; +import com.gitblit.service.LuceneService; +import com.gitblit.service.MirrorService; import com.gitblit.utils.ArrayUtils; import com.gitblit.utils.ByteFormat; import com.gitblit.utils.CommitCache; @@ -118,11 +118,11 @@ public class RepositoryManager implements IRepositoryManager { private final File repositoriesFolder; - private LuceneExecutor luceneExecutor; + private LuceneService luceneExecutor; - private GCExecutor gcExecutor; + private GarbageCollectorService gcExecutor; - private MirrorExecutor mirrorExecutor; + private MirrorService mirrorExecutor; public RepositoryManager( IRuntimeManager runtimeManager, @@ -1644,7 +1644,7 @@ public class RepositoryManager implements IRepositoryManager { } protected void configureLuceneIndexing() { - luceneExecutor = new LuceneExecutor(settings, this); + luceneExecutor = new LuceneService(settings, this); int period = 2; scheduledExecutor.scheduleAtFixedRate(luceneExecutor, 1, period, TimeUnit.MINUTES); logger.info("Lucene will process indexed branches every {} minutes.", period); @@ -1652,7 +1652,7 @@ public class RepositoryManager implements IRepositoryManager { protected void configureGarbageCollector() { // schedule gc engine - gcExecutor = new GCExecutor(settings, this); + gcExecutor = new GarbageCollectorService(settings, this); if (gcExecutor.isReady()) { logger.info("Garbage Collector (GC) will scan repositories every 24 hours."); Calendar c = Calendar.getInstance(); @@ -1680,7 +1680,7 @@ public class RepositoryManager implements IRepositoryManager { } protected void configureMirrorExecutor() { - mirrorExecutor = new MirrorExecutor(settings, this); + mirrorExecutor = new MirrorService(settings, this); if (mirrorExecutor.isReady()) { int mins = TimeUtils.convertFrequencyToMinutes(settings.getString(Keys.git.mirrorPeriod, "30 mins")); if (mins < 5) { diff --git a/src/main/java/com/gitblit/manager/ServicesManager.java b/src/main/java/com/gitblit/manager/ServicesManager.java index 82a8a043..d04b2774 100644 --- a/src/main/java/com/gitblit/manager/ServicesManager.java +++ b/src/main/java/com/gitblit/manager/ServicesManager.java @@ -28,7 +28,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.gitblit.Constants.FederationToken; -import com.gitblit.FederationPullExecutor; import com.gitblit.Gitblit; import com.gitblit.IStoredSettings; import com.gitblit.Keys; @@ -37,6 +36,7 @@ import com.gitblit.fanout.FanoutService; import com.gitblit.fanout.FanoutSocketService; import com.gitblit.git.GitDaemon; import com.gitblit.models.FederationModel; +import com.gitblit.service.FederationPullService; import com.gitblit.utils.StringUtils; import com.gitblit.utils.TimeUtils; @@ -163,7 +163,7 @@ public class ServicesManager implements IServicesManager { } } - private class FederationPuller extends FederationPullExecutor { + private class FederationPuller extends FederationPullService { public FederationPuller(FederationModel registration) { super(Arrays.asList(registration)); diff --git a/src/main/java/com/gitblit/FederationPullExecutor.java b/src/main/java/com/gitblit/service/FederationPullService.java index bbe73cfa..91fe015b 100644 --- a/src/main/java/com/gitblit/FederationPullExecutor.java +++ b/src/main/java/com/gitblit/service/FederationPullService.java @@ -1,4 +1,4 @@ -package com.gitblit; +package com.gitblit.service; import static org.eclipse.jgit.lib.Constants.DOT_GIT_EXT; @@ -26,10 +26,15 @@ import org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import com.gitblit.ConfigUserService; +import com.gitblit.Constants; import com.gitblit.Constants.AccessPermission; import com.gitblit.Constants.FederationPullStatus; import com.gitblit.Constants.FederationStrategy; import com.gitblit.GitBlitException.ForbiddenException; +import com.gitblit.Gitblit; +import com.gitblit.IUserService; +import com.gitblit.Keys; import com.gitblit.models.FederationModel; import com.gitblit.models.RefModel; import com.gitblit.models.RepositoryModel; @@ -42,7 +47,7 @@ import com.gitblit.utils.JGitUtils; import com.gitblit.utils.JGitUtils.CloneResult; import com.gitblit.utils.StringUtils; -public abstract class FederationPullExecutor implements Runnable { +public abstract class FederationPullService implements Runnable { Logger logger = LoggerFactory.getLogger(getClass()); @@ -57,7 +62,7 @@ public abstract class FederationPullExecutor implements Runnable { * @param provider * @param registration */ - public FederationPullExecutor(FederationModel registration) { + public FederationPullService(FederationModel registration) { this(Arrays.asList(registration)); } @@ -72,14 +77,14 @@ public abstract class FederationPullExecutor implements Runnable { * if true, registrations are rescheduled in perpetuity. if * false, the federation pull operation is executed once. */ - public FederationPullExecutor(List<FederationModel> registrations) { + public FederationPullService(List<FederationModel> registrations) { this.registrations = registrations; } public abstract void reschedule(FederationModel registration); /** - * Run method for this pull executor. + * Run method for this pull service. */ @Override public void run() { diff --git a/src/main/java/com/gitblit/GCExecutor.java b/src/main/java/com/gitblit/service/GarbageCollectorService.java index 3ab98956..8dbd8d83 100644 --- a/src/main/java/com/gitblit/GCExecutor.java +++ b/src/main/java/com/gitblit/service/GarbageCollectorService.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.gitblit;
+package com.gitblit.service;
import java.lang.reflect.Field;
import java.text.MessageFormat;
@@ -31,17 +31,20 @@ import org.eclipse.jgit.lib.Repository; import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import com.gitblit.IStoredSettings;
+import com.gitblit.Keys;
+import com.gitblit.Keys.git;
import com.gitblit.manager.IRepositoryManager;
import com.gitblit.models.RepositoryModel;
import com.gitblit.utils.FileUtils;
/**
- * The GC executor handles periodic garbage collection in repositories.
+ * The Garbage Collector Service handles periodic garbage collection in repositories.
*
* @author James Moger
*
*/
-public class GCExecutor implements Runnable {
+public class GarbageCollectorService implements Runnable {
public static enum GCStatus {
READY, COLLECTING;
@@ -50,7 +53,7 @@ public class GCExecutor implements Runnable { return ordinal() > s.ordinal();
}
}
- private final Logger logger = LoggerFactory.getLogger(GCExecutor.class);
+ private final Logger logger = LoggerFactory.getLogger(GarbageCollectorService.class);
private final IStoredSettings settings;
@@ -62,7 +65,7 @@ public class GCExecutor implements Runnable { private final Map<String, GCStatus> gcCache = new ConcurrentHashMap<String, GCStatus>();
- public GCExecutor(
+ public GarbageCollectorService(
IStoredSettings settings,
IRepositoryManager repositoryManager) {
diff --git a/src/main/java/com/gitblit/LuceneExecutor.java b/src/main/java/com/gitblit/service/LuceneService.java index b7b71c5e..97fe9e1b 100644 --- a/src/main/java/com/gitblit/LuceneExecutor.java +++ b/src/main/java/com/gitblit/service/LuceneService.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.gitblit;
+package com.gitblit.service;
import static org.eclipse.jgit.treewalk.filter.TreeFilter.ANY_DIFF;
@@ -85,6 +85,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory;
import com.gitblit.Constants.SearchObjectType;
+import com.gitblit.IStoredSettings;
+import com.gitblit.Keys;
import com.gitblit.manager.IRepositoryManager;
import com.gitblit.models.PathModel.PathChangeModel;
import com.gitblit.models.RefModel;
@@ -95,12 +97,12 @@ import com.gitblit.utils.JGitUtils; import com.gitblit.utils.StringUtils;
/**
- * The Lucene executor handles indexing and searching repositories.
+ * The Lucene service handles indexing and searching repositories.
*
* @author James Moger
*
*/
-public class LuceneExecutor implements Runnable {
+public class LuceneService implements Runnable {
private static final int INDEX_VERSION = 5;
@@ -125,7 +127,7 @@ public class LuceneExecutor implements Runnable { private static final Version LUCENE_VERSION = Version.LUCENE_35;
- private final Logger logger = LoggerFactory.getLogger(LuceneExecutor.class);
+ private final Logger logger = LoggerFactory.getLogger(LuceneService.class);
private final IStoredSettings storedSettings;
private final IRepositoryManager repositoryManager;
@@ -137,7 +139,7 @@ public class LuceneExecutor implements Runnable { private final String luceneIgnoreExtensions = "7z arc arj bin bmp dll doc docx exe gif gz jar jpg lib lzh odg odf odt pdf ppt png so swf xcf xls xlsx zip";
private Set<String> excludedExtensions;
- public LuceneExecutor(
+ public LuceneService(
IStoredSettings settings,
IRepositoryManager repositoryManager) {
diff --git a/src/main/java/com/gitblit/MailExecutor.java b/src/main/java/com/gitblit/service/MailService.java index b1ba3b69..1d5e91f5 100644 --- a/src/main/java/com/gitblit/MailExecutor.java +++ b/src/main/java/com/gitblit/service/MailService.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.gitblit;
+package com.gitblit.service;
import java.util.ArrayList;
import java.util.Arrays;
@@ -37,17 +37,19 @@ import javax.mail.internet.MimeMessage; import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import com.gitblit.IStoredSettings;
+import com.gitblit.Keys;
import com.gitblit.utils.StringUtils;
/**
- * The mail executor handles sending email messages asynchronously from queue.
+ * The mail service handles sending email messages asynchronously from a queue.
*
* @author James Moger
*
*/
-public class MailExecutor implements Runnable {
+public class MailService implements Runnable {
- private final Logger logger = LoggerFactory.getLogger(MailExecutor.class);
+ private final Logger logger = LoggerFactory.getLogger(MailService.class);
private final Queue<Message> queue = new ConcurrentLinkedQueue<Message>();
@@ -55,7 +57,7 @@ public class MailExecutor implements Runnable { private final IStoredSettings settings;
- public MailExecutor(IStoredSettings settings) {
+ public MailService(IStoredSettings settings) {
this.settings = settings;
final String mailUser = settings.getString(Keys.mail.username, null);
diff --git a/src/main/java/com/gitblit/MirrorExecutor.java b/src/main/java/com/gitblit/service/MirrorService.java index 6c951b94..9833d939 100644 --- a/src/main/java/com/gitblit/MirrorExecutor.java +++ b/src/main/java/com/gitblit/service/MirrorService.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.gitblit;
+package com.gitblit.service;
import java.text.MessageFormat;
import java.util.Collection;
@@ -33,20 +33,22 @@ import org.eclipse.jgit.transport.TrackingRefUpdate; import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import com.gitblit.IStoredSettings;
+import com.gitblit.Keys;
import com.gitblit.manager.IRepositoryManager;
import com.gitblit.models.RepositoryModel;
import com.gitblit.models.UserModel;
import com.gitblit.utils.JGitUtils;
/**
- * The Mirror executor handles periodic fetching of mirrored repositories.
+ * The Mirror service handles periodic fetching of mirrored repositories.
*
* @author James Moger
*
*/
-public class MirrorExecutor implements Runnable {
+public class MirrorService implements Runnable {
- private final Logger logger = LoggerFactory.getLogger(MirrorExecutor.class);
+ private final Logger logger = LoggerFactory.getLogger(MirrorService.class);
private final Set<String> repairAttempted = Collections.synchronizedSet(new HashSet<String>());
@@ -60,7 +62,7 @@ public class MirrorExecutor implements Runnable { private final UserModel gitblitUser;
- public MirrorExecutor(
+ public MirrorService(
IStoredSettings settings,
IRepositoryManager repositoryManager) {
diff --git a/src/main/java/com/gitblit/AccessRestrictionFilter.java b/src/main/java/com/gitblit/servlet/AccessRestrictionFilter.java index 5f0baed2..d5ded33c 100644 --- a/src/main/java/com/gitblit/AccessRestrictionFilter.java +++ b/src/main/java/com/gitblit/servlet/AccessRestrictionFilter.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.gitblit;
+package com.gitblit.servlet;
import java.io.IOException;
import java.text.MessageFormat;
diff --git a/src/main/java/com/gitblit/AuthenticationFilter.java b/src/main/java/com/gitblit/servlet/AuthenticationFilter.java index 96d880f4..214f2042 100644 --- a/src/main/java/com/gitblit/AuthenticationFilter.java +++ b/src/main/java/com/gitblit/servlet/AuthenticationFilter.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.gitblit;
+package com.gitblit.servlet;
import java.io.IOException;
import java.security.Principal;
@@ -35,6 +35,7 @@ import javax.servlet.http.HttpSession; import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import com.gitblit.Constants;
import com.gitblit.manager.ISessionManager;
import com.gitblit.models.UserModel;
import com.gitblit.utils.DeepCopier;
diff --git a/src/main/java/com/gitblit/BranchGraphServlet.java b/src/main/java/com/gitblit/servlet/BranchGraphServlet.java index 58a57781..3efe60de 100644 --- a/src/main/java/com/gitblit/BranchGraphServlet.java +++ b/src/main/java/com/gitblit/servlet/BranchGraphServlet.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.gitblit;
+package com.gitblit.servlet;
import java.awt.BasicStroke;
import java.awt.Color;
@@ -52,6 +52,10 @@ import org.eclipse.jgit.revplot.PlotLane; import org.eclipse.jgit.revplot.PlotWalk;
import org.eclipse.jgit.revwalk.RevCommit;
+import com.gitblit.Constants;
+import com.gitblit.IStoredSettings;
+import com.gitblit.Keys;
+import com.gitblit.Keys.web;
import com.gitblit.manager.IRepositoryManager;
import com.gitblit.manager.IRuntimeManager;
import com.gitblit.utils.JGitUtils;
diff --git a/src/main/java/com/gitblit/DownloadZipFilter.java b/src/main/java/com/gitblit/servlet/DownloadZipFilter.java index 914d89e5..f2064e3a 100644 --- a/src/main/java/com/gitblit/DownloadZipFilter.java +++ b/src/main/java/com/gitblit/servlet/DownloadZipFilter.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.gitblit;
+package com.gitblit.servlet;
import javax.inject.Inject;
import javax.inject.Singleton;
diff --git a/src/main/java/com/gitblit/DownloadZipServlet.java b/src/main/java/com/gitblit/servlet/DownloadZipServlet.java index d629dcfc..d26f73ea 100644 --- a/src/main/java/com/gitblit/DownloadZipServlet.java +++ b/src/main/java/com/gitblit/servlet/DownloadZipServlet.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.gitblit;
+package com.gitblit.servlet;
import java.io.IOException;
import java.text.MessageFormat;
@@ -31,6 +31,10 @@ import org.eclipse.jgit.revwalk.RevCommit; import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import com.gitblit.Constants;
+import com.gitblit.IStoredSettings;
+import com.gitblit.Keys;
+import com.gitblit.Keys.web;
import com.gitblit.manager.IRepositoryManager;
import com.gitblit.manager.IRuntimeManager;
import com.gitblit.utils.CompressionUtils;
diff --git a/src/main/java/com/gitblit/EnforceAuthenticationFilter.java b/src/main/java/com/gitblit/servlet/EnforceAuthenticationFilter.java index 48fc0057..d690fd2c 100644 --- a/src/main/java/com/gitblit/EnforceAuthenticationFilter.java +++ b/src/main/java/com/gitblit/servlet/EnforceAuthenticationFilter.java @@ -13,7 +13,7 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */package com.gitblit; + */package com.gitblit.servlet; import java.io.IOException; import java.text.MessageFormat; @@ -32,6 +32,9 @@ import javax.servlet.http.HttpServletResponse; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import com.gitblit.IStoredSettings; +import com.gitblit.Keys; +import com.gitblit.Keys.web; import com.gitblit.manager.IRuntimeManager; import com.gitblit.manager.ISessionManager; import com.gitblit.models.UserModel; diff --git a/src/main/java/com/gitblit/FederationServlet.java b/src/main/java/com/gitblit/servlet/FederationServlet.java index 31e3c0e1..e86e5d66 100644 --- a/src/main/java/com/gitblit/FederationServlet.java +++ b/src/main/java/com/gitblit/servlet/FederationServlet.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.gitblit;
+package com.gitblit.servlet;
import java.io.File;
import java.text.MessageFormat;
@@ -29,7 +29,13 @@ import javax.inject.Inject; import javax.inject.Singleton;
import javax.servlet.http.HttpServletResponse;
+import com.gitblit.Constants;
+import com.gitblit.IStoredSettings;
+import com.gitblit.Keys;
import com.gitblit.Constants.FederationRequest;
+import com.gitblit.Keys.federation;
+import com.gitblit.Keys.git;
+import com.gitblit.Keys.groovy;
import com.gitblit.manager.IFederationManager;
import com.gitblit.manager.IRepositoryManager;
import com.gitblit.manager.IRuntimeManager;
diff --git a/src/main/java/com/gitblit/GitFilter.java b/src/main/java/com/gitblit/servlet/GitFilter.java index ba8443d0..f39d68fd 100644 --- a/src/main/java/com/gitblit/GitFilter.java +++ b/src/main/java/com/gitblit/servlet/GitFilter.java @@ -13,15 +13,20 @@ * See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.gitblit;
+package com.gitblit.servlet;
import java.text.MessageFormat;
import javax.inject.Inject;
import javax.inject.Singleton;
+import com.gitblit.Constants;
+import com.gitblit.GitBlitException;
+import com.gitblit.IStoredSettings;
+import com.gitblit.Keys;
import com.gitblit.Constants.AccessRestrictionType;
import com.gitblit.Constants.AuthorizationControl;
+import com.gitblit.Keys.git;
import com.gitblit.manager.IRepositoryManager;
import com.gitblit.manager.IRuntimeManager;
import com.gitblit.manager.ISessionManager;
diff --git a/src/main/java/com/gitblit/GitBlit.java b/src/main/java/com/gitblit/servlet/GitblitContext.java index ca676ff9..73250121 100644 --- a/src/main/java/com/gitblit/GitBlit.java +++ b/src/main/java/com/gitblit/servlet/GitblitContext.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.gitblit; +package com.gitblit.servlet; import java.io.File; import java.io.FileNotFoundException; @@ -33,6 +33,12 @@ import javax.naming.NamingException; import javax.servlet.ServletContext; import javax.servlet.annotation.WebListener; +import com.gitblit.Constants; +import com.gitblit.DaggerModule; +import com.gitblit.FileSettings; +import com.gitblit.IStoredSettings; +import com.gitblit.Keys; +import com.gitblit.WebXmlSettings; import com.gitblit.dagger.DaggerContextListener; import com.gitblit.git.GitServlet; import com.gitblit.manager.IFederationManager; @@ -65,9 +71,9 @@ import dagger.ObjectGraph; * */ @WebListener -public class GitBlit extends DaggerContextListener { +public class GitblitContext extends DaggerContextListener { - private static GitBlit gitblit; + private static GitblitContext gitblit; private final List<IManager> managers = new ArrayList<IManager>(); @@ -78,7 +84,7 @@ public class GitBlit extends DaggerContextListener { /** * Construct a Gitblit WAR/Express context. */ - public GitBlit() { + public GitblitContext() { this.goSettings = null; this.goBaseFolder = null; gitblit = this; @@ -90,7 +96,7 @@ public class GitBlit extends DaggerContextListener { * @param settings * @param baseFolder */ - public GitBlit(IStoredSettings settings, File baseFolder) { + public GitblitContext(IStoredSettings settings, File baseFolder) { this.goSettings = settings; this.goBaseFolder = baseFolder; gitblit = this; diff --git a/src/main/java/com/gitblit/InjectionContextListener.java b/src/main/java/com/gitblit/servlet/InjectionContextListener.java index 712ae643..b0e10985 100644 --- a/src/main/java/com/gitblit/InjectionContextListener.java +++ b/src/main/java/com/gitblit/servlet/InjectionContextListener.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.gitblit; +package com.gitblit.servlet; import java.util.ArrayList; import java.util.EnumSet; diff --git a/src/main/java/com/gitblit/JsonServlet.java b/src/main/java/com/gitblit/servlet/JsonServlet.java index 286b1390..abc0f292 100644 --- a/src/main/java/com/gitblit/JsonServlet.java +++ b/src/main/java/com/gitblit/servlet/JsonServlet.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.gitblit;
+package com.gitblit.servlet;
import java.io.BufferedReader;
import java.io.IOException;
@@ -28,6 +28,7 @@ import javax.servlet.http.HttpServletResponse; import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import com.gitblit.Constants;
import com.gitblit.utils.JsonUtils;
import com.gitblit.utils.StringUtils;
diff --git a/src/main/java/com/gitblit/LogoServlet.java b/src/main/java/com/gitblit/servlet/LogoServlet.java index 17b05cfd..e91fad05 100644 --- a/src/main/java/com/gitblit/LogoServlet.java +++ b/src/main/java/com/gitblit/servlet/LogoServlet.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.gitblit;
+package com.gitblit.servlet;
import java.io.File;
import java.io.FileInputStream;
@@ -29,6 +29,8 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import com.gitblit.Keys;
+import com.gitblit.Keys.web;
import com.gitblit.manager.IRuntimeManager;
/**
diff --git a/src/main/java/com/gitblit/PagesFilter.java b/src/main/java/com/gitblit/servlet/PagesFilter.java index a322af2f..23e7859f 100644 --- a/src/main/java/com/gitblit/PagesFilter.java +++ b/src/main/java/com/gitblit/servlet/PagesFilter.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.gitblit;
+package com.gitblit.servlet;
import javax.inject.Inject;
import javax.inject.Singleton;
diff --git a/src/main/java/com/gitblit/PagesServlet.java b/src/main/java/com/gitblit/servlet/PagesServlet.java index ba919e07..6146f132 100644 --- a/src/main/java/com/gitblit/PagesServlet.java +++ b/src/main/java/com/gitblit/servlet/PagesServlet.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.gitblit;
+package com.gitblit.servlet;
import java.io.IOException;
import java.text.MessageFormat;
@@ -37,6 +37,10 @@ import org.eclipse.jgit.revwalk.RevTree; import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import com.gitblit.Constants;
+import com.gitblit.IStoredSettings;
+import com.gitblit.Keys;
+import com.gitblit.Keys.web;
import com.gitblit.manager.IRepositoryManager;
import com.gitblit.manager.IRuntimeManager;
import com.gitblit.models.PathModel;
diff --git a/src/main/java/com/gitblit/RobotsTxtServlet.java b/src/main/java/com/gitblit/servlet/RobotsTxtServlet.java index c07aa1d0..c93675a0 100644 --- a/src/main/java/com/gitblit/RobotsTxtServlet.java +++ b/src/main/java/com/gitblit/servlet/RobotsTxtServlet.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.gitblit;
+package com.gitblit.servlet;
import java.io.File;
import java.io.IOException;
@@ -25,6 +25,9 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import com.gitblit.Keys;
+import com.gitblit.Keys.web;
+import com.gitblit.Keys.web.robots;
import com.gitblit.manager.IRuntimeManager;
import com.gitblit.utils.FileUtils;
diff --git a/src/main/java/com/gitblit/RpcFilter.java b/src/main/java/com/gitblit/servlet/RpcFilter.java index c4b6451c..02f419ff 100644 --- a/src/main/java/com/gitblit/RpcFilter.java +++ b/src/main/java/com/gitblit/servlet/RpcFilter.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.gitblit;
+package com.gitblit.servlet;
import java.io.IOException;
import java.text.MessageFormat;
@@ -27,7 +27,11 @@ import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import com.gitblit.Constants;
+import com.gitblit.IStoredSettings;
+import com.gitblit.Keys;
import com.gitblit.Constants.RpcRequest;
+import com.gitblit.Keys.web;
import com.gitblit.manager.IRuntimeManager;
import com.gitblit.manager.ISessionManager;
import com.gitblit.models.UserModel;
diff --git a/src/main/java/com/gitblit/RpcServlet.java b/src/main/java/com/gitblit/servlet/RpcServlet.java index a3629b9c..3a115b17 100644 --- a/src/main/java/com/gitblit/RpcServlet.java +++ b/src/main/java/com/gitblit/servlet/RpcServlet.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.gitblit;
+package com.gitblit.servlet;
import java.io.IOException;
import java.text.MessageFormat;
@@ -31,7 +31,14 @@ import javax.servlet.http.HttpServletResponse; import org.eclipse.jgit.lib.Repository;
+import com.gitblit.Constants;
+import com.gitblit.GitBlitException;
+import com.gitblit.IStoredSettings;
+import com.gitblit.Keys;
import com.gitblit.Constants.RpcRequest;
+import com.gitblit.Keys.federation;
+import com.gitblit.Keys.realm;
+import com.gitblit.Keys.web;
import com.gitblit.manager.IFederationManager;
import com.gitblit.manager.IGitblitManager;
import com.gitblit.manager.IRepositoryManager;
diff --git a/src/main/java/com/gitblit/SparkleShareInviteServlet.java b/src/main/java/com/gitblit/servlet/SparkleShareInviteServlet.java index 1cd997d3..4b8b24f4 100644 --- a/src/main/java/com/gitblit/SparkleShareInviteServlet.java +++ b/src/main/java/com/gitblit/servlet/SparkleShareInviteServlet.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.gitblit;
+package com.gitblit.servlet;
import java.io.IOException;
import java.text.MessageFormat;
@@ -25,6 +25,10 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import com.gitblit.Constants;
+import com.gitblit.IStoredSettings;
+import com.gitblit.Keys;
+import com.gitblit.Keys.fanout;
import com.gitblit.manager.IRepositoryManager;
import com.gitblit.manager.IRuntimeManager;
import com.gitblit.manager.ISessionManager;
diff --git a/src/main/java/com/gitblit/SyndicationFilter.java b/src/main/java/com/gitblit/servlet/SyndicationFilter.java index 10b88102..adf9ba94 100644 --- a/src/main/java/com/gitblit/SyndicationFilter.java +++ b/src/main/java/com/gitblit/servlet/SyndicationFilter.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.gitblit;
+package com.gitblit.servlet;
import java.io.IOException;
import java.text.MessageFormat;
diff --git a/src/main/java/com/gitblit/SyndicationServlet.java b/src/main/java/com/gitblit/servlet/SyndicationServlet.java index 397545fa..739ee2d9 100644 --- a/src/main/java/com/gitblit/SyndicationServlet.java +++ b/src/main/java/com/gitblit/servlet/SyndicationServlet.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.gitblit;
+package com.gitblit.servlet;
import java.text.MessageFormat;
import java.util.ArrayList;
@@ -32,7 +32,9 @@ import org.eclipse.jgit.revwalk.RevCommit; import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.gitblit.AuthenticationFilter.AuthenticatedRequest;
+import com.gitblit.Constants;
+import com.gitblit.IStoredSettings;
+import com.gitblit.Keys;
import com.gitblit.manager.IProjectManager;
import com.gitblit.manager.IRepositoryManager;
import com.gitblit.manager.IRuntimeManager;
@@ -41,6 +43,7 @@ import com.gitblit.models.ProjectModel; import com.gitblit.models.RefModel;
import com.gitblit.models.RepositoryModel;
import com.gitblit.models.UserModel;
+import com.gitblit.servlet.AuthenticationFilter.AuthenticatedRequest;
import com.gitblit.utils.HttpUtils;
import com.gitblit.utils.JGitUtils;
import com.gitblit.utils.MessageProcessor;
diff --git a/src/main/java/com/gitblit/wicket/pages/ProjectPage.java b/src/main/java/com/gitblit/wicket/pages/ProjectPage.java index 22396bec..d2f2fd2f 100644 --- a/src/main/java/com/gitblit/wicket/pages/ProjectPage.java +++ b/src/main/java/com/gitblit/wicket/pages/ProjectPage.java @@ -26,10 +26,10 @@ import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.link.ExternalLink;
import com.gitblit.Keys;
-import com.gitblit.SyndicationServlet;
import com.gitblit.models.ProjectModel;
import com.gitblit.models.RepositoryModel;
import com.gitblit.models.UserModel;
+import com.gitblit.servlet.SyndicationServlet;
import com.gitblit.utils.MarkdownUtils;
import com.gitblit.utils.StringUtils;
import com.gitblit.wicket.CacheControl;
diff --git a/src/main/java/com/gitblit/wicket/pages/RepositoryPage.java b/src/main/java/com/gitblit/wicket/pages/RepositoryPage.java index 0552c304..dd6763d5 100644 --- a/src/main/java/com/gitblit/wicket/pages/RepositoryPage.java +++ b/src/main/java/com/gitblit/wicket/pages/RepositoryPage.java @@ -48,14 +48,14 @@ import org.slf4j.LoggerFactory; import com.gitblit.Constants;
import com.gitblit.GitBlitException;
import com.gitblit.Keys;
-import com.gitblit.PagesServlet;
-import com.gitblit.SyndicationServlet;
import com.gitblit.models.ProjectModel;
import com.gitblit.models.RefModel;
import com.gitblit.models.RepositoryModel;
import com.gitblit.models.SubmoduleModel;
import com.gitblit.models.UserModel;
import com.gitblit.models.UserRepositoryPreferences;
+import com.gitblit.servlet.PagesServlet;
+import com.gitblit.servlet.SyndicationServlet;
import com.gitblit.utils.ArrayUtils;
import com.gitblit.utils.DeepCopier;
import com.gitblit.utils.JGitUtils;
diff --git a/src/main/java/com/gitblit/wicket/panels/BranchesPanel.java b/src/main/java/com/gitblit/wicket/panels/BranchesPanel.java index 7fec0eae..28751fab 100644 --- a/src/main/java/com/gitblit/wicket/panels/BranchesPanel.java +++ b/src/main/java/com/gitblit/wicket/panels/BranchesPanel.java @@ -37,10 +37,10 @@ import org.eclipse.jgit.lib.Ref; import org.eclipse.jgit.lib.Repository;
import com.gitblit.Constants;
-import com.gitblit.SyndicationServlet;
import com.gitblit.models.RefModel;
import com.gitblit.models.RepositoryModel;
import com.gitblit.models.UserModel;
+import com.gitblit.servlet.SyndicationServlet;
import com.gitblit.utils.CommitCache;
import com.gitblit.utils.JGitUtils;
import com.gitblit.utils.RefLogUtils;
diff --git a/src/main/java/com/gitblit/wicket/panels/CompressedDownloadsPanel.java b/src/main/java/com/gitblit/wicket/panels/CompressedDownloadsPanel.java index 72a032e0..0d5864e4 100644 --- a/src/main/java/com/gitblit/wicket/panels/CompressedDownloadsPanel.java +++ b/src/main/java/com/gitblit/wicket/panels/CompressedDownloadsPanel.java @@ -22,8 +22,8 @@ import org.apache.wicket.markup.repeater.Item; import org.apache.wicket.markup.repeater.data.DataView;
import org.apache.wicket.markup.repeater.data.ListDataProvider;
-import com.gitblit.DownloadZipServlet;
-import com.gitblit.DownloadZipServlet.Format;
+import com.gitblit.servlet.DownloadZipServlet;
+import com.gitblit.servlet.DownloadZipServlet.Format;
import com.gitblit.Keys;
public class CompressedDownloadsPanel extends BasePanel {
diff --git a/src/main/java/com/gitblit/wicket/panels/LogPanel.java b/src/main/java/com/gitblit/wicket/panels/LogPanel.java index 7c91d22d..f8d980e5 100644 --- a/src/main/java/com/gitblit/wicket/panels/LogPanel.java +++ b/src/main/java/com/gitblit/wicket/panels/LogPanel.java @@ -32,10 +32,10 @@ import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevCommit;
-import com.gitblit.BranchGraphServlet;
import com.gitblit.Constants;
import com.gitblit.Keys;
import com.gitblit.models.RefModel;
+import com.gitblit.servlet.BranchGraphServlet;
import com.gitblit.utils.JGitUtils;
import com.gitblit.utils.StringUtils;
import com.gitblit.wicket.ExternalImage;
diff --git a/src/main/java/com/gitblit/wicket/panels/ProjectRepositoryPanel.java b/src/main/java/com/gitblit/wicket/panels/ProjectRepositoryPanel.java index 1c79760a..a0f8ac48 100644 --- a/src/main/java/com/gitblit/wicket/panels/ProjectRepositoryPanel.java +++ b/src/main/java/com/gitblit/wicket/panels/ProjectRepositoryPanel.java @@ -29,9 +29,9 @@ import org.apache.wicket.markup.html.panel.Fragment; import com.gitblit.Constants.AccessRestrictionType;
import com.gitblit.Keys;
-import com.gitblit.SyndicationServlet;
import com.gitblit.models.RepositoryModel;
import com.gitblit.models.UserModel;
+import com.gitblit.servlet.SyndicationServlet;
import com.gitblit.utils.ArrayUtils;
import com.gitblit.utils.StringUtils;
import com.gitblit.wicket.GitBlitWebSession;
diff --git a/src/main/java/com/gitblit/wicket/panels/RepositoriesPanel.java b/src/main/java/com/gitblit/wicket/panels/RepositoriesPanel.java index 8de84927..be5d960b 100644 --- a/src/main/java/com/gitblit/wicket/panels/RepositoriesPanel.java +++ b/src/main/java/com/gitblit/wicket/panels/RepositoriesPanel.java @@ -44,10 +44,10 @@ import org.apache.wicket.model.Model; import com.gitblit.Constants.AccessRestrictionType;
import com.gitblit.Keys;
-import com.gitblit.SyndicationServlet;
import com.gitblit.models.ProjectModel;
import com.gitblit.models.RepositoryModel;
import com.gitblit.models.UserModel;
+import com.gitblit.servlet.SyndicationServlet;
import com.gitblit.utils.ArrayUtils;
import com.gitblit.utils.ModelUtils;
import com.gitblit.utils.StringUtils;
|