KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jodd > bean > converters > UploadedFileConverter


1 package jodd.bean.converters;
2
3 import jodd.servlet.UploadedFile;
4
5
6 /**
7  * Converts given object to jodd.servlet.UploadedFile.
8  */

9 public final class UploadedFileConverter implements jodd.bean.Converter {
10
11     public Object convert(Object value) {
12     
13         if (value == null) {
14             return (UploadedFile) null;
15         }
16     
17         if (value instanceof UploadedFile) {
18             return value;
19         }
20         throw new IllegalArgumentException("UploadedFile conversion for " + value + " failed.");
21     }
22 }
23
Popular Tags