From 4fcac9d2cbdafb51e3ee9ca3b3da64fd86103174 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Tue, 26 Nov 2013 15:58:15 -0500
Subject: [PATCH] Remove artifact setting from manager dialog

---
 src/main/java/com/gitblit/DownloadZipServlet.java |   29 ++++++++++++++---------------
 1 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/src/main/java/com/gitblit/DownloadZipServlet.java b/src/main/java/com/gitblit/DownloadZipServlet.java
index 8a4a710..c8da267 100644
--- a/src/main/java/com/gitblit/DownloadZipServlet.java
+++ b/src/main/java/com/gitblit/DownloadZipServlet.java
@@ -16,7 +16,6 @@
 package com.gitblit;
 
 import java.io.IOException;
-import java.net.SocketException;
 import java.text.MessageFormat;
 import java.text.ParseException;
 import java.util.Date;
@@ -38,25 +37,25 @@
 /**
  * Streams out a zip file from the specified repository for any tree path at any
  * revision.
- * 
+ *
  * @author James Moger
- * 
+ *
  */
 public class DownloadZipServlet extends HttpServlet {
 
 	private static final long serialVersionUID = 1L;
 
 	private transient Logger logger = LoggerFactory.getLogger(DownloadZipServlet.class);
-	
+
 	public static enum Format {
 		zip(".zip"), tar(".tar"), gz(".tar.gz"), xz(".tar.xz"), bzip2(".tar.bzip2");
-		
+
 		public final String extension;
-		
+
 		Format(String ext) {
 			this.extension = ext;
 		}
-		
+
 		public static Format fromName(String name) {
 			for (Format format : values()) {
 				if (format.name().equalsIgnoreCase(name)) {
@@ -73,7 +72,7 @@
 
 	/**
 	 * Returns an url to this servlet for the specified parameters.
-	 * 
+	 *
 	 * @param baseURL
 	 * @param repository
 	 * @param objectId
@@ -93,7 +92,7 @@
 
 	/**
 	 * Creates a zip stream from the repository of the requested data.
-	 * 
+	 *
 	 * @param request
 	 * @param response
 	 * @throws javax.servlet.ServletException
@@ -107,7 +106,7 @@
 			response.sendError(HttpServletResponse.SC_FORBIDDEN);
 			return;
 		}
-		
+
 		Format format = Format.zip;
 		String repository = request.getParameter("r");
 		String basePath = request.getParameter("p");
@@ -116,7 +115,7 @@
 		if (!StringUtils.isEmpty(f)) {
 			format = Format.fromName(f);
 		}
-		
+
 		try {
 			String name = repository;
 			if (name.indexOf('/') > -1) {
@@ -130,7 +129,7 @@
 			if (!StringUtils.isEmpty(objectId)) {
 				name += "-" + objectId;
 			}
-						
+
 			Repository r = GitBlit.self().getRepository(repository);
 			if (r == null) {
 				if (GitBlit.self().isCollectingGarbage(repository)) {
@@ -175,14 +174,14 @@
 					CompressionUtils.bzip2(r, basePath, objectId, response.getOutputStream());
 					break;
 				}
-				
+
 				response.flushBuffer();
-			} catch (SocketException t) {
+			} catch (IOException t) {
 				String message = t.getMessage() == null ? "" : t.getMessage().toLowerCase();
 				if (message.contains("reset") || message.contains("broken pipe")) {
 					logger.error("Client aborted zip download: " + message);
 				} else {
-					logger.error("Failed to write attachment to client", t);	
+					logger.error("Failed to write attachment to client", t);
 				}
 			} catch (Throwable t) {
 				logger.error("Failed to write attachment to client", t);

--
Gitblit v1.9.1