MCPcopy Create free account
hub / github.com/CodeDead/opal / openFile

Method openFile

src/main/java/com/codedead/opal/utils/HelpUtils.java:35–47  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

getFileLocationMethod · 0.80
startMethod · 0.80

Tested by

no test coverage detected