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

Method collectFilesFolder

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

Source from the content-addressed store, hash-verified

116 }
117
118 private static String[] collectFilesFolder(File tpFile, String basePath, String[] prefixes, String[] suffixes)
119 {
120 List list = new ArrayList();
121 String s = "assets/minecraft/";
122 File[] afile = tpFile.listFiles();
123
124 if (afile == null)
125 {
126 return new String[0];
127 }
128 else
129 {
130 for (int i = 0; i < afile.length; ++i)
131 {
132 File file1 = afile[i];
133
134 if (file1.isFile())
135 {
136 String s3 = basePath + file1.getName();
137
138 if (s3.startsWith(s))
139 {
140 s3 = s3.substring(s.length());
141
142 if (StrUtils.startsWith(s3, prefixes) && StrUtils.endsWith(s3, suffixes))
143 {
144 list.add(s3);
145 }
146 }
147 }
148 else if (file1.isDirectory())
149 {
150 String s1 = basePath + file1.getName() + "/";
151 String[] astring = collectFilesFolder(file1, s1, prefixes, suffixes);
152
153 for (int j = 0; j < astring.length; ++j)
154 {
155 String s2 = astring[j];
156 list.add(s2);
157 }
158 }
159 }
160
161 String[] astring1 = (String[])((String[])list.toArray(new String[list.size()]));
162 return astring1;
163 }
164 }
165
166 private static String[] collectFilesZIP(File tpFile, String[] prefixes, String[] suffixes)
167 {

Callers 1

collectFilesMethod · 0.95

Calls 7

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

Tested by

no test coverage detected