mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 08:25:44 +01:00
fix broken build
This commit is contained in:
@@ -46,6 +46,10 @@ import sonia.scm.cache.Cache;
|
||||
import sonia.scm.cache.CacheManager;
|
||||
import sonia.scm.util.AssertUtil;
|
||||
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Class description
|
||||
*
|
||||
@@ -95,12 +99,14 @@ public class BlameViewerUtil extends CacheClearHook
|
||||
*
|
||||
* @return
|
||||
*
|
||||
*
|
||||
* @throws IOException
|
||||
* @throws NotSupportedFeatuerException
|
||||
* @throws RepositoryException
|
||||
*/
|
||||
public BlamePagingResult getBlame(String repositoryId, String revision,
|
||||
String path)
|
||||
throws RepositoryException, NotSupportedFeatuerException
|
||||
throws RepositoryException, NotSupportedFeatuerException, IOException
|
||||
{
|
||||
AssertUtil.assertIsNotEmpty(repositoryId);
|
||||
|
||||
@@ -125,12 +131,14 @@ public class BlameViewerUtil extends CacheClearHook
|
||||
*
|
||||
* @return
|
||||
*
|
||||
*
|
||||
* @throws IOException
|
||||
* @throws NotSupportedFeatuerException
|
||||
* @throws RepositoryException
|
||||
*/
|
||||
public BlamePagingResult getBlame(Repository repository, String revision,
|
||||
String path)
|
||||
throws RepositoryException, NotSupportedFeatuerException
|
||||
throws RepositoryException, NotSupportedFeatuerException, IOException
|
||||
{
|
||||
AssertUtil.assertIsNotNull(repository);
|
||||
|
||||
|
||||
@@ -113,6 +113,7 @@ public class RepositoryResource
|
||||
* @param securityContextProvider
|
||||
* @param changesetViewerUtil
|
||||
* @param repositoryBrowserUtil
|
||||
* @param blameViewerUtil
|
||||
*/
|
||||
@Inject
|
||||
public RepositoryResource(
|
||||
@@ -132,6 +133,62 @@ public class RepositoryResource
|
||||
setDisableCache(false);
|
||||
}
|
||||
|
||||
//~--- methods --------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param id
|
||||
* @param revision
|
||||
* @param path
|
||||
*
|
||||
* @return
|
||||
*
|
||||
* @throws IOException
|
||||
* @throws RepositoryException
|
||||
*/
|
||||
@GET
|
||||
@Path("{id}/blame")
|
||||
public Response blame(@PathParam("id") String id,
|
||||
@QueryParam("revision") String revision,
|
||||
@QueryParam("path") String path)
|
||||
throws RepositoryException, IOException
|
||||
{
|
||||
Response response = null;
|
||||
|
||||
try
|
||||
{
|
||||
AssertUtil.assertIsNotNull(path);
|
||||
|
||||
BlamePagingResult blamePagingResult = blameViewerUtil.getBlame(id,
|
||||
revision, path);
|
||||
|
||||
if (blamePagingResult != null)
|
||||
{
|
||||
response = Response.ok(blamePagingResult).build();
|
||||
}
|
||||
else
|
||||
{
|
||||
response = Response.ok().build();
|
||||
}
|
||||
}
|
||||
catch (IllegalStateException ex)
|
||||
{
|
||||
response = Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
|
||||
}
|
||||
catch (RepositoryNotFoundException ex)
|
||||
{
|
||||
response = Response.status(Response.Status.NOT_FOUND).build();
|
||||
}
|
||||
catch (NotSupportedFeatuerException ex)
|
||||
{
|
||||
response = Response.status(Response.Status.BAD_REQUEST).build();
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
//~--- get methods ----------------------------------------------------------
|
||||
|
||||
/**
|
||||
@@ -230,37 +287,6 @@ public class RepositoryResource
|
||||
return response;
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("{id}/blame")
|
||||
public Response blame(@PathParam("id") String id,
|
||||
@QueryParam("revision") String revision,
|
||||
@QueryParam("path") String path)
|
||||
{
|
||||
Response response = null;
|
||||
|
||||
try {
|
||||
AssertUtil.assertIsNotNull(path);
|
||||
BlamePagingResult blamePagingResult = blameViewerUtil.getBlame(id, revision, path);
|
||||
|
||||
if (blamePagingResult != null) {
|
||||
response = Response.ok(blamePagingResult).build();
|
||||
}
|
||||
else
|
||||
{
|
||||
response = Response.ok().build();
|
||||
}
|
||||
} catch (IllegalStateException ex) {
|
||||
response = Response.status(Response.Status.NOT_FOUND).build();
|
||||
} catch (RepositoryException ex) {
|
||||
response = Response.status(Response.Status.NOT_FOUND).build();
|
||||
} catch (NotSupportedFeatuerException ex) {
|
||||
response = Response.status(Response.Status.BAD_REQUEST).build();
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
@@ -540,6 +566,9 @@ public class RepositoryResource
|
||||
|
||||
//~--- fields ---------------------------------------------------------------
|
||||
|
||||
/** Field description */
|
||||
private BlameViewerUtil blameViewerUtil;
|
||||
|
||||
/** Field description */
|
||||
private ChangesetViewerUtil changesetViewerUtil;
|
||||
|
||||
@@ -549,9 +578,6 @@ public class RepositoryResource
|
||||
/** Field description */
|
||||
private RepositoryBrowserUtil repositoryBrowserUtil;
|
||||
|
||||
/** Field description */
|
||||
private BlameViewerUtil blameViewerUtil;
|
||||
|
||||
/** Field description */
|
||||
private RepositoryManager repositoryManager;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user