MCPcopy Index your code
hub / github.com/benfry/processing4 / addDataFolder

Method addDataFolder

java/src/processing/mode/java/JavaBuild.java:1194–1217  ·  view source on GitHub ↗
(ZipOutputStream zos)

Source from the content-addressed store, hash-verified

1192
1193
1194 protected void addDataFolder(ZipOutputStream zos) throws IOException {
1195 if (sketch.hasDataFolder()) {
1196 String[] dataFiles = Util.listFiles(sketch.getDataFolder(), false);
1197 int offset = sketch.getFolder().getAbsolutePath().length() + 1;
1198 for (String path : dataFiles) {
1199 if (Platform.isWindows()) {
1200 path = path.replace('\\', '/');
1201 }
1202 //File dataFile = new File(dataFiles[i]);
1203 File dataFile = new File(path);
1204 if (!dataFile.isDirectory()) {
1205 // don't export hidden files
1206 // skipping dot prefix removes all: . .. .DS_Store
1207 if (dataFile.getName().charAt(0) != '.') {
1208 ZipEntry entry = new ZipEntry(path.substring(offset));
1209 zos.putNextEntry(entry);
1210 //zos.write(Base.loadBytesRaw(dataFile));
1211 PApplet.saveStream(zos, new FileInputStream(dataFile));
1212 zos.closeEntry();
1213 }
1214 }
1215 }
1216 }
1217 }
1218
1219
1220 /**

Callers

nothing calls this directly

Calls 8

listFilesMethod · 0.95
isWindowsMethod · 0.95
saveStreamMethod · 0.95
hasDataFolderMethod · 0.80
getDataFolderMethod · 0.80
getFolderMethod · 0.45
replaceMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected