From 6f46fa34d3078399acaa962a89900ac5db3a6116 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Tue, 27 Dec 2011 17:31:50 -0500
Subject: [PATCH] Documentation.
---
src/com/gitblit/GitBlit.java | 32 +++++++++++++++++++++++++++++++-
1 files changed, 31 insertions(+), 1 deletions(-)
diff --git a/src/com/gitblit/GitBlit.java b/src/com/gitblit/GitBlit.java
index 835aa13..a468060 100644
--- a/src/com/gitblit/GitBlit.java
+++ b/src/com/gitblit/GitBlit.java
@@ -25,6 +25,7 @@
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
@@ -904,6 +905,11 @@
.format("Can not rename repository ''{0}'' to ''{1}'' because ''{1}'' already exists.",
repositoryName, repository.name));
}
+ File parentFile = destFolder.getParentFile();
+ if (!parentFile.exists() && !parentFile.mkdirs()) {
+ throw new GitBlitException(MessageFormat.format(
+ "Failed to create folder ''{0}''", parentFile.getAbsolutePath()));
+ }
if (!folder.renameTo(destFolder)) {
throw new GitBlitException(MessageFormat.format(
"Failed to rename repository ''{0}'' to ''{1}''.", repositoryName,
@@ -1478,6 +1484,30 @@
}
return scripts;
}
+
+ public List<String> getInheritedPreReceiveScripts(RepositoryModel repository) {
+ Set<String> globals = new HashSet<String>();
+ for (String script : getStrings(Keys.groovy.preReceiveScripts)) {
+ if (script.endsWith(".groovy")) {
+ globals.add(script.substring(0, script.lastIndexOf('.')));
+ } else {
+ globals.add(script);
+ }
+ }
+ return new ArrayList<String>(globals);
+ }
+
+ public List<String> getInheritedPostReceiveScripts(RepositoryModel repository) {
+ Set<String> globals = new HashSet<String>();
+ for (String script : getStrings(Keys.groovy.postReceiveScripts)) {
+ if (script.endsWith(".groovy")) {
+ globals.add(script.substring(0, script.lastIndexOf('.')));
+ } else {
+ globals.add(script);
+ }
+ }
+ return new ArrayList<String>(globals);
+ }
/**
* Notify the administrators by email.
@@ -1505,7 +1535,7 @@
* @param message
* @param toAddresses
*/
- public void sendMail(String subject, String message, ArrayList<String> toAddresses) {
+ public void sendMail(String subject, String message, Collection<String> toAddresses) {
this.sendMail(subject, message, toAddresses.toArray(new String[0]));
}
--
Gitblit v1.9.1