AccessController.doPrivileged(new FieldEnablerPrivilegedAction(field)); FormParam param = field.getAnnotation(FormParam.class); List<InputPart> list = input.getFormDataMap()
protected void getFields(Class<?> type, MultipartFormDataOutput output, Object obj) throws IOException { for (Field field : type.getDeclaredFields()) { if (field.isAnnotationPresent(FormParam.class) && field.isAnnotationPresent(PartType.class)) { AccessController.doPrivileged(new FieldEnablerPrivilegedAction(field)); FormParam param = field.getAnnotation(FormParam.class); Object value = null; try { value = field.get(obj); } catch (IllegalAccessException e) { throw new WriterException(e); } PartType partType = field.getAnnotation(PartType.class); String filename = getFilename(field); output.addFormData(param.value(), value, field.getType(), field.getGenericType(), MediaType.valueOf(partType.value()), filename); } } }
AccessController.doPrivileged(new FieldEnablerPrivilegedAction(field)); FormParam param = field.getAnnotation(FormParam.class); List<InputPart> list = input.getFormDataMap()
protected void getFields(Class<?> type, MultipartFormDataOutput output, Object obj) throws IOException { for (Field field : type.getDeclaredFields()) { if (field.isAnnotationPresent(FormParam.class) && field.isAnnotationPresent(PartType.class)) { AccessController.doPrivileged(new FieldEnablerPrivilegedAction(field)); FormParam param = field.getAnnotation(FormParam.class); Object value = null; try { value = field.get(obj); } catch (IllegalAccessException e) { throw new WriterException(e); } PartType partType = field.getAnnotation(PartType.class); String filename = getFilename(field); output.addFormData(param.value(), value, field.getType(), field.getGenericType(), MediaType.valueOf(partType.value()), filename); } } }