项目简要:关于java web的一个项目,用的Spring MVCd 框架。鉴于参与此次项目的人中并不是所人都做的Spring,为了能够提高效率,建议大家是先抛开SPring来写自己负责的模块,最后再把各个模块在Spring里面集成。
1| package com.car.util.nlp;
2|
3| import com.hankcs.hanlp.corpus.io.IIOAdapter;
4| import org.springframework.core.io.ClassPathResource;
5| import java.io.*;
6|
7| public class ResourcesFileIoAdapter implements IIOAdapter{
8| @Override
9| public InputStream open(String path) throws IOException {
10| ClassPathResource resource = new ClassPathResource(path);
11| InputStream is = new FileInputStream(resource.getFile());
12| return is;
13| }
14| @Override
15| public OutputStream create(String path) throws IOException{
16| ClassPathResource resource = new ClassPathResource(path);
17| OutputStream os = new
18| FileOutputStream(resource.getFile());
19| return os;
20| }
21| }
1| root=
2|
3| IOAdapte=com.car.util.nlp.ResourcesFileIoAdapter