private static final String DIALECT = "h2";
private static final String DRIVER = "org.h2.Driver";
private static final String URL = "jdbc:h2:";
- private static final String USER = "sonar";
- private static final String PASSWORD = "sonar";
+ private static final String H2_FILE_SUFFIX = ".h2.db";
+ private static final String SONAR = "sonar";
+ private static final String USER = SONAR;
+ private static final String PASSWORD = SONAR;
+
private final Database database;
private final ServerFileSystem serverFileSystem;
close(destination);
if (LOG.isDebugEnabled()) {
- File dbFile = new File(name + ".h2.db");
+ File dbFile = new File(name + H2_FILE_SUFFIX);
long size = dbFile.length();
long duration = System.currentTimeMillis() - startup;
if (projectId == null) {
private byte[] dbFileContent(String name) {
try {
- File dbFile = new File(name + ".h2.db");
+ File dbFile = new File(name + H2_FILE_SUFFIX);
byte[] content = Files.toByteArray(dbFile);
dbFile.delete();
return content;
private static final String ID_PARAM = "id";
private static final String NAME_PARAM = "name";
private static final String DESCRIPTION_PARAM = "description";
+ private static final String ACTION_PLANS_ERRORS_ACTION_PLAN_DOES_NOT_EXIST = "action_plans.errors.action_plan_does_not_exist";
private final IssueService issueService;
private final IssueCommentService commentService;
DefaultActionPlan existingActionPlan = (DefaultActionPlan) actionPlanService.findByKey(key, UserSession.get());
if (existingActionPlan == null) {
Result<ActionPlan> result = Result.of();
- result.addError(Result.Message.ofL10n("action_plans.errors.action_plan_does_not_exist", key));
+ result.addError(Result.Message.ofL10n(ACTION_PLANS_ERRORS_ACTION_PLAN_DOES_NOT_EXIST, key));
return result;
} else {
Result<ActionPlan> result = createActionPlanResult(parameters, existingActionPlan);
private Result<ActionPlan> createResultForExistingActionPlan(String actionPlanKey) {
Result<ActionPlan> result = Result.of();
if (findActionPlan(actionPlanKey) == null) {
- result.addError(Result.Message.ofL10n("action_plans.errors.action_plan_does_not_exist", actionPlanKey));
+ result.addError(Result.Message.ofL10n(ACTION_PLANS_ERRORS_ACTION_PLAN_DOES_NOT_EXIST, actionPlanKey));
}
return result;
}