@Test public void testGetFileBytes_Throws_FileNotFoundException() { String testFilePath = "src/test/resources/DoesntExist.txt"; byte[] bytes = FactModelGuvnorUploader.getFileBytes(testFilePath); assertNull(bytes); }
static byte[] getFileBytes(String filePath) { byte[] data = null; try { data = IOUtils.toByteArray(new FileInputStream(filePath)); } catch (FileNotFoundException e) { LOGGER.error("ERROR: File not found"); LOGGER.error(e.getMessage(), e); } catch (IOException e) { LOGGER.error("ERROR: IOException"); LOGGER.error(e.getMessage(), e); } return data; }
FactModelGuvnorUploader { static byte[] getFileBytes(String filePath) { byte[] data = null; try { data = IOUtils.toByteArray(new FileInputStream(filePath)); } catch (FileNotFoundException e) { LOGGER.error("ERROR: File not found"); LOGGER.error(e.getMessage(), e); } catch (IOException e) { LOGGER.error("ERROR: IOException"); LOGGER.error(e.getMessage(), e); } return data; } }
FactModelGuvnorUploader { static byte[] getFileBytes(String filePath) { byte[] data = null; try { data = IOUtils.toByteArray(new FileInputStream(filePath)); } catch (FileNotFoundException e) { LOGGER.error("ERROR: File not found"); LOGGER.error(e.getMessage(), e); } catch (IOException e) { LOGGER.error("ERROR: IOException"); LOGGER.error(e.getMessage(), e); } return data; }  }
FactModelGuvnorUploader { static byte[] getFileBytes(String filePath) { byte[] data = null; try { data = IOUtils.toByteArray(new FileInputStream(filePath)); } catch (FileNotFoundException e) { LOGGER.error("ERROR: File not found"); LOGGER.error(e.getMessage(), e); } catch (IOException e) { LOGGER.error("ERROR: IOException"); LOGGER.error(e.getMessage(), e); } return data; }  static void main(String[] args); }
FactModelGuvnorUploader { static byte[] getFileBytes(String filePath) { byte[] data = null; try { data = IOUtils.toByteArray(new FileInputStream(filePath)); } catch (FileNotFoundException e) { LOGGER.error("ERROR: File not found"); LOGGER.error(e.getMessage(), e); } catch (IOException e) { LOGGER.error("ERROR: IOException"); LOGGER.error(e.getMessage(), e); } return data; }  static void main(String[] args);  }