summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/gitblit/SparkleShareInviteServlet.java
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2013-09-30 09:30:04 -0400
committerJames Moger <james.moger@gitblit.com>2013-09-30 10:11:28 -0400
commit699e71e76b15081baf746c6ce9c9144f7e5f1ff9 (patch)
tree4a9ea25c258caeae3dea4bc1de809f47bc615d81 /src/main/java/com/gitblit/SparkleShareInviteServlet.java
parent235ad956fa84cad4fac1b2e69a0c9e4f50376ea3 (diff)
downloadgitblit-699e71e76b15081baf746c6ce9c9144f7e5f1ff9.tar.gz
gitblit-699e71e76b15081baf746c6ce9c9144f7e5f1ff9.zip
Trim trailing whitespace and organize imports
Change-Id: I9f91138b20219be6e3c4b28251487df262bff6cc
Diffstat (limited to 'src/main/java/com/gitblit/SparkleShareInviteServlet.java')
-rw-r--r--src/main/java/com/gitblit/SparkleShareInviteServlet.java22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/main/java/com/gitblit/SparkleShareInviteServlet.java b/src/main/java/com/gitblit/SparkleShareInviteServlet.java
index 14d281a3..11a58dd1 100644
--- a/src/main/java/com/gitblit/SparkleShareInviteServlet.java
+++ b/src/main/java/com/gitblit/SparkleShareInviteServlet.java
@@ -29,9 +29,9 @@ import com.gitblit.utils.StringUtils;
/**
* Handles requests for Sparkleshare Invites
- *
+ *
* @author James Moger
- *
+ *
*/
public class SparkleShareInviteServlet extends HttpServlet {
@@ -40,7 +40,7 @@ public class SparkleShareInviteServlet extends HttpServlet {
public SparkleShareInviteServlet() {
super();
}
-
+
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, java.io.IOException {
@@ -55,8 +55,8 @@ public class SparkleShareInviteServlet extends HttpServlet {
protected void processRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException,
- java.io.IOException {
-
+ java.io.IOException {
+
// extract repo name from request
String repoUrl = request.getPathInfo().substring(1);
@@ -64,11 +64,11 @@ public class SparkleShareInviteServlet extends HttpServlet {
if (repoUrl.endsWith(".xml")) {
repoUrl = repoUrl.substring(0, repoUrl.length() - 4);
}
-
+
String servletPath = Constants.GIT_PATH;
-
+
int schemeIndex = repoUrl.indexOf("://") + 3;
- String host = repoUrl.substring(0, repoUrl.indexOf('/', schemeIndex));
+ String host = repoUrl.substring(0, repoUrl.indexOf('/', schemeIndex));
String path = repoUrl.substring(repoUrl.indexOf(servletPath) + servletPath.length());
String username = null;
int fetchIndex = repoUrl.indexOf('@');
@@ -85,7 +85,7 @@ public class SparkleShareInviteServlet extends HttpServlet {
user = UserModel.ANONYMOUS;
username = "";
}
-
+
// ensure that the requested repository exists
RepositoryModel model = GitBlit.self().getRepositoryModel(path);
if (model == null) {
@@ -93,8 +93,8 @@ public class SparkleShareInviteServlet extends HttpServlet {
response.getWriter().append(MessageFormat.format("Repository \"{0}\" not found!", path));
return;
}
-
- StringBuilder sb = new StringBuilder();
+
+ StringBuilder sb = new StringBuilder();
sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
sb.append("<sparkleshare><invite>\n");
sb.append(MessageFormat.format("<address>{0}</address>\n", host));