src/main/resources 폴더의 xml 파일 읽는법

1 min read

Resource resource = appContext.getResource("classpath:data.xml");
Properties properties = new Properties();

try (InputStream is = resource.getInputStream()) {
    properties.loadFromXML(is);
} catch (IOException e) {
    e.printStackTrace();
}

© 2021 Raegon Kim