Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JENKINS-33901] Add bitbucket host validator
- Loading branch information
Antonio Mansilla
committed
May 6, 2016
1 parent
ed69c7d
commit ed13d4f
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
src/main/java/org/jenkinsci/plugins/bitbucket/validator/BitbucketHostValidator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package org.jenkinsci.plugins.bitbucket.validator; | ||
|
||
import com.google.common.collect.ImmutableSet; | ||
import java.util.Set; | ||
|
||
public class BitbucketHostValidator | ||
{ | ||
final Set<String> supportedDomains = ImmutableSet.of("bitbucket.org", "altssh.bitbucket.org"); | ||
|
||
public boolean isValid(final String $value) | ||
{ | ||
return this.supportedDomains.contains($value); | ||
} | ||
|
||
public String renderError() | ||
{ | ||
return "Bitbucket build notifier support only repositories hosted in bitbucket.org"; | ||
} | ||
} |