()
| 2024 | |
| 2025 | |
| 2026 | static protected File getDefaultSketchbookFolder() { |
| 2027 | File sketchbookFolder = null; |
| 2028 | try { |
| 2029 | sketchbookFolder = Platform.getDefaultSketchbookFolder(); |
| 2030 | } catch (Exception e) { } |
| 2031 | |
| 2032 | if (sketchbookFolder == null) { |
| 2033 | Messages.showError("No sketchbook", |
| 2034 | "Problem while trying to get the sketchbook", null); |
| 2035 | } |
| 2036 | |
| 2037 | // create the folder if it doesn't exist already |
| 2038 | boolean result = true; |
| 2039 | if (!sketchbookFolder.exists()) { |
| 2040 | result = sketchbookFolder.mkdirs(); |
| 2041 | } |
| 2042 | |
| 2043 | if (!result) { |
| 2044 | Messages.showError("You forgot your sketchbook", |
| 2045 | "Processing cannot run because it could not\n" + |
| 2046 | "create a folder to store your sketchbook.", null); |
| 2047 | } |
| 2048 | |
| 2049 | return sketchbookFolder; |
| 2050 | } |
| 2051 | } |
no test coverage detected