| | |
| | |
|
| | | import java.io.Serializable;
|
| | |
|
| | | import com.gitblit.Constants.AccessPermission;
|
| | | import com.gitblit.utils.ArrayUtils;
|
| | | import com.gitblit.utils.StringUtils;
|
| | |
|
| | | /**
|
| | | * Model class to represent a git client application.
|
| | | * |
| | | *
|
| | | * @author James Moger
|
| | | *
|
| | | */
|
| | |
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | public String name;
|
| | | public String title;
|
| | | public String description;
|
| | | public String legal;
|
| | | public String icon;
|
| | | public String cloneUrl;
|
| | | public String command;
|
| | | public String productUrl;
|
| | | public String attribution;
|
| | | public boolean isApplication = true;
|
| | | public boolean isActive = true;
|
| | | public String [] transports;
|
| | | public String[] platforms;
|
| | | public AccessPermission minimumPermission;
|
| | | public boolean isActive;
|
| | |
|
| | | public boolean allowsPlatform(String p) {
|
| | | if (ArrayUtils.isEmpty(platforms)) {
|
| | |
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public boolean supportsTransport(String transportOrUrl) {
|
| | | if (ArrayUtils.isEmpty(transports)) {
|
| | | return true;
|
| | | }
|
| | |
|
| | | String scheme = transportOrUrl;
|
| | | if (transportOrUrl.indexOf(':') > -1) {
|
| | | // strip scheme
|
| | | scheme = transportOrUrl.substring(0, transportOrUrl.indexOf(':'));
|
| | | }
|
| | |
|
| | | for (String transport : transports) {
|
| | | if (transport.equalsIgnoreCase(scheme)) {
|
| | | return true;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public String toString() {
|
| | | return StringUtils.isEmpty(title) ? name : title;
|
| | | }
|
| | | } |