| 1 |
|
package net.sourceforge.pebble.util; |
| 2 |
|
|
| 3 |
|
import net.sourceforge.pebble.domain.Blog; |
| 4 |
|
import org.apache.commons.logging.Log; |
| 5 |
|
import org.apache.commons.logging.LogFactory; |
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
@author |
| 11 |
|
|
|
|
|
| 0% |
Uncovered Elements: 11 (11) |
Complexity: 6 |
Complexity Density: 0,75 |
|
| 12 |
|
public class UpgradeUtilities { |
| 13 |
|
|
| 14 |
|
|
| 15 |
|
private static final Log log = LogFactory.getLog(UpgradeUtilities.class); |
| 16 |
|
|
|
|
|
| 0% |
Uncovered Elements: 10 (10) |
Complexity: 6 |
Complexity Density: 0,75 |
|
| 17 |
0
|
public static void upgradeBlog(Blog blog, String fromVersion, String toVersion) throws Exception {... |
| 18 |
0
|
log.info("Upgrading blog from " + fromVersion + " to " + toVersion); |
| 19 |
0
|
if (fromVersion == null |
| 20 |
|
|| fromVersion.startsWith("2.3") |
| 21 |
|
|| fromVersion.startsWith("2.2") |
| 22 |
|
|| fromVersion.startsWith("2.1") |
| 23 |
|
|| fromVersion.startsWith("2.0")) { |
| 24 |
0
|
log.info("restructuring static pages"); |
| 25 |
0
|
Utilities.restructureStaticPages(blog); |
| 26 |
0
|
log.info("building indizes"); |
| 27 |
0
|
Utilities.buildIndexes(blog); |
| 28 |
0
|
log.info("upgrade done"); |
| 29 |
|
} else { |
| 30 |
0
|
log.info("No upgrade required"); |
| 31 |
|
} |
| 32 |
|
} |
| 33 |
|
|
| 34 |
|
} |