MCPcopy Create free account
hub / github.com/DGVPSH/SlackOpen / collectFilesZIP

Method collectFilesZIP

src/main/java/net/optifine/util/ResUtils.java:166–201  ·  view source on GitHub ↗
(File tpFile, String[] prefixes, String[] suffixes)

Source from the content-addressed store, hash-verified

164 }
165
166 private static String[] collectFilesZIP(File tpFile, String[] prefixes, String[] suffixes)
167 {
168 List list = new ArrayList();
169 String s = "assets/minecraft/";
170
171 try
172 {
173 ZipFile zipfile = new ZipFile(tpFile);
174 Enumeration enumeration = zipfile.entries();
175
176 while (enumeration.hasMoreElements())
177 {
178 ZipEntry zipentry = (ZipEntry)enumeration.nextElement();
179 String s1 = zipentry.getName();
180
181 if (s1.startsWith(s))
182 {
183 s1 = s1.substring(s.length());
184
185 if (StrUtils.startsWith(s1, prefixes) && StrUtils.endsWith(s1, suffixes))
186 {
187 list.add(s1);
188 }
189 }
190 }
191
192 zipfile.close();
193 String[] astring = (String[])((String[])list.toArray(new String[list.size()]));
194 return astring;
195 }
196 catch (IOException ioexception)
197 {
198 ioexception.printStackTrace();
199 return new String[0];
200 }
201 }
202
203 private static boolean isLowercase(String str)
204 {

Callers 1

collectFilesMethod · 0.95

Calls 8

startsWithMethod · 0.95
endsWithMethod · 0.95
lengthMethod · 0.80
getNameMethod · 0.65
closeMethod · 0.65
addMethod · 0.45
toArrayMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected