private final String PATH = "/mbp/file/cmbc/rechg/"+new SimpleDateFormat("yyyyMMdd").format(new Date())+"/单笔联机代付THWJ_XXX_"+new SimpleDateFormat("yyyyMMdd").format(new Date())+".txt";
private static final Logger log = Logger.getLogger(ReExchangeUpload.class);
@Override
public void execute(JobExecutionContext arg0) throws JobExecutionException {
List<String> list = new ArrayList<String>();
try {
File file = new File(PATH);
log.info("文件目录"+PATH);
if (file.isFile() && file.exists()) {
InputStreamReader isr = new InputStreamReader(new FileInputStream(file), "GBK");
BufferedReader br = new BufferedReader(isr);
String lineTxt = null;
while ((lineTxt = br.readLine()) != null) {
if ("########".equals(lineTxt)) {
break;
}
list.add(lineTxt);
}
br.close();
} else {
log.info("文件不存在");
return;
}
} catch (Exception e) {
log.info("文件读取失败");
}
![图片说明](https://img-ask.csdn.net/upload/201710/14/1507992995_395452.jpg)
![图片说明](https://img-ask.csdn.net/upload/201710/14/1507992962_571994.jpg)
文件地址没错,为什么读取失败了,求大神