summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/gitblit/utils/JGitUtils.java
diff options
context:
space:
mode:
authorFlorian Zschocke <florian.zschocke@cycos.com>2013-08-20 14:32:23 +0200
committerFlorian Zschocke <florian.zschocke@cycos.com>2013-08-26 12:39:57 +0200
commit1dee25369809919eba0d72e6811d5132f5ee9118 (patch)
tree8745c7892e9ff333e34a9fa9581d398dcf693a4b /src/main/java/com/gitblit/utils/JGitUtils.java
parent3a067e5b667bb30b7ddd18f7860358d725f01219 (diff)
downloadgitblit-1dee25369809919eba0d72e6811d5132f5ee9118.tar.gz
gitblit-1dee25369809919eba0d72e6811d5132f5ee9118.zip
Add JavaDoc.
Diffstat (limited to 'src/main/java/com/gitblit/utils/JGitUtils.java')
-rw-r--r--src/main/java/com/gitblit/utils/JGitUtils.java21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/main/java/com/gitblit/utils/JGitUtils.java b/src/main/java/com/gitblit/utils/JGitUtils.java
index 49b3ad70..57bb147f 100644
--- a/src/main/java/com/gitblit/utils/JGitUtils.java
+++ b/src/main/java/com/gitblit/utils/JGitUtils.java
@@ -266,7 +266,7 @@ public class JGitUtils {
/**
* Creates a bare, shared repository.
- *
+ *
* @param repositoriesFolder
* @param name
* @param shared
@@ -372,13 +372,32 @@ public class JGitUtils {
}
+ /**
+ * Adjust file permissions of a file/directory for shared repositories
+ *
+ * @param path
+ * File that should get its permissions changed.
+ * @param configShared
+ * Configuration string value for the shared mode.
+ * @return Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned.
+ */
public static int adjustSharedPerm(File path, String configShared) {
return adjustSharedPerm(path, new GitConfigSharedRepository(configShared));
}
+ /**
+ * Adjust file permissions of a file/directory for shared repositories
+ *
+ * @param path
+ * File that should get its permissions changed.
+ * @param configShared
+ * Configuration setting for the shared mode.
+ * @return Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned.
+ */
public static int adjustSharedPerm(File path, GitConfigSharedRepository configShared) {
if (! configShared.isShared()) return 0;
+ if (! path.exists()) return -1;
int perm = configShared.getPerm();
int mode = JnaUtils.getFilemode(path);