Java 读取配置文件数据
- 配置文件
读取文件配置
@Data
@Component
@ConfigurationProperties(value = "app")
public class AppProperties {
/**
* 上传路径
*/
private String uploadPath = "";
/**
* 下载路径
*/
private String downloadPath = "";
/**
* 文件类型
*/
private String[] fileTypeArray;
/**
* 文件大小
*/
private int maxFileSize;
}
- 使用方式