Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

14
LINES

< > BotCompany Repo | #1012228 // extractFileFromZipFile

JavaX fragment (include)

static void extractFileFromZipFile(File inZip, S fileName, File destFile) ctex {
  ZipFile zip = new ZipFile(inZip);
  try {
    extractFileFromZipFile(zip, fileName, destFile);
  } finally {
    zip.close();
  }
}
    
static void extractFileFromZipFile(ZipFile zip, S fileName, File destFile) ctex {
  ZipEntry entry = zip.getEntry(fileName);
  if (entry == null) fail("File not found in zip: " + zip + " / " + fileName);
  saveStream(zip.getInputStream(entry), destFile);
}

Author comment

Began life as a copy of #1002031

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1012228
Snippet name: extractFileFromZipFile
Eternal ID of this version: #1012228/1
Text MD5: f69b01240b5b79cc614139b018856fa6
Author: stefan
Category: javax / i.o.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-11-24 13:27:13
Source code size: 489 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 437 / 459
Referenced in: [show references]