Browse Source

Fix dependency to jersey-client library

pull/76/head
Uldis Ansmits 5 years ago
parent
commit
960f27f3d4
  1. 9
      pom.xml
  2. 4
      src/main/java/com/englishtown/bitbucket/hook/MirrorRemoteAdmin.java
  3. 1
      src/main/java/com/englishtown/bitbucket/hook/MirrorRepositoryHook.java

9
pom.xml

@ -91,10 +91,11 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
<version>1.8</version>
<scope>compile</scope>
<groupId>com.atlassian.plugins.rest</groupId>
<artifactId>com.atlassian.jersey-library</artifactId>
<version>6.0.2</version>
<scope>provided</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>

4
src/main/java/com/englishtown/bitbucket/hook/MirrorRemoteAdmin.java

@ -25,12 +25,14 @@ public class MirrorRemoteAdmin {
private final I18nService i18nService;
Client client;
public MirrorRemoteAdmin(PasswordEncryptor passwordEncryptor, I18nService i18nService) {
this.passwordEncryptor = passwordEncryptor;
this.i18nService = i18nService;
ClientConfig config = new DefaultClientConfig();
this.client = Client.create(config);
}
private void addToStream(StringOutputHandler outputHandler, String text) {
try {
outputHandler.process(new ByteArrayInputStream(text.getBytes()));
@ -38,6 +40,7 @@ public class MirrorRemoteAdmin {
log.error("Failed to process response: " + e.getMessage());
}
}
public void delete(MirrorSettings settings, Repository repository, StringOutputHandler outputHandler) {
String plainPassword = passwordEncryptor.decrypt(settings.password);
String plainPrivateToken = passwordEncryptor.decrypt(settings.privateToken);
@ -54,6 +57,7 @@ public class MirrorRemoteAdmin {
throw e;
}
}
private void delete(MirrorSettings settings, Repository repository, PasswordHandler passwordHandler) {
ObjectMapper mapper = new ObjectMapper();
String plainPrivateToken = passwordEncryptor.decrypt(settings.privateToken);

1
src/main/java/com/englishtown/bitbucket/hook/MirrorRepositoryHook.java

@ -11,7 +11,6 @@ import com.atlassian.bitbucket.i18n.I18nService;
import com.atlassian.bitbucket.project.Project;
import com.atlassian.bitbucket.repository.Repository;
import com.atlassian.bitbucket.scm.git.GitScm;
import com.atlassian.bitbucket.scm.git.command.GitCommandExitHandler;
import com.atlassian.bitbucket.scope.ProjectScope;
import com.atlassian.bitbucket.scope.RepositoryScope;
import com.atlassian.bitbucket.scope.Scope;

Loading…
Cancel
Save