MCPcopy Create free account
hub / github.com/BaseXdb/basex / paths

Method paths

basex-core/src/main/java/org/basex/index/resource/Docs.java:104–128  ·  view source on GitHub ↗

Returns a list with the document paths. @return document paths

()

Source from the content-addressed store, hash-verified

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.

Callers 9

writeMethod · 0.95
orderMethod · 0.95
insertMethod · 0.95
deleteMethod · 0.95
renameMethod · 0.95
docsMethod · 0.95
docMethod · 0.95
isDirMethod · 0.95
toStringMethod · 0.95

Calls 10

debugMethod · 0.95
docsMethod · 0.95
addMethod · 0.95
normalizeMethod · 0.95
getMethod · 0.95
updateMethod · 0.95
dbFileMethod · 0.80
readTokensMethod · 0.80
sizeMethod · 0.65
textMethod · 0.45

Tested by

no test coverage detected