Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Line 279 of https://github.com/freenet/fred/blob/next/src/freenet/client/async/ContainerInserter.java
- 279 /**
- 280 ** OutputStream os will be close()d if this method returns successfully.
- 281 */
- 282 private String createTarBucket(OutputStream os) throws IOException {
- 283 if(logMINOR) Logger.minor(this, "Create a TAR Bucket");
- 284
- 285 TarArchiveOutputStream tarOS = new TarArchiveOutputStream(os);
- 286 try {
- 287 tarOS.setLongFileMode(TarArchiveOutputStream.LONGFILE_GNU);
- 288 TarArchiveEntry ze;
- 289
- 290 for (ContainerElement ph : containerItems) {
- 291 if (logMINOR)
- 292 Logger.minor(this, "Putting into tar: " + ph + " data length " + ph.data.size() + " name " + ph.targetInArchive);
- 293 ze = new TarArchiveEntry(ph.targetInArchive);
- 294 ze.setModTime(0);
- 295 long size = ph.data.size();
- 296 ze.setSize(size);
- 297 tarOS.putArchiveEntry(ze);
- 298 BucketTools.copyTo(ph.data, tarOS, size);
- 299 tarOS.closeArchiveEntry();
- 300 }
- 301 } finally {
- 302 tarOS.close();
- 303 }
- 304
- 305 return ARCHIVE_TYPE.TAR.mimeTypes[0];
- 306 }
Advertisement
Add Comment
Please, Sign In to add comment