Writes a map to a directory. @param output File location of root directory. @param content Contents to write to location. @throws IOException When a file cannot be written to.
(File output, Map<String, byte[]> content)
| 110 | * When a file cannot be written to. |
| 111 | */ |
| 112 | public static void writeDirectory(File output, Map<String, byte[]> content) throws IOException { |
| 113 | for (Map.Entry<String, byte[]> entry : content.entrySet()) { |
| 114 | String name = entry.getKey(); |
| 115 | byte[] out = entry.getValue(); |
| 116 | for (ExportInterceptorPlugin interceptor : PluginsManager.getInstance() |
| 117 | .ofType(ExportInterceptorPlugin.class)) { |
| 118 | out = interceptor.intercept(name, out); |
| 119 | } |
| 120 | Path path = Paths.get(output.getAbsolutePath(), name); |
| 121 | Files.createDirectories(path.getParent()); |
| 122 | Files.write(path, out); |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | /** |
| 127 | * Writes a map to an archive. |