summaryrefslogtreecommitdiffstats
path: root/src/com/gitblit/utils/StringUtils.java
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2012-03-14 16:31:28 -0400
committerJames Moger <james.moger@gitblit.com>2012-03-14 16:31:28 -0400
commit6722961db100d58f8290d51768943fc6b416f7a9 (patch)
tree352c62494bb28e778a25e9739b732d419c44f2cc /src/com/gitblit/utils/StringUtils.java
parentd1c49a7dd7dc4dfd852fb2bca4533609432ea26a (diff)
downloadgitblit-6722961db100d58f8290d51768943fc6b416f7a9.tar.gz
gitblit-6722961db100d58f8290d51768943fc6b416f7a9.zip
A bunch more Lucene work
* Only list user-accessible repositories * Syntax-highlight matched blob fragments * Improve look and layout of search results
Diffstat (limited to 'src/com/gitblit/utils/StringUtils.java')
-rw-r--r--src/com/gitblit/utils/StringUtils.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/com/gitblit/utils/StringUtils.java b/src/com/gitblit/utils/StringUtils.java
index a465e0d7..adede1fa 100644
--- a/src/com/gitblit/utils/StringUtils.java
+++ b/src/com/gitblit/utils/StringUtils.java
@@ -485,4 +485,11 @@ public class StringUtils {
}
return value;
}
+
+ public static int countLines(String value) {
+ if (isEmpty(value)) {
+ return 0;
+ }
+ return value.split("\n").length;
+ }
} \ No newline at end of file