@ -59,6 +59,7 @@ import java.io.InputStreamReader;
import java.io.OutputStreamWriter ;
import java.io.OutputStreamWriter ;
import java.io.Reader ;
import java.io.Reader ;
import java.io.Writer ;
import java.io.Writer ;
import java.text.MessageFormat ;
import java.util.List ;
import java.util.List ;
import javax.servlet.ServletException ;
import javax.servlet.ServletException ;
@ -75,6 +76,9 @@ import org.eclipse.jgit.lfs.errors.LfsRepositoryReadOnly;
import org.eclipse.jgit.lfs.errors.LfsUnauthorized ;
import org.eclipse.jgit.lfs.errors.LfsUnauthorized ;
import org.eclipse.jgit.lfs.errors.LfsUnavailable ;
import org.eclipse.jgit.lfs.errors.LfsUnavailable ;
import org.eclipse.jgit.lfs.errors.LfsValidationError ;
import org.eclipse.jgit.lfs.errors.LfsValidationError ;
import org.eclipse.jgit.lfs.internal.LfsText ;
import org.slf4j.Logger ;
import org.slf4j.LoggerFactory ;
import com.google.gson.FieldNamingPolicy ;
import com.google.gson.FieldNamingPolicy ;
import com.google.gson.Gson ;
import com.google.gson.Gson ;
@ -88,6 +92,8 @@ import com.google.gson.GsonBuilder;
* @since 4 . 3
* @since 4 . 3
* /
* /
public abstract class LfsProtocolServlet extends HttpServlet {
public abstract class LfsProtocolServlet extends HttpServlet {
private static Logger LOG = LoggerFactory
. getLogger ( LfsProtocolServlet . class ) ;
private static final long serialVersionUID = 1L ;
private static final long serialVersionUID = 1L ;
@ -183,7 +189,10 @@ public abstract class LfsProtocolServlet extends HttpServlet {
try {
try {
repo = getLargeFileRepository ( request , path ) ;
repo = getLargeFileRepository ( request , path ) ;
if ( repo = = null ) {
if ( repo = = null ) {
throw new LfsException ( "unexpected error" ) ; //$NON-NLS-1$
String error = MessageFormat
. format ( LfsText . get ( ) . lfsFailedToGetRepository , path ) ;
LOG . error ( error ) ;
throw new LfsException ( error ) ;
}
}
res . setStatus ( SC_OK ) ;
res . setStatus ( SC_OK ) ;
TransferHandler handler = TransferHandler
TransferHandler handler = TransferHandler