(ZipOutputStream zos)
| 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 | /** |
nothing calls this directly
no test coverage detected