Skip to content

Commit 78046e1

Browse files
committed
add/improve javadoc
1 parent 03d5ef1 commit 78046e1

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

opengrok-web/src/main/java/org/opengrok/web/PageConfig.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919

2020
/*
21-
* Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
21+
* Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
2222
* Portions Copyright (c) 2011, Jens Elkner.
2323
* Portions Copyright (c) 2017, 2020, Chris Fraire <[email protected]>.
2424
* Portions Copyright (c) 2023, Gino Augustine <[email protected]>.
@@ -1101,7 +1101,10 @@ public Prefix getPrefix() {
11011101
* Get the canonical path of the related resource relative to the source
11021102
* root directory (used file separators are all {@link org.opengrok.indexer.index.Indexer#PATH_SEPARATOR}).
11031103
* No check is made, whether the obtained path is really an accessible resource on disk.
1104-
*
1104+
* <p>
1105+
* Also, care needs to be taken when embedding the result in a page. Consider using {@link Util#htmlize(String)}
1106+
* or {@link Util#uriEncodePath(String)}.
1107+
* </p>
11051108
* @return a possible empty String (denotes the source root directory) but not {@code null}.
11061109
* @see HttpServletRequest#getPathInfo()
11071110
*/
@@ -1738,6 +1741,9 @@ public String getHistoryTitle() {
17381741
return Util.htmlize(getShortPath(strPath) + " - OpenGrok history log for " + strPath);
17391742
}
17401743

1744+
/**
1745+
* @return page title string with base name of the path and optionally revision ID, HTML encoded
1746+
*/
17411747
public String getPathTitle() {
17421748
String strPath = getPath();
17431749
String title = getShortPath(strPath);

0 commit comments

Comments
 (0)