Advertisement
Guest User

Untitled

a guest
Nov 20th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. <dependency>
  2. <groupId>org.glassfish.jersey.core</groupId>
  3. <artifactId>jersey-client</artifactId>
  4. <version>2.25.1</version>
  5. </dependency>
  6.  
  7. <dependency>
  8. <groupId>org.glassfish.jersey.media</groupId>
  9. <artifactId>jersey-media-json-jackson</artifactId>
  10. <version>2.25.1</version>
  11. </dependency>
  12.  
  13. public static void main(String[] args) throws IOException {
  14. Map<String, String> map = new HashMap<String, String>();
  15. File f=new File("file.txt");
  16. System.out.println(f.getAbsolutePath());
  17. BufferedReader in = new BufferedReader(new FileReader("file.txt"));
  18. String line = "";
  19. while ((line = in.readLine()) != null) {
  20. String parts[] = line.split("\\s+");
  21. map.put(parts[0], parts[1]);
  22. }
  23. in.close();
  24. System.out.println(map.toString());
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement