Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions opengrok-web/src/main/java/org/opengrok/web/PageConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -1845,6 +1845,15 @@ public boolean isNotModified(HttpServletRequest request, HttpServletResponse res
return false;
}

/**
* @param root root path
* @param path path
* @return path relative to root
*/
public static String getRelativePath(String root, String path) {
return Paths.get(root).relativize(Paths.get(path)).toString();
}

@VisibleForTesting @NotNull String getEtag() {
return String.format("W/\"%s\"",
Objects.hash(
Expand Down