Browse Source

Merge changes Id89b3cd0,I5b0fb122

* changes:
  FileLfsServlet: Make sendError protected
  Make ObjectUploadListener public
stable-4.6
Shawn Pearce 8 years ago committed by Gerrit Code Review @ Eclipse.org
parent
commit
013a4b84fd
  1. 14
      org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/FileLfsServlet.java
  2. 11
      org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/ObjectUploadListener.java

14
org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/FileLfsServlet.java

@ -173,7 +173,19 @@ public class FileLfsServlet extends HttpServlet {
}
}
static void sendError(HttpServletResponse rsp, int status, String message)
/**
* Send an error response.
*
* @param rsp
* the servlet response
* @param status
* HTTP status code
* @param message
* error message
* @throws IOException
* on failure to send the response
*/
protected static void sendError(HttpServletResponse rsp, int status, String message)
throws IOException {
rsp.setStatus(status);
PrintWriter writer = rsp.getWriter();

11
org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/ObjectUploadListener.java

@ -64,9 +64,11 @@ import org.eclipse.jgit.lfs.lib.AnyLongObjectId;
import org.eclipse.jgit.lfs.lib.Constants;
/**
* Handle asynchronous object upload
* Handle asynchronous object upload.
*
* @since 4.6
*/
class ObjectUploadListener implements ReadListener {
public class ObjectUploadListener implements ReadListener {
private static Logger LOG = Logger
.getLogger(ObjectUploadListener.class.getName());
@ -139,6 +141,9 @@ class ObjectUploadListener implements ReadListener {
close();
}
/**
* @throws IOException
*/
protected void close() throws IOException {
try {
inChannel.close();
@ -174,4 +179,4 @@ class ObjectUploadListener implements ReadListener {
LOG.log(Level.SEVERE, ex.getMessage(), ex);
}
}
}
}

Loading…
Cancel
Save