File tree 2 files changed +11
-4
lines changed
src/main/java/ru/mystamps/web/controller
2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -204,7 +204,10 @@ public String processInput(
204
204
// User without permissions has tried to download a file. It means that he
205
205
// didn't specify a file but somehow provide a url to an image. In this case,
206
206
// let's show an error message that file is required.
207
- result .rejectValue ("image" , "ru.mystamps.web.validation.jsr303.NotEmptyFilename.message" );
207
+ result .rejectValue (
208
+ "image" ,
209
+ "ru.mystamps.web.validation.jsr303.NotEmptyFilename.message"
210
+ );
208
211
form .setImageUrl (null );
209
212
break ;
210
213
default :
@@ -213,6 +216,7 @@ public String processInput(
213
216
DownloadResult .class .getName () + "." + code .toString (),
214
217
"Could not download image"
215
218
);
219
+ break ;
216
220
}
217
221
request .removeAttribute (DownloadImageInterceptor .ERROR_CODE_ATTR_NAME );
218
222
}
Original file line number Diff line number Diff line change 45
45
@ RequiredArgsConstructor
46
46
public class DownloadImageInterceptor extends HandlerInterceptorAdapter {
47
47
48
- private static final Logger LOG = LoggerFactory .getLogger (DownloadImageInterceptor .class );
49
-
50
48
/**
51
49
* Field name that contains image URL.
52
50
*/
@@ -66,6 +64,8 @@ public class DownloadImageInterceptor extends HandlerInterceptorAdapter {
66
64
*/
67
65
public static final String ERROR_CODE_ATTR_NAME = "DownloadedImage.ErrorCode" ;
68
66
67
+ private static final Logger LOG = LoggerFactory .getLogger (DownloadImageInterceptor .class );
68
+
69
69
private final DownloaderService downloaderService ;
70
70
71
71
@ Override
@@ -110,7 +110,10 @@ public boolean preHandle(
110
110
SecurityContextUtils .getUserId (),
111
111
imageUrl
112
112
);
113
- request .setAttribute (ERROR_CODE_ATTR_NAME , DownloadResult .Code .INSUFFICIENT_PERMISSIONS );
113
+ request .setAttribute (
114
+ ERROR_CODE_ATTR_NAME ,
115
+ DownloadResult .Code .INSUFFICIENT_PERMISSIONS
116
+ );
114
117
return true ;
115
118
}
116
119
You can’t perform that action at this time.
0 commit comments