]> source.dussan.org Git - jgit.git/commitdiff
Expose LFS operation strings as public constants 05/88605/2
authorDavid Pursehouse <david.pursehouse@gmail.com>
Fri, 13 Jan 2017 01:54:04 +0000 (10:54 +0900)
committerMatthias Sohn <matthias.sohn@sap.com>
Fri, 13 Jan 2017 23:23:33 +0000 (19:23 -0400)
So that they can be used either by third party LFS server implementations
or from within other parts of JGit's internal LFS implementation.

Change-Id: I58da6230247204588e017c010ce5b14e4615448d
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/TransferHandler.java
org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/Constants.java

index bf5b61cc6e0f7e62916dd32bd550ddbc9abe02f6..86ca2d38b86e25d0fcba8489dfad57fcffd8122c 100644 (file)
@@ -44,6 +44,9 @@
 package org.eclipse.jgit.lfs.server;
 
 import static javax.servlet.http.HttpServletResponse.SC_NOT_FOUND;
+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.IOException;
 import java.text.MessageFormat;
@@ -58,18 +61,14 @@ import org.eclipse.jgit.lfs.server.internal.LfsServerText;
 
 abstract class TransferHandler {
 
-       private static final String DOWNLOAD = "download"; //$NON-NLS-1$
-       private static final String UPLOAD = "upload"; //$NON-NLS-1$
-       private static final String VERIFY = "verify"; //$NON-NLS-1$
-
        static TransferHandler forOperation(String operation,
                        LargeFileRepository repository, List<LfsObject> objects) {
                switch (operation) {
-               case TransferHandler.UPLOAD:
+               case UPLOAD:
                        return new Upload(repository, objects);
-               case TransferHandler.DOWNLOAD:
+               case DOWNLOAD:
                        return new Download(repository, objects);
-               case TransferHandler.VERIFY:
+               case VERIFY:
                default:
                        throw new UnsupportedOperationException(MessageFormat.format(
                                        LfsServerText.get().unsupportedOperation, operation));
index a88057afcee55e70543c7d63e22b016315337311..0220743724e616b8ef2a45a2a55ce9121758e145 100644 (file)
@@ -86,6 +86,27 @@ public final class Constants {
        public static final int LONG_OBJECT_ID_STRING_LENGTH = LONG_OBJECT_ID_LENGTH
                        * 2;
 
+       /**
+        * LFS upload operation.
+        *
+        * @since 4.7
+        */
+       public static final String UPLOAD = "upload";
+
+       /**
+        * LFS download operation.
+        *
+        * @since 4.7
+        */
+       public static final String DOWNLOAD = "download";
+
+       /**
+        * LFS verify operation.
+        *
+        * @since 4.7
+        */
+       public static final String VERIFY = "verify";
+
        /**
         * Create a new digest function for objects.
         *