Open a file from the local filesystem @param runnableFileOpener The RunnableFileOpener object that can be used to open the file @throws FileNotFoundException When the file could not be found
(final RunnableFileOpener runnableFileOpener)
| 33 | * @throws FileNotFoundException When the file could not be found |
| 34 | */ |
| 35 | public void openFile(final RunnableFileOpener runnableFileOpener) throws FileNotFoundException { |
| 36 | if (runnableFileOpener == null) |
| 37 | throw new NullPointerException("RunnableFileOpener cannot be null!"); |
| 38 | |
| 39 | logger.info("Attempting to open file from filesystem {}", runnableFileOpener.getFileLocation()); |
| 40 | |
| 41 | final Path filePath = Paths.get(runnableFileOpener.getFileLocation()); |
| 42 | |
| 43 | if (!Files.exists(filePath)) |
| 44 | throw new FileNotFoundException(String.format("File (%s) does not exist!", runnableFileOpener.getFileLocation())); |
| 45 | |
| 46 | new Thread(runnableFileOpener).start(); |
| 47 | } |
| 48 | |
| 49 | /** |
| 50 | * Open a file from resources |
nothing calls this directly
no test coverage detected