This file contains hidden or 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
public <T> T getServiceClient(Class<T> interfaceClass, final String targetNamespace) { | |
JaxWsProxyFactoryBean interfaceFactory = new JaxWsProxyFactoryBean(); | |
interfaceFactory.setServiceFactory(new JaxWsServiceFactoryBean() { | |
@Override | |
protected OperationInfo createOperation(ServiceInfo serviceInfo, InterfaceInfo intf, Method m) { | |
intf.setName(new QName(targetNamespace, intf.getName().getLocalPart())); //overwrite the default namespace with target | |
return super.createOperation(serviceInfo,intf,m); | |
} | |
}); | |
} |
This file contains hidden or 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
private static final String knownKey = "{SSH2.PUBLIC.KEY}"; | |
public void start() { | |
SshServer sshd = SshServer.setUpDefaultServer(); | |
sshd.setPort(22999); | |
sshd.setKeyPairProvider(new SimpleGeneratorHostKeyProvider("hostkey.ser")); | |
sshd.setPublickeyAuthenticator(new PublickeyAuthenticator() { | |
public boolean authenticate(String username, PublicKey key, ServerSession session) { | |
if(key instanceof RSAPublicKey) { |
This file contains hidden or 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
//If you need to Debug JAXB this is your ticket. | |
//Don't use this for production just when debugging. | |
unmarshaller.setEventHandler(new javax.xml.bind.helpers.DefaultValidationHandler()); |
This file contains hidden or 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
import jenkins.model.* | |
import com.cloudbees.plugins.credentials.* | |
import com.cloudbees.plugins.credentials.common.* | |
import com.cloudbees.plugins.credentials.domains.* | |
import com.cloudbees.plugins.credentials.impl.* | |
import org.jenkinsci.plugins.plaincredentials.* | |
import org.jenkinsci.plugins.plaincredentials.impl.* | |
import org.apache.commons.fileupload.FileItem | |
//Replace file-id, file-description, filepath and filename with appropriate values for your file |