Returns a list with the document paths. @return document paths
()
| 102 | * @return document paths |
| 103 | */ |
| 104 | private synchronized TokenList paths() { |
| 105 | if(pathList == null && pathIndex) { |
| 106 | // try to read paths from disk |
| 107 | try(DataInput in = new DataInput(data.meta.dbFile(DATAPTH))) { |
| 108 | pathList = new TokenList(in.readTokens()); |
| 109 | } catch(final IOException ex) { |
| 110 | Util.debug(ex); |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | // generate paths |
| 115 | if(pathList == null) { |
| 116 | // paths have not been stored to disk yet; scan table |
| 117 | final IntList docs = docs(); |
| 118 | final int ds = docs.size(); |
| 119 | final TokenList paths = new TokenList(ds); |
| 120 | for(int d = 0; d < ds; d++) { |
| 121 | paths.add(normalize(data.text(docs.get(d), true))); |
| 122 | } |
| 123 | pathIndex = true; |
| 124 | pathList = paths; |
| 125 | update(); |
| 126 | } |
| 127 | return pathList; |
| 128 | } |
| 129 | |
| 130 | /** |
| 131 | * Returns an array with offsets to the sorted document paths. |
no test coverage detected