| 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 |