mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-18 03:01:05 +01:00
merge with 2.0.0-m3
This commit is contained in:
@@ -53,5 +53,11 @@ public interface ModelObject
|
||||
*
|
||||
* @return unique id
|
||||
*/
|
||||
public String getId();
|
||||
String getId();
|
||||
|
||||
void setLastModified(Long timestamp);
|
||||
|
||||
Long getCreationDate();
|
||||
|
||||
void setCreationDate(Long timestamp);
|
||||
}
|
||||
|
||||
@@ -42,15 +42,9 @@ package sonia.scm.group;
|
||||
public class GroupAlreadyExistsException extends GroupException
|
||||
{
|
||||
|
||||
/** Field description */
|
||||
private static final long serialVersionUID = 4042878550219750430L;
|
||||
|
||||
/**
|
||||
* Constructs a new instance.
|
||||
*
|
||||
* @param name The name (aka id) of the group
|
||||
*/
|
||||
public GroupAlreadyExistsException(String name) {
|
||||
super(name + " group already exists");
|
||||
public GroupAlreadyExistsException(Group group) {
|
||||
super(group.getName() + " group already exists");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ public class GroupNotFoundException extends GroupException
|
||||
* Constructs a new GroupNotFoundException.
|
||||
*
|
||||
*/
|
||||
public GroupNotFoundException() {
|
||||
super("group does not exists");
|
||||
public GroupNotFoundException(Group group) {
|
||||
super("group " + group.getName() + " does not exist");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,17 +52,11 @@ public class RepositoryNotFoundException extends RepositoryException
|
||||
* error detail message.
|
||||
*
|
||||
*/
|
||||
public RepositoryNotFoundException() {}
|
||||
public RepositoryNotFoundException(Repository repository) {
|
||||
super("repository " + repository.getName() + "/" + repository.getNamespace() + " does not exist");
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a new {@link RepositoryNotFoundException} with the specified
|
||||
* error detail message.
|
||||
*
|
||||
*
|
||||
* @param message error detail message
|
||||
*/
|
||||
public RepositoryNotFoundException(String message)
|
||||
{
|
||||
super(message);
|
||||
public RepositoryNotFoundException(String repositoryId) {
|
||||
super("repository with id " + repositoryId + " does not exist");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,8 +177,7 @@ public final class RepositoryServiceFactory
|
||||
|
||||
if (repository == null)
|
||||
{
|
||||
throw new RepositoryNotFoundException(
|
||||
"could not find a repository with id ".concat(repositoryId));
|
||||
throw new RepositoryNotFoundException(repositoryId);
|
||||
}
|
||||
|
||||
return create(repository);
|
||||
|
||||
@@ -41,19 +41,11 @@ package sonia.scm.user;
|
||||
public class UserAlreadyExistsException extends UserException
|
||||
{
|
||||
|
||||
/** Field description */
|
||||
private static final long serialVersionUID = 9182294539718090814L;
|
||||
|
||||
//~--- constructors ---------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Constructs a new instance.
|
||||
*
|
||||
* @param name The name (aka id) of the user
|
||||
* @since 1.5
|
||||
*/
|
||||
public UserAlreadyExistsException(String name)
|
||||
{
|
||||
super(name + " user already exists");
|
||||
public UserAlreadyExistsException(User user) {
|
||||
super(user.getName() + " user already exists");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ public class UserNotFoundException extends UserException
|
||||
* Constructs a new UserNotFoundException.
|
||||
*
|
||||
*/
|
||||
public UserNotFoundException() {
|
||||
super("user does not exists");
|
||||
public UserNotFoundException(User user) {
|
||||
super("user " + user.getName() + " does not exist");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user