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