MCPcopy Create free account
hub / github.com/apache/tomcat / getSize

Method getSize

java/org/apache/catalina/session/FileStore.java:137–156  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

135
136
137 @Override
138 public int getSize() throws IOException {
139 // Acquire the list of files in our storage directory
140 File dir = directory();
141 if (dir == null) {
142 return 0;
143 }
144 String[] files = dir.list();
145
146 // Figure out which files are sessions
147 int keycount = 0;
148 if (files != null) {
149 for (String file : files) {
150 if (file.endsWith(FILE_EXT)) {
151 keycount++;
152 }
153 }
154 }
155 return keycount;
156 }
157
158
159 // --------------------------------------------------------- Public Methods

Callers 1

testFileStoreMethod · 0.95

Calls 3

directoryMethod · 0.95
endsWithMethod · 0.80
listMethod · 0.65

Tested by 1

testFileStoreMethod · 0.76