resouceloader - > classloader

   for
      maven package error
This commit is contained in:
snoop 2017-04-27 10:54:02 +09:00
parent d3da1158ea
commit c3f8889bdd

View File

@ -106,7 +106,8 @@ public class WMICrawlerTest {
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
String p = ResourceLoader.class.getClass().getResource("/config/example.json").getPath(); ClassLoader classLoader = getClass().getClassLoader();
String p = classLoader.getResource("config/example.json").getFile();
System.out.println(p); System.out.println(p);
@ -121,7 +122,8 @@ public class WMICrawlerTest {
public void testWMIJson() throws Exception { public void testWMIJson() throws Exception {
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
String p = ResourceLoader.class.getClass().getResource("/config/example.json").getPath(); ClassLoader classLoader = getClass().getClassLoader();
String p = classLoader.getResource("config/example.json").getFile();
Config c = mapper.readValue(new File(p),Config.class); Config c = mapper.readValue(new File(p),Config.class);
// Map<String, Object> map = new HashMap<>(); // Map<String, Object> map = new HashMap<>();