- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {FileOutputStream f =
File file;new FileOutputStream(file)
String name;new FileOutputStream(name)
File file;new FileOutputStream(file, true)
- Smart code suggestions by Codota
}
/** * Uses all possible methods to find out this resource. * * @param clazz * @param path * @return */ public static InputStream getStream(String path) { InputStream inputStream = ResourceUtils.class.getResourceAsStream(path); if (inputStream == null) { inputStream = ResourceUtils.class.getClassLoader().getResourceAsStream(path); } if (inputStream == null) { inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(path); } if (inputStream == null) { inputStream = getFromStringContext(path); } if (inputStream == null) { System.out.println("Definitly Resource not found : " + path); } return inputStream; }
/** * Uses all possible methods to find out this resource. * * @param clazz * @param path * @return */ public static InputStream getStream(Class clazz, String path) { InputStream inputStream = clazz.getResourceAsStream(path); if (inputStream == null) { inputStream = clazz.getClassLoader().getResourceAsStream(path); } if (inputStream == null) { inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(path); } if (inputStream == null) { inputStream = getFromStringContext(path); } if (inputStream == null) { System.out.println("Definitly Resource not found : " + path); } return inputStream; }