-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
47a9cd9
commit e2fa7c4
Showing
1 changed file
with
34 additions
and
34 deletions.
There are no files selected for viewing
68 changes: 34 additions & 34 deletions
68
...a/com/dontbe/www/DontBeServer/common/converter/MultipartJackson2HttpMessageConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
package com.dontbe.www.DontBeServer.common.converter; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import org.springframework.http.MediaType; | ||
import org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.lang.reflect.Type; | ||
|
||
@Component | ||
public class MultipartJackson2HttpMessageConverter extends AbstractJackson2HttpMessageConverter { | ||
|
||
/** | ||
* Converter for support http request with header Content-Type: multipart/form-data | ||
*/ | ||
public MultipartJackson2HttpMessageConverter(ObjectMapper objectMapper) { | ||
super(objectMapper, MediaType.APPLICATION_OCTET_STREAM); | ||
} | ||
|
||
@Override | ||
public boolean canWrite(Class<?> clazz, MediaType mediaType) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean canWrite(Type type, Class<?> clazz, MediaType mediaType) { | ||
return false; | ||
} | ||
|
||
@Override | ||
protected boolean canWrite(MediaType mediaType) { | ||
return false; | ||
} | ||
} | ||
//package com.dontbe.www.DontBeServer.common.converter; | ||
// | ||
//import com.fasterxml.jackson.databind.ObjectMapper; | ||
//import org.springframework.http.MediaType; | ||
//import org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter; | ||
//import org.springframework.stereotype.Component; | ||
// | ||
//import java.lang.reflect.Type; | ||
// | ||
//@Component | ||
//public class MultipartJackson2HttpMessageConverter extends AbstractJackson2HttpMessageConverter { | ||
// | ||
// /** | ||
// * Converter for support http request with header Content-Type: multipart/form-data | ||
// */ | ||
// public MultipartJackson2HttpMessageConverter(ObjectMapper objectMapper) { | ||
// super(objectMapper, MediaType.APPLICATION_OCTET_STREAM); | ||
// } | ||
// | ||
// @Override | ||
// public boolean canWrite(Class<?> clazz, MediaType mediaType) { | ||
// return false; | ||
// } | ||
// | ||
// @Override | ||
// public boolean canWrite(Type type, Class<?> clazz, MediaType mediaType) { | ||
// return false; | ||
// } | ||
// | ||
// @Override | ||
// protected boolean canWrite(MediaType mediaType) { | ||
// return false; | ||
// } | ||
//} |