MCPcopy Index your code
hub / github.com/OpenSourcePhysics/osp / getFileList

Method getFileList

src/test/AssetsTest.java:100–118  ·  view source on GitHub ↗
(String zipPath)

Source from the content-addressed store, hash-verified

98 }
99
100 public void getFileList(String zipPath) {
101 // The problem here is that assets needs to be a URI path in Java.
102 Map<String, ZipEntry> map = Assets.getZipContents(zipPath);
103 if (map == null) {
104 System.err.println("Map is null: " + zipPath);
105 return;
106 }
107 List<String> list = new ArrayList<>();
108 list.add("");
109 for (Map.Entry<String, ZipEntry> entry : map.entrySet()) {
110 ZipEntry val = entry.getValue();
111 list.add(rightFill(val.getName(), 70) + leftFill(""+ val.getSize(), 8) + " bytes");
112 }
113 String[] s = list.toArray(new String[list.size()]);
114 Arrays.sort(s);
115 OSPLog.debug(Arrays.toString(s).replace(",", "\n").replaceAll("[\\[\\]]", ""));
116
117
118 }
119
120 private String leftFill(String name, int n) {
121 name = " " + name;

Callers 1

AssetsTestMethod · 0.95

Calls 12

getZipContentsMethod · 0.95
rightFillMethod · 0.95
leftFillMethod · 0.95
debugMethod · 0.95
toArrayMethod · 0.80
printlnMethod · 0.65
getValueMethod · 0.65
getNameMethod · 0.65
getSizeMethod · 0.65
addMethod · 0.45
sortMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected