| | |
| | | import org.eclipse.jgit.util.Base64;
|
| | |
|
| | | import com.gitblit.GitBlitException.ForbiddenException;
|
| | | import com.gitblit.GitBlitException.NotAllowedException;
|
| | | import com.gitblit.GitBlitException.UnauthorizedException;
|
| | | import com.gitblit.GitBlitException.UnknownRequestException;
|
| | | import com.gitblit.models.RepositoryModel;
|
| | |
| | | }
|
| | | return gson().fromJson(json, type);
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * Reads a gson object from the specified url.
|
| | | *
|
| | |
| | | } else if (e.getMessage().indexOf("403") > -1) {
|
| | | // requested url is forbidden by the requesting user
|
| | | throw new ForbiddenException(url);
|
| | | } else if (e.getMessage().indexOf("405") > -1) {
|
| | | // requested url is not allowed by the server
|
| | | throw new NotAllowedException(url);
|
| | | } else if (e.getMessage().indexOf("501") > -1) {
|
| | | // requested url is not recognized by the server
|
| | | throw new UnknownRequestException(url);
|
| | | }
|
| | | throw e;
|
| | | }
|
| | |
| | | } else if (e.getMessage().indexOf("403") > -1) {
|
| | | // requested url is forbidden by the requesting user
|
| | | throw new ForbiddenException(url);
|
| | | } else if (e.getMessage().indexOf("405") > -1) {
|
| | | // requested url is not allowed by the server
|
| | | throw new NotAllowedException(url);
|
| | | } else if (e.getMessage().indexOf("501") > -1) {
|
| | | // requested url is not recognized by the server
|
| | | throw new UnknownRequestException(url);
|