mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-15 09:46:16 +01:00
package refactoring
This commit is contained in:
@@ -47,15 +47,15 @@ import java.io.File;
|
||||
public class BaseDirectory
|
||||
{
|
||||
|
||||
/** Field description */
|
||||
static final String DIRECTORY_PROPERTY = "scm-backend.home";
|
||||
|
||||
/** Field description */
|
||||
private static final String DIRECTORY_DEFAULT = ".scm-backend";
|
||||
|
||||
/** Field description */
|
||||
private static final String DIRECTORY_ENVIRONMENT = "SCMBACKEND_HOME";
|
||||
|
||||
/** Field description */
|
||||
static final String DIRECTORY_PROPERTY = "scm-backend.home";
|
||||
|
||||
/** Field description */
|
||||
private static BaseDirectory instance;
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ import java.util.Comparator;
|
||||
* @author Sebastian Sdorra
|
||||
*/
|
||||
public class PluginInformationNameComparator
|
||||
implements Comparator<PluginInformation>
|
||||
implements Comparator<PluginInformation>
|
||||
{
|
||||
|
||||
/** Field description */
|
||||
|
||||
@@ -46,7 +46,7 @@ import java.util.Comparator;
|
||||
* @author Sebastian Sdorra
|
||||
*/
|
||||
public class PluginInformationVersionComparator
|
||||
implements Comparator<PluginInformation>
|
||||
implements Comparator<PluginInformation>
|
||||
{
|
||||
|
||||
/** Field description */
|
||||
@@ -74,7 +74,7 @@ public class PluginInformationVersionComparator
|
||||
if (Util.isNotEmpty(v1) && Util.isNotEmpty(v2))
|
||||
{
|
||||
if (PluginVersion.createVersion(v1).isNewer(
|
||||
PluginVersion.createVersion(v2)))
|
||||
PluginVersion.createVersion(v2)))
|
||||
{
|
||||
result = -1;
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ public class PluginUtil
|
||||
* @return
|
||||
*/
|
||||
public static List<PluginInformation> filterSameVersions(
|
||||
List<PluginInformation> plugins)
|
||||
List<PluginInformation> plugins)
|
||||
{
|
||||
List<PluginInformation> filteredPlugins =
|
||||
new ArrayList<PluginInformation>();
|
||||
@@ -87,7 +87,7 @@ public class PluginUtil
|
||||
* @return
|
||||
*/
|
||||
public static List<PluginInformation> filterSnapshots(
|
||||
List<PluginInformation> allVersions)
|
||||
List<PluginInformation> allVersions)
|
||||
{
|
||||
List<PluginInformation> filtered = new ArrayList<PluginInformation>();
|
||||
|
||||
@@ -137,7 +137,7 @@ public class PluginUtil
|
||||
* @return
|
||||
*/
|
||||
public static List<PluginInformation> getFilteredPluginVersions(
|
||||
PluginBackend backend, String groupId, String artifactId)
|
||||
PluginBackend backend, String groupId, String artifactId)
|
||||
{
|
||||
List<PluginInformation> pluginVersions =
|
||||
PluginUtil.getPluginVersions(backend, groupId, artifactId);
|
||||
@@ -145,7 +145,7 @@ public class PluginUtil
|
||||
if (Util.isNotEmpty(pluginVersions))
|
||||
{
|
||||
Collections.sort(pluginVersions,
|
||||
PluginInformationNameComparator.INSTANCE);
|
||||
PluginInformationNameComparator.INSTANCE);
|
||||
pluginVersions = PluginUtil.filterSameVersions(pluginVersions);
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ public class PluginUtil
|
||||
* @return
|
||||
*/
|
||||
public static PluginInformation getLatestPluginVersion(PluginBackend backend,
|
||||
String groupId, String artifactId)
|
||||
String groupId, String artifactId)
|
||||
{
|
||||
return getFilteredPluginVersions(backend, groupId, artifactId).get(0);
|
||||
}
|
||||
@@ -180,7 +180,7 @@ public class PluginUtil
|
||||
* @return
|
||||
*/
|
||||
public static List<PluginInformation> getPluginVersions(
|
||||
PluginBackend backend, final String groupId, final String artifactId)
|
||||
PluginBackend backend, final String groupId, final String artifactId)
|
||||
{
|
||||
List<PluginInformation> pluginVersions =
|
||||
backend.getPlugins(new PluginFilter()
|
||||
@@ -189,7 +189,7 @@ public class PluginUtil
|
||||
public boolean accept(PluginInformation plugin)
|
||||
{
|
||||
return groupId.equals(plugin.getGroupId())
|
||||
&& artifactId.equals(plugin.getArtifactId());
|
||||
&& artifactId.equals(plugin.getArtifactId());
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ package sonia.scm.plugin;
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
|
||||
import com.google.inject.Singleton;
|
||||
|
||||
import sonia.scm.web.filter.HttpFilter;
|
||||
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
@@ -52,9 +53,12 @@ import javax.servlet.http.HttpServletResponse;
|
||||
@Singleton
|
||||
public class RedirectFilter extends HttpFilter
|
||||
{
|
||||
|
||||
|
||||
/** Field description */
|
||||
private static final String STARTPAGE = "/page/index.html";
|
||||
|
||||
//~--- methods --------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
|
||||
@@ -26,6 +26,9 @@
|
||||
* http://bitbucket.org/sdorra/scm-manager
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
package sonia.scm.plugin;
|
||||
|
||||
/**
|
||||
@@ -34,5 +37,7 @@ package sonia.scm.plugin;
|
||||
*/
|
||||
public class Roles
|
||||
{
|
||||
|
||||
/** Field description */
|
||||
public static final String ADMIN = "admin";
|
||||
}
|
||||
|
||||
@@ -41,15 +41,15 @@ import com.google.inject.servlet.ServletModule;
|
||||
import net.sf.ehcache.CacheManager;
|
||||
|
||||
import sonia.scm.ConfigurationException;
|
||||
import sonia.scm.plugin.rest.PluginResource;
|
||||
import sonia.scm.plugin.rest.url.BitbucketUrlBuilder;
|
||||
import sonia.scm.plugin.rest.url.GithubUrlBuilder;
|
||||
import sonia.scm.plugin.rest.url.UrlBuilder;
|
||||
import sonia.scm.plugin.rest.url.UrlBuilderFactory;
|
||||
import sonia.scm.plugin.rest.api.PluginResource;
|
||||
import sonia.scm.plugin.scanner.DefaultPluginScannerFactory;
|
||||
import sonia.scm.plugin.scanner.PluginScannerFactory;
|
||||
import sonia.scm.plugin.scanner.PluginScannerScheduler;
|
||||
import sonia.scm.plugin.scanner.TimerPluginScannerScheduler;
|
||||
import sonia.scm.plugin.url.BitbucketUrlBuilder;
|
||||
import sonia.scm.plugin.url.GithubUrlBuilder;
|
||||
import sonia.scm.plugin.url.UrlBuilder;
|
||||
import sonia.scm.plugin.url.UrlBuilderFactory;
|
||||
import sonia.scm.web.proxy.ProxyConfigurationProvider;
|
||||
import sonia.scm.web.proxy.ProxyServlet;
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ public class FreemarkerTemplateProvider implements ViewProcessor<String>
|
||||
{
|
||||
configuration = new Configuration();
|
||||
configuration.setServletContextForTemplateLoading(servletContext,
|
||||
DIRECTORY_TEMPLATES);
|
||||
DIRECTORY_TEMPLATES);
|
||||
}
|
||||
|
||||
//~--- methods --------------------------------------------------------------
|
||||
@@ -124,7 +124,7 @@ public class FreemarkerTemplateProvider implements ViewProcessor<String>
|
||||
*/
|
||||
@Override
|
||||
public void writeTo(String resolvedPath, Viewable viewable, OutputStream out)
|
||||
throws IOException
|
||||
throws IOException
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
|
||||
@@ -47,7 +47,7 @@ import java.util.Comparator;
|
||||
* @author Sebastian Sdorra
|
||||
*/
|
||||
public class PluginInformationComparator
|
||||
implements Comparator<PluginInformation>
|
||||
implements Comparator<PluginInformation>
|
||||
{
|
||||
|
||||
/** Field description */
|
||||
|
||||
@@ -59,7 +59,7 @@ public class ViewableResource
|
||||
* @param configuration
|
||||
*/
|
||||
public ViewableResource(ServletContext context,
|
||||
BackendConfiguration configuration)
|
||||
BackendConfiguration configuration)
|
||||
{
|
||||
this.contextPath = context.getContextPath();
|
||||
this.configuration = configuration;
|
||||
|
||||
@@ -29,13 +29,14 @@
|
||||
|
||||
|
||||
|
||||
package sonia.scm.plugin.rest;
|
||||
package sonia.scm.plugin.rest.admin;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
|
||||
import com.google.inject.Inject;
|
||||
|
||||
import sonia.scm.plugin.BackendConfiguration;
|
||||
import sonia.scm.plugin.rest.ViewableResource;
|
||||
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
|
||||
|
||||
package sonia.scm.plugin.rest;
|
||||
package sonia.scm.plugin.rest.api;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
|
||||
@@ -61,7 +61,7 @@ public class DefaultPluginFilter implements PluginFilter
|
||||
* @param snapshot
|
||||
*/
|
||||
public DefaultPluginFilter(String version, String os, String arch,
|
||||
boolean snapshot)
|
||||
boolean snapshot)
|
||||
{
|
||||
this.version = version;
|
||||
this.os = os;
|
||||
@@ -84,9 +84,10 @@ public class DefaultPluginFilter implements PluginFilter
|
||||
{
|
||||
PluginCondition condition = plugin.getCondition();
|
||||
|
||||
return (snapshot ||!plugin.getVersion().toUpperCase().contains(
|
||||
VERSION_SNAPSHOT)) && ((condition != null) && condition.isSupported(
|
||||
version, os, arch) || (condition == null));
|
||||
return (snapshot
|
||||
||!plugin.getVersion().toUpperCase().contains(
|
||||
VERSION_SNAPSHOT)) && ((condition != null)
|
||||
&& condition.isSupported(version, os, arch) || (condition == null));
|
||||
}
|
||||
|
||||
//~--- fields ---------------------------------------------------------------
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
|
||||
|
||||
package sonia.scm.plugin.rest;
|
||||
package sonia.scm.plugin.rest.api;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
|
||||
@@ -51,6 +51,7 @@ import sonia.scm.plugin.PluginBackendListener;
|
||||
import sonia.scm.plugin.PluginCenter;
|
||||
import sonia.scm.plugin.PluginInformation;
|
||||
import sonia.scm.plugin.PluginVersion;
|
||||
import sonia.scm.plugin.rest.PluginInformationComparator;
|
||||
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
|
||||
@@ -97,8 +98,7 @@ public class PluginResource implements PluginBackendListener
|
||||
*/
|
||||
@Inject
|
||||
public PluginResource(PluginBackend backend,
|
||||
BackendConfiguration configuration,
|
||||
CacheManager cacheManager)
|
||||
BackendConfiguration configuration, CacheManager cacheManager)
|
||||
{
|
||||
this.backend = backend;
|
||||
this.configuration = configuration;
|
||||
@@ -143,15 +143,14 @@ public class PluginResource implements PluginBackendListener
|
||||
@GET
|
||||
@Produces(MediaType.APPLICATION_XML)
|
||||
public Response getPlugins(@PathParam("version") String version,
|
||||
@QueryParam("os") String os,
|
||||
@QueryParam("arch") String arch,
|
||||
@DefaultValue("false")
|
||||
@QueryParam("os") String os, @QueryParam("arch") String arch,
|
||||
@DefaultValue("false")
|
||||
@QueryParam("snapshot") boolean snapshot)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("load plugins for version {}, include snapshots: {}",
|
||||
version, Boolean.toString(snapshot));
|
||||
version, Boolean.toString(snapshot));
|
||||
}
|
||||
|
||||
PluginCenter pc = null;
|
||||
@@ -201,7 +200,7 @@ public class PluginResource implements PluginBackendListener
|
||||
* @return
|
||||
*/
|
||||
private String createCacheKey(String version, String os, String arch,
|
||||
boolean snapshot)
|
||||
boolean snapshot)
|
||||
{
|
||||
StringBuilder key = new StringBuilder(version);
|
||||
|
||||
@@ -222,7 +221,7 @@ public class PluginResource implements PluginBackendListener
|
||||
* @return
|
||||
*/
|
||||
private Set<PluginInformation> getNewestPlugins(
|
||||
List<PluginInformation> plugins)
|
||||
List<PluginInformation> plugins)
|
||||
{
|
||||
Collections.sort(plugins, PluginInformationComparator.INSTANCE);
|
||||
|
||||
@@ -278,10 +277,10 @@ public class PluginResource implements PluginBackendListener
|
||||
* @return
|
||||
*/
|
||||
private boolean isSamePlugin(PluginInformation plugin,
|
||||
PluginInformation otherPlugin)
|
||||
PluginInformation otherPlugin)
|
||||
{
|
||||
return plugin.getGroupId().equals(otherPlugin.getGroupId())
|
||||
&& plugin.getArtifactId().equals(otherPlugin.getArtifactId());
|
||||
&& plugin.getArtifactId().equals(otherPlugin.getArtifactId());
|
||||
}
|
||||
|
||||
//~--- fields ---------------------------------------------------------------
|
||||
@@ -29,13 +29,14 @@
|
||||
|
||||
|
||||
|
||||
package sonia.scm.plugin.rest;
|
||||
package sonia.scm.plugin.rest.error;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
|
||||
import com.google.inject.Inject;
|
||||
|
||||
import sonia.scm.plugin.BackendConfiguration;
|
||||
import sonia.scm.plugin.rest.ViewableResource;
|
||||
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
|
||||
|
||||
package sonia.scm.plugin.rest;
|
||||
package sonia.scm.plugin.rest.page;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
|
||||
@@ -48,8 +48,9 @@ import sonia.scm.plugin.PluginBackend;
|
||||
import sonia.scm.plugin.PluginInformation;
|
||||
import sonia.scm.plugin.PluginInformationVersionComparator;
|
||||
import sonia.scm.plugin.PluginUtil;
|
||||
import sonia.scm.plugin.rest.url.UrlBuilder;
|
||||
import sonia.scm.plugin.rest.url.UrlBuilderFactory;
|
||||
import sonia.scm.plugin.rest.CachedViewableResource;
|
||||
import sonia.scm.plugin.url.UrlBuilder;
|
||||
import sonia.scm.plugin.url.UrlBuilderFactory;
|
||||
import sonia.scm.util.Util;
|
||||
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
@@ -103,8 +104,8 @@ public class DetailResource extends CachedViewableResource
|
||||
*/
|
||||
@Inject
|
||||
public DetailResource(ServletContext context, PluginBackend backend,
|
||||
BackendConfiguration configuration,
|
||||
UrlBuilderFactory urlFactory, CacheManager cacheManager)
|
||||
BackendConfiguration configuration, UrlBuilderFactory urlFactory,
|
||||
CacheManager cacheManager)
|
||||
{
|
||||
super(context, backend, configuration, cacheManager, CACHE);
|
||||
this.backend = backend;
|
||||
@@ -125,8 +126,7 @@ public class DetailResource extends CachedViewableResource
|
||||
*/
|
||||
@GET
|
||||
public Viewable getPluginDetails(@PathParam("groupId") String groupId,
|
||||
@PathParam("artifactId") String artifactId,
|
||||
@DefaultValue("false")
|
||||
@PathParam("artifactId") String artifactId, @DefaultValue("false")
|
||||
@QueryParam("snapshot") boolean snapshot)
|
||||
{
|
||||
String cacheKey = createCacheKey(groupId, artifactId, snapshot);
|
||||
@@ -160,7 +160,7 @@ public class DetailResource extends CachedViewableResource
|
||||
|
||||
vars.put("latest", PluginUtil.prepareForView(latest));
|
||||
vars.put("versions", detailList);
|
||||
viewable = new Viewable("/detail", vars);
|
||||
viewable = new Viewable("/page/detail", vars);
|
||||
putToCache(cacheKey, viewable);
|
||||
}
|
||||
else if (logger.isDebugEnabled())
|
||||
@@ -184,10 +184,10 @@ public class DetailResource extends CachedViewableResource
|
||||
* @return
|
||||
*/
|
||||
private String createCacheKey(String groupId, String artifactId,
|
||||
boolean snapshot)
|
||||
boolean snapshot)
|
||||
{
|
||||
return new StringBuilder(Util.nonNull(groupId)).append(
|
||||
Util.nonNull(artifactId)).append(Boolean.toString(snapshot)).toString();
|
||||
Util.nonNull(artifactId)).append(Boolean.toString(snapshot)).toString();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -200,12 +200,12 @@ public class DetailResource extends CachedViewableResource
|
||||
* @return
|
||||
*/
|
||||
private List<PluginDetailWrapper> createDetailList(PluginInformation latest,
|
||||
List<PluginInformation> pluginVersions)
|
||||
List<PluginInformation> pluginVersions)
|
||||
{
|
||||
List<PluginDetailWrapper> detailList = new ArrayList<PluginDetailWrapper>();
|
||||
|
||||
Collections.sort(pluginVersions,
|
||||
PluginInformationVersionComparator.INSTANCE);
|
||||
PluginInformationVersionComparator.INSTANCE);
|
||||
|
||||
Iterator<PluginInformation> pluginIterator = pluginVersions.iterator();
|
||||
UrlBuilder urlBuilder = urlFactory.createCompareUrlBuilder(latest);
|
||||
@@ -29,13 +29,14 @@
|
||||
|
||||
|
||||
|
||||
package sonia.scm.plugin.rest;
|
||||
package sonia.scm.plugin.rest.page;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
|
||||
import com.google.inject.Inject;
|
||||
|
||||
import sonia.scm.plugin.BackendConfiguration;
|
||||
import sonia.scm.plugin.rest.ViewableResource;
|
||||
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
|
||||
@@ -60,7 +61,7 @@ public class LoginResource extends ViewableResource
|
||||
{
|
||||
|
||||
/** Field description */
|
||||
private static final String PAGE_LOGIN = "/login";
|
||||
private static final String PAGE_LOGIN = "/page/login";
|
||||
|
||||
//~--- constructors ---------------------------------------------------------
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
|
||||
|
||||
package sonia.scm.plugin.rest;
|
||||
package sonia.scm.plugin.rest.page;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
|
||||
@@ -43,6 +43,8 @@ import sonia.scm.plugin.CategoryNameComaparator;
|
||||
import sonia.scm.plugin.PluginBackend;
|
||||
import sonia.scm.plugin.PluginInformation;
|
||||
import sonia.scm.plugin.PluginUtil;
|
||||
import sonia.scm.plugin.rest.PluginInformationComparator;
|
||||
import sonia.scm.plugin.rest.ViewableResource;
|
||||
import sonia.scm.util.Util;
|
||||
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
@@ -106,7 +108,7 @@ public class OverviewResource extends ViewableResource
|
||||
|
||||
vars.put("categories", categories);
|
||||
|
||||
return new Viewable("/index", vars);
|
||||
return new Viewable("/page/index", vars);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
|
||||
|
||||
package sonia.scm.plugin.rest;
|
||||
package sonia.scm.plugin.rest.page;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
|
||||
|
||||
package sonia.scm.plugin.rest;
|
||||
package sonia.scm.plugin.rest.page;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
|
||||
@@ -39,6 +39,7 @@ import com.google.inject.Inject;
|
||||
|
||||
import org.imgscalr.Scalr;
|
||||
|
||||
import sonia.scm.plugin.BaseDirectory;
|
||||
import sonia.scm.plugin.PluginBackend;
|
||||
import sonia.scm.plugin.PluginInformation;
|
||||
import sonia.scm.plugin.PluginUtil;
|
||||
@@ -66,7 +67,6 @@ import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.WebApplicationException;
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.Response.Status;
|
||||
import sonia.scm.plugin.BaseDirectory;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -125,11 +125,9 @@ public class ScreenshotResource
|
||||
*/
|
||||
@GET
|
||||
@Produces("image/jpeg")
|
||||
public Response getScreenshot(
|
||||
@PathParam("groupId") String groupId,
|
||||
public Response getScreenshot(@PathParam("groupId") String groupId,
|
||||
@PathParam("artifactId") String artifactId,
|
||||
@PathParam("number") int number,
|
||||
@PathParam("size") String size)
|
||||
@PathParam("number") int number, @PathParam("size") String size)
|
||||
throws IOException
|
||||
{
|
||||
PluginInformation plugin = PluginUtil.getLatestPluginVersion(backend,
|
||||
@@ -57,7 +57,7 @@ public class PluginScannerRunnable implements Runnable
|
||||
* @param directory
|
||||
*/
|
||||
public PluginScannerRunnable(PluginBackend backend,
|
||||
PluginScanner pluginScanner, File directory)
|
||||
PluginScanner pluginScanner, File directory)
|
||||
{
|
||||
this.backend = backend;
|
||||
this.pluginScanner = pluginScanner;
|
||||
|
||||
@@ -69,8 +69,7 @@ public class PluginScannerTimerTask extends TimerTask
|
||||
* @param scannerFactory
|
||||
*/
|
||||
public PluginScannerTimerTask(PluginBackend backend,
|
||||
BackendConfiguration configuration,
|
||||
PluginScannerFactory scannerFactory)
|
||||
BackendConfiguration configuration, PluginScannerFactory scannerFactory)
|
||||
{
|
||||
this.backend = backend;
|
||||
this.configuration = configuration;
|
||||
@@ -103,7 +102,7 @@ public class PluginScannerTimerTask extends TimerTask
|
||||
if (configuration.isMultithreaded())
|
||||
{
|
||||
new Thread(new PluginScannerRunnable(backend, scanner,
|
||||
directory)).start();
|
||||
directory)).start();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -74,8 +74,7 @@ public class TimerPluginScannerScheduler implements PluginScannerScheduler
|
||||
*/
|
||||
@Inject
|
||||
public TimerPluginScannerScheduler(PluginBackend backend,
|
||||
BackendConfiguration configuration,
|
||||
PluginScannerFactory scannerFactory)
|
||||
BackendConfiguration configuration, PluginScannerFactory scannerFactory)
|
||||
{
|
||||
this.backend = backend;
|
||||
this.configuration = configuration;
|
||||
@@ -105,7 +104,7 @@ public class TimerPluginScannerScheduler implements PluginScannerScheduler
|
||||
if (logger.isInfoEnabled())
|
||||
{
|
||||
logger.info("start scanner task with an interval of {}",
|
||||
Util.convertTime(configuration.getScannInterval()));
|
||||
Util.convertTime(configuration.getScannInterval()));
|
||||
}
|
||||
|
||||
PluginScannerTimerTask task = new PluginScannerTimerTask(backend,
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
|
||||
|
||||
package sonia.scm.plugin.rest.url;
|
||||
package sonia.scm.plugin.url;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
|
||||
@@ -92,11 +92,10 @@ public abstract class AbstractUrlBuilder implements UrlBuilder
|
||||
*/
|
||||
@Override
|
||||
public String createCompareUrl(PluginInformation latest,
|
||||
PluginInformation plugin,
|
||||
PluginInformation other)
|
||||
PluginInformation plugin, PluginInformation other)
|
||||
{
|
||||
return createCompareUrl(latest.getUrl(), plugin.getVersion(),
|
||||
other.getVersion());
|
||||
other.getVersion());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -110,7 +109,7 @@ public abstract class AbstractUrlBuilder implements UrlBuilder
|
||||
* @return
|
||||
*/
|
||||
public String createCompareUrl(String urlString, String version,
|
||||
String otherVersion)
|
||||
String otherVersion)
|
||||
{
|
||||
String result = null;
|
||||
|
||||
@@ -128,7 +127,7 @@ public abstract class AbstractUrlBuilder implements UrlBuilder
|
||||
if (parts.length >= 2)
|
||||
{
|
||||
result = MessageFormat.format(getUrlPattern(), parts[0], parts[1],
|
||||
version, otherVersion);
|
||||
version, otherVersion);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
|
||||
|
||||
package sonia.scm.plugin.rest.url;
|
||||
package sonia.scm.plugin.url;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
|
||||
|
||||
package sonia.scm.plugin.rest.url;
|
||||
package sonia.scm.plugin.url;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
|
||||
|
||||
package sonia.scm.plugin.rest.url;
|
||||
package sonia.scm.plugin.url;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
|
||||
@@ -55,8 +55,7 @@ public interface UrlBuilder
|
||||
* @return
|
||||
*/
|
||||
public String createCompareUrl(PluginInformation latest,
|
||||
PluginInformation plugin,
|
||||
PluginInformation other);
|
||||
PluginInformation plugin, PluginInformation other);
|
||||
|
||||
//~--- get methods ----------------------------------------------------------
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
|
||||
|
||||
package sonia.scm.plugin.rest.url;
|
||||
package sonia.scm.plugin.url;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<#include "template/header.html">
|
||||
<#include "../template/header.html">
|
||||
|
||||
<p>${latest.description}</p>
|
||||
|
||||
@@ -133,4 +133,4 @@
|
||||
});
|
||||
</script>
|
||||
|
||||
<#include "template/footer.html">
|
||||
<#include "../template/footer.html">
|
||||
@@ -1,4 +1,4 @@
|
||||
<#include "template/header.html">
|
||||
<#include "../template/header.html">
|
||||
|
||||
<div id="categories">
|
||||
<#list categories as category>
|
||||
@@ -25,4 +25,4 @@
|
||||
});
|
||||
</script>
|
||||
|
||||
<#include "template/footer.html">
|
||||
<#include "../template/footer.html">
|
||||
@@ -1,4 +1,4 @@
|
||||
<#include "template/header.html">
|
||||
<#include "../template/header.html">
|
||||
|
||||
<form method="POST" action="">
|
||||
|
||||
@@ -25,4 +25,4 @@
|
||||
|
||||
</form>
|
||||
|
||||
<#include "template/footer.html">
|
||||
<#include "../template/footer.html">
|
||||
@@ -35,6 +35,7 @@ package sonia.scm.plugin.rest.url;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
|
||||
import sonia.scm.plugin.url.BitbucketUrlBuilder;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
@@ -35,6 +35,7 @@ package sonia.scm.plugin.rest.url;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
|
||||
import sonia.scm.plugin.url.GithubUrlBuilder;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
Reference in New Issue
Block a user