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

Method resource

basex-core/src/main/java/org/basex/query/func/db/DbList.java:85–94  ·  view source on GitHub ↗

Creates a resource element. @param path path to resource @param mdate modified date @param size size @param type resource type @return resource node

(final String path, final long mdate, final long size,
      final ResourceType type)

Source from the content-addressed store, hash-verified

83 * @return resource node
84 */
85 static FNode resource(final String path, final long mdate, final long size,
86 final ResourceType type) {
87
88 final FBuilder elem = FElem.build(Q_RESOURCE).text(path);
89 elem.attr(Q_TYPE, type);
90 elem.attr(Q_CONTENT_TYPE, type.contentType(path));
91 elem.attr(Q_MODIFIED_DATE, DateTime.format(new Date(mdate)));
92 elem.attr(Q_SIZE, size);
93 return elem.finish();
94 }
95}

Callers 2

getMethod · 0.45
elemMethod · 0.45

Calls 6

buildMethod · 0.95
attrMethod · 0.95
formatMethod · 0.95
finishMethod · 0.95
textMethod · 0.45
contentTypeMethod · 0.45

Tested by

no test coverage detected