Hybris95
2014-04-22 3f5b8f5d9203aa7ffb7fbe9cdbaf9dba3da6cae6
src/main/java/com/gitblit/wicket/pages/BasePage.java
@@ -15,6 +15,8 @@
 */
package com.gitblit.wicket.pages;
import java.io.IOException;
import java.io.InputStream;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Calendar;
@@ -31,6 +33,7 @@
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.io.IOUtils;
import org.apache.wicket.Application;
import org.apache.wicket.Page;
import org.apache.wicket.PageParameters;
@@ -89,6 +92,9 @@
   private void customizeHeader() {
      if (app().settings().getBoolean(Keys.web.useResponsiveLayout, true)) {
         add(CSSPackageResource.getHeaderContribution("bootstrap/css/bootstrap-responsive.css"));
      }
      if (app().settings().getBoolean(Keys.web.hideHeader, false)) {
         add(CSSPackageResource.getHeaderContribution("hideheader.css"));
      }
   }
@@ -460,4 +466,26 @@
      }
      error(message, true);
   }
   protected String readResource(String resource) {
      StringBuilder sb = new StringBuilder();
      InputStream is = null;
      try {
         is = getClass().getResourceAsStream(resource);
         List<String> lines = IOUtils.readLines(is);
         for (String line : lines) {
            sb.append(line).append('\n');
         }
      } catch (IOException e) {
      } finally {
         if (is != null) {
            try {
               is.close();
            } catch (IOException e) {
            }
         }
      }
      return sb.toString();
   }
}