From 56fe21778400195af2f6287f4894593edf305bd9 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Fri, 13 Jan 2017 10:54:04 +0900 Subject: Expose LFS operation strings as public constants 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 --- .../src/org/eclipse/jgit/lfs/server/TransferHandler.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'org.eclipse.jgit.lfs.server') diff --git a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/TransferHandler.java b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/TransferHandler.java index bf5b61cc6e..86ca2d38b8 100644 --- a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/TransferHandler.java +++ b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/TransferHandler.java @@ -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 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)); -- cgit v1.2.3