You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
614 B

  1. package com.sothr.imagetools.util;
  2. import java.io.InputStream;
  3. import java.net.URL;
  4. /**
  5. * Created by drew on 1/5/14.
  6. */
  7. public class FileLoader {
  8. private static final FileLoader instance = new FileLoader();
  9. private FileLoader() {}
  10. public static FileLoader get() {
  11. return instance;
  12. }
  13. public URL getResource(String location) {
  14. return Thread.currentThread().getContextClassLoader().getResource(location);
  15. }
  16. public InputStream getResourceStream(String location) {
  17. return Thread.currentThread().getContextClassLoader().getResourceAsStream(location);
  18. }
  19. }