MCPcopy Index your code
hub / github.com/processing/processing / addDataFolder

Method addDataFolder

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

Source from the content-addressed store, hash-verified

1293
1294
1295 protected void addDataFolder(ZipOutputStream zos) throws IOException {
1296 if (sketch.hasDataFolder()) {
1297 String[] dataFiles = Util.listFiles(sketch.getDataFolder(), false);
1298 int offset = sketch.getFolder().getAbsolutePath().length() + 1;
1299 for (String path : dataFiles) {
1300 if (Platform.isWindows()) {
1301 path = path.replace('\\', '/');
1302 }
1303 //File dataFile = new File(dataFiles[i]);
1304 File dataFile = new File(path);
1305 if (!dataFile.isDirectory()) {
1306 // don't export hidden files
1307 // skipping dot prefix removes all: . .. .DS_Store
1308 if (dataFile.getName().charAt(0) != '.') {
1309 ZipEntry entry = new ZipEntry(path.substring(offset));
1310 zos.putNextEntry(entry);
1311 //zos.write(Base.loadBytesRaw(dataFile));
1312 PApplet.saveStream(zos, new FileInputStream(dataFile));
1313 zos.closeEntry();
1314 }
1315 }
1316 }
1317 }
1318 }
1319
1320
1321 /**

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