org.eclipse.jgit.errors.NotSupportedException Java Examples

The following examples show how to use org.eclipse.jgit.errors.NotSupportedException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TransportCommand.java    From netbeans with Apache License 2.0 6 votes vote down vote up
protected Transport openTransport (boolean openPush) throws URISyntaxException, NotSupportedException, TransportException {
    URIish uri = getUriWithUsername(openPush);
    // WA for #200693, jgit fails to initialize ftp protocol
    for (TransportProtocol proto : Transport.getTransportProtocols()) {
        if (proto.getSchemes().contains("ftp")) { //NOI18N
            Transport.unregister(proto);
        }
    }
    try {
        Transport transport = Transport.open(getRepository(), uri);
        RemoteConfig config = getRemoteConfig();
        if (config != null) {
            transport.applyConfig(config);
        }
        if (transport.getTimeout() <= 0) {
            transport.setTimeout(45);
        }
        transport.setCredentialsProvider(getCredentialsProvider());
        return transport;
    } catch (IllegalArgumentException ex) {
        throw new TransportException(ex.getLocalizedMessage(), ex);
    }
}
 
Example #2
Source File: JGitAPIImpl.java    From git-client-plugin with MIT License 6 votes vote down vote up
@SuppressFBWarnings(value = "RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE", justification = "Java 11 spotbugs error")
private Set<String> listRemoteBranches(String remote) throws NotSupportedException, TransportException, URISyntaxException {
    Set<String> branches = new HashSet<>();
    try (final Repository repo = getRepository()) {
        StoredConfig config = repo.getConfig();
        try (final Transport tn = Transport.open(repo, new URIish(config.getString("remote",remote,"url")))) {
            tn.setCredentialsProvider(getProvider());
            try (final FetchConnection c = tn.openFetch()) {
                for (final Ref r : c.getRefs()) {
                    if (r.getName().startsWith(R_HEADS))
                        branches.add("refs/remotes/"+remote+"/"+r.getName().substring(R_HEADS.length()));
                }
            }
        }
    }
    return branches;
}
 
Example #3
Source File: Agent.java    From simple-pull-request-job-plugin with Apache License 2.0 5 votes vote down vote up
public Agent(String anyOrNone) throws NotSupportedException {
    if(anyOrNone.equals("any") || anyOrNone.equals("none")) {
        this.anyOrNone = anyOrNone;
    } else {
        throw new NotSupportedException("Agent type " + anyOrNone + "is not supported.");
    }
}
 
Example #4
Source File: BranchTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public void testFileProtocolFails () throws Exception {
    try {
        Transport.open(repository, new URIish(workDir.toURI().toURL()));
        fail("Workaround not needed, fix ListRemoteBranchesCommand - Transport.open(String) to Transport.open(URL)");
    } catch (NotSupportedException ex) {
        
    }
}
 
Example #5
Source File: TransportAmazonLambdaS3.java    From github-bucket with ISC License 4 votes vote down vote up
public Transport open(URIish uri, Repository local, String remoteName) throws NotSupportedException {
    return new TransportAmazonLambdaS3(local, uri, client);
}
 
Example #6
Source File: TransportAmazonLambdaS3.java    From github-bucket with ISC License 4 votes vote down vote up
public Transport open(URIish uri, Repository local, String remoteName) throws NotSupportedException {
    return new TransportAmazonLambdaS3(local, uri, client);
}