类 FileEncodingApplicationListener
- java.lang.Object
- org.springframework.boot.context.FileEncodingApplicationListener
- 所有已实现的接口:
EventListener
,org.springframework.context.ApplicationListener<ApplicationEnvironmentPreparedEvent>
,org.springframework.core.Ordered
public class FileEncodingApplicationListener extends Object implements org.springframework.context.ApplicationListener<ApplicationEnvironmentPreparedEvent>, org.springframework.core.Ordered
AnApplicationListener
that halts application startup if the system file encoding does not match an expected value set in the environment. By default has no effect, but if you setspring.mandatory_file_encoding
(or some camelCase or UPPERCASE variant of that) to the name of a character encoding (e.g. "UTF-8") then this initializer throws an exception when thefile.encoding
System property does not equal it.The System property
file.encoding
is normally set by the JVM in response to theLANG
orLC_ALL
environment variables. It is used (along with other platform-dependent variables keyed off those environment variables) to encode JVM arguments as well as file names and paths. In most cases you can override the file encoding System property on the command line (with standard JVM features), but also consider setting theLANG
environment variable to an explicit character-encoding value (e.g. "en_GB.UTF-8").
构造器概要
构造器 构造器 说明 FileEncodingApplicationListener()
构造器详细资料
FileEncodingApplicationListener
public FileEncodingApplicationListener()
方法详细资料
getOrder
public int getOrder()
- 指定者:
getOrder
在接口中org.springframework.core.Ordered
onApplicationEvent
public void onApplicationEvent(ApplicationEnvironmentPreparedEvent event)
- 指定者:
onApplicationEvent
在接口中org.springframework.context.ApplicationListener<ApplicationEnvironmentPreparedEvent>