comparison artifact-database/src/main/java/de/intevation/artifactdatabase/StringUtils.java @ 231:1ea35226a6de

Database cleaner: Ignoring locked artifacts is now done on database level. artifacts/trunk@1635 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 31 Mar 2011 15:56:50 +0000
parents 933bbc9fc11f
children 23ec48ce717e
comparison
equal deleted inserted replaced
230:fbd57d2eeaef 231:1ea35226a6de
79 } 79 }
80 catch (DecoderException de) { 80 catch (DecoderException de) {
81 return null; 81 return null;
82 } 82 }
83 } 83 }
84
85 public static final String repeat(String s, int count, String sep) {
86 if (count <= 0) {
87 return "";
88 }
89 StringBuilder sb = new StringBuilder(s);
90 for (--count; count >= 0; --count) {
91 sb.append(sep).append(s);
92 }
93 return sb.toString();
94 }
95
96 public static final String repeat(char c, int count, char sep) {
97 if (count <= 0) {
98 return "";
99 }
100 StringBuilder sb = new StringBuilder(2*count-1).append(c);
101 for (--count; count >= 0; --count) {
102 sb.append(sep).append(c);
103 }
104 return sb.toString();
105 }
84 } 106 }
85 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 107 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org