@Test public void testLoadFileAsImage() { System.out.println("loadFileAsImage"); File toRead = new File("/src/test/testfiles/eye.png"); BufferedImage expResult = null; BufferedImage result = FileLoader.loadFileAsImage(toRead); try { expResult = ImageIO.read(toRead); } catch (IOException e) { System.out.println("the Testfile eye.png could not be found"); } assertEquals(expResult, result); }
public static BufferedImage loadFileAsImage(File toRead) { BufferedImage toReturn = null; try { toReturn = ImageIO.read(toRead); } catch (IOException e) { ErrorLogger.log("The specified file: " + toRead.getAbsolutePath() + " couldn't be loaded"); } return toReturn; }
FileLoader { public static BufferedImage loadFileAsImage(File toRead) { BufferedImage toReturn = null; try { toReturn = ImageIO.read(toRead); } catch (IOException e) { ErrorLogger.log("The specified file: " + toRead.getAbsolutePath() + " couldn't be loaded"); } return toReturn; } }
FileLoader { public static BufferedImage loadFileAsImage(File toRead) { BufferedImage toReturn = null; try { toReturn = ImageIO.read(toRead); } catch (IOException e) { ErrorLogger.log("The specified file: " + toRead.getAbsolutePath() + " couldn't be loaded"); } return toReturn; } private  FileLoader(); }
FileLoader { public static BufferedImage loadFileAsImage(File toRead) { BufferedImage toReturn = null; try { toReturn = ImageIO.read(toRead); } catch (IOException e) { ErrorLogger.log("The specified file: " + toRead.getAbsolutePath() + " couldn't be loaded"); } return toReturn; } private  FileLoader(); static LinkedList<String> loadFileAsString(File file); static BufferedImage loadFileAsImage(File toRead); static synchronized String getNewUniqueName(String pathToDir); static List<String> listAllFilesFromFolder(String pathToDir, String endsWith); }
FileLoader { public static BufferedImage loadFileAsImage(File toRead) { BufferedImage toReturn = null; try { toReturn = ImageIO.read(toRead); } catch (IOException e) { ErrorLogger.log("The specified file: " + toRead.getAbsolutePath() + " couldn't be loaded"); } return toReturn; } private  FileLoader(); static LinkedList<String> loadFileAsString(File file); static BufferedImage loadFileAsImage(File toRead); static synchronized String getNewUniqueName(String pathToDir); static List<String> listAllFilesFromFolder(String pathToDir, String endsWith);  }