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

15
LINES

< > BotCompany Repo | #1034360 // countFilesInZip

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (5025L/28K).

static int countFilesInZip(File inZip) ctex {
  temp ZipFile zipFile = new ZipFile(inZip);
  ret countFilesInZip(zipFile);
}
      
static int countFilesInZip(ZipFile zipFile) ctex {
  int n = 0;
  Enumeration entries = zipFile.entries();
  while (entries.hasMoreElements()) {
    ZipEntry entry = cast entries.nextElement(); 
      if (!entry.isDirectory())
        ++n;
  }
  ret n;
}

Author comment

Began life as a copy of #1002029

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1034360
Snippet name: countFilesInZip
Eternal ID of this version: #1034360/1
Text MD5: 5ba8c0c9fd7d7c52c2c8195279e3d3be
Transpilation MD5: b98b7a3125969c717753388f9aaaacb3
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-02-03 06:54:52
Source code size: 402 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 186 / 242
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)