aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.lfs.server/src
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@gmail.com>2017-01-13 10:59:31 +0900
committerMatthias Sohn <matthias.sohn@sap.com>2017-01-14 01:07:52 +0100
commit55c629a9f39e3560ecb3682b95a5049a3bc2ea89 (patch)
tree8ab630e11a73a4a9cff711d16bff47e6b790912d /org.eclipse.jgit.lfs.server/src
parent56fe21778400195af2f6287f4894593edf305bd9 (diff)
downloadjgit-55c629a9f39e3560ecb3682b95a5049a3bc2ea89.tar.gz
jgit-55c629a9f39e3560ecb3682b95a5049a3bc2ea89.zip
LfsProtocolServlet#LfsRequest: Add operation type helper methods
Server implementations may need to check what type of operation is being performed. Add helper methods to make it a bit simpler. Change-Id: Ia33ed6699ebcb9000ef514ce79bcddbebf94e1c5 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.lfs.server/src')
-rw-r--r--org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/LfsProtocolServlet.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/LfsProtocolServlet.java b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/LfsProtocolServlet.java
index b741693fd6..e774eba7d2 100644
--- a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/LfsProtocolServlet.java
+++ b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/LfsProtocolServlet.java
@@ -51,6 +51,9 @@ import static org.apache.http.HttpStatus.SC_OK;
import static org.apache.http.HttpStatus.SC_SERVICE_UNAVAILABLE;
import static org.apache.http.HttpStatus.SC_UNAUTHORIZED;
import static org.apache.http.HttpStatus.SC_UNPROCESSABLE_ENTITY;
+import static org.eclipse.jgit.lfs.lib.Constants.DOWNLOAD;
+import static org.eclipse.jgit.lfs.lib.Constants.UPLOAD;
+import static org.eclipse.jgit.lfs.lib.Constants.VERIFY;
import java.io.BufferedReader;
import java.io.BufferedWriter;
@@ -171,6 +174,30 @@ public abstract class LfsProtocolServlet extends HttpServlet {
public List<LfsObject> getObjects() {
return objects;
}
+
+ /**
+ * @return true if the operation is upload.
+ * @since 4.7
+ */
+ public boolean isUpload() {
+ return operation.equals(UPLOAD);
+ }
+
+ /**
+ * @return true if the operation is download.
+ * @since 4.7
+ */
+ public boolean isDownload() {
+ return operation.equals(DOWNLOAD);
+ }
+
+ /**
+ * @return true if the operation is verify.
+ * @since 4.7
+ */
+ public boolean isVerify() {
+ return operation.equals(VERIFY);
+ }
}
@Override