Skip to content

Commit 7544bcd

Browse files
committed
refactor(ImageValidation): move image-related values to the corresponding class.
Addressed to #927 No functional changes.
1 parent 5d6f61d commit 7544bcd

File tree

4 files changed

+31
-5
lines changed

4 files changed

+31
-5
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Copyright (C) 2009-2019 Slava Semushin <[email protected]>
3+
*
4+
* This program is free software; you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation; either version 2 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program; if not, write to the Free Software
16+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17+
*/
18+
package ru.mystamps.web.feature.image;
19+
20+
public final class ImageValidation {
21+
22+
/** Maximum uploading image size in kilobytes. */
23+
public static final long MAX_IMAGE_SIZE = 500;
24+
25+
private ImageValidation() {
26+
}
27+
28+
}
29+

src/main/java/ru/mystamps/web/feature/series/AddImageForm.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
import javax.validation.GroupSequence;
3333

34-
import static ru.mystamps.web.validation.ValidationRules.MAX_IMAGE_SIZE;
34+
import static ru.mystamps.web.feature.image.ImageValidation.MAX_IMAGE_SIZE;
3535

3636
@Getter
3737
@Setter

src/main/java/ru/mystamps/web/feature/series/AddSeriesForm.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
import javax.validation.constraints.Size;
4343
import java.math.BigDecimal;
4444

45+
import static ru.mystamps.web.feature.image.ImageValidation.MAX_IMAGE_SIZE;
4546
import static ru.mystamps.web.validation.ValidationRules.MAX_DAYS_IN_MONTH;
46-
import static ru.mystamps.web.validation.ValidationRules.MAX_IMAGE_SIZE;
4747
import static ru.mystamps.web.validation.ValidationRules.MAX_MONTHS_IN_YEAR;
4848
import static ru.mystamps.web.validation.ValidationRules.MAX_SERIES_COMMENT_LENGTH;
4949
import static ru.mystamps.web.validation.ValidationRules.MAX_STAMPS_IN_SERIES;

src/main/java/ru/mystamps/web/validation/ValidationRules.java

-3
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ public final class ValidationRules {
2929
@SuppressWarnings({ "PMD.LongVariable", "checkstyle:linelength" })
3030
public static final String CATALOG_NUMBERS_AND_LETTERS_REGEXP = "[1-9][0-9]{0,3}[a-z]?(,[1-9][0-9]{0,3}[a-z]?)*";
3131

32-
/** Maximum uploading image size in kilobytes. */
33-
public static final long MAX_IMAGE_SIZE = 500;
34-
3532
public static final int MAX_DAYS_IN_MONTH = 31;
3633
public static final int MAX_MONTHS_IN_YEAR = 12;
3734

0 commit comments

Comments
 (0)