MCPcopy
hub / github.com/Col-E/Recaf / writeDirectory

Method writeDirectory

src/main/java/me/coley/recaf/command/impl/Export.java:112–124  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.

Callers 1

callMethod · 0.95

Calls 8

getInstanceMethod · 0.95
entrySetMethod · 0.80
getKeyMethod · 0.80
ofTypeMethod · 0.80
interceptMethod · 0.65
getValueMethod · 0.45
getMethod · 0.45
getParentMethod · 0.45

Tested by

no test coverage detected