From 0dccce1b5cffce03124f001ae03b66962f36fee6 Mon Sep 17 00:00:00 2001
From: Trygve Laugstøl <trygvis@inamo.no>
Date: Mon, 10 Oct 2011 10:49:29 -0400
Subject: [PATCH] o Adding missing properties to gitblit.properties for adjusting the context path.
---
src/com/gitblit/utils/FileUtils.java | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/src/com/gitblit/utils/FileUtils.java b/src/com/gitblit/utils/FileUtils.java
index 310e35a..73bef34 100644
--- a/src/com/gitblit/utils/FileUtils.java
+++ b/src/com/gitblit/utils/FileUtils.java
@@ -16,9 +16,12 @@
package com.gitblit.utils;
import java.io.BufferedReader;
+import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
+import java.io.FileOutputStream;
import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
import java.nio.charset.Charset;
/**
@@ -58,6 +61,25 @@
}
/**
+ * Writes the string content to the file.
+ *
+ * @param file
+ * @param content
+ */
+ public static void writeContent(File file, String content) {
+ try {
+ OutputStreamWriter os = new OutputStreamWriter(new FileOutputStream(file),
+ Charset.forName("UTF-8"));
+ BufferedWriter writer = new BufferedWriter(os);
+ writer.append(content);
+ writer.close();
+ } catch (Throwable t) {
+ System.err.println("Failed to write content of " + file.getAbsolutePath());
+ t.printStackTrace();
+ }
+ }
+
+ /**
* Recursively traverses a folder and its subfolders to calculate the total
* size in bytes.
*
--
Gitblit v1.9.1