Codota Logo
ArtifactoryClientBuilder
Code IndexAdd Codota to your IDE (free)

How to use
ArtifactoryClientBuilder
in
org.jfrog.artifactory.client

Best Java code snippets using org.jfrog.artifactory.client.ArtifactoryClientBuilder (Showing top 10 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ArrayList a =
  • Codota Iconnew ArrayList<String>()
  • Codota Iconnew ArrayList()
  • Codota Iconnew ArrayList<Object>()
  • Smart code suggestions by Codota
}
origin: jfrog/project-examples

/**
 * This method creates an artifactory object
 */
private static Artifactory createArtifactory(String username, String password, String artifactoryUrl) {
  if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password) || StringUtils.isEmpty(artifactoryUrl)){
    throw new IllegalArgumentException("Arguments passed to createArtifactory are not valid");
  }
  return ArtifactoryClientBuilder.create()
      .setUrl(artifactoryUrl)
      .setUsername(username)
      .setPassword(password)
      .build();
}
origin: jfrog/artifactory-client-java

public static ArtifactoryClientBuilder create() {
  return new ArtifactoryClientBuilder();
}
origin: jfrog/artifactory-client-java

public Artifactory build() {
  URI uri;
  try {
    uri = new URIBuilder(url).build();
  } catch (URISyntaxException e) {
    throw new IllegalArgumentException("Invalid Artifactory URL: " + url + ".", e);
  }
  if (StringUtils.isBlank(userAgent)) {
    try {
      userAgent = getUserAgent();
    } catch (IOException e) {
      userAgent = "artifactory-client-java";
    }
  }
  CloseableHttpClient closeableHttpClient = createClientBuilder(uri);
  return new ArtifactoryImpl(closeableHttpClient, url, userAgent, username, accessToken);
}
origin: jfrog/artifactory-client-java

@Test
public void connectionTimeoutBuilderTest() {
  ArtifactoryClientBuilder builder = ArtifactoryClientBuilder.create();
  builder.setUrl("http://myhost.com:80/")
      .setConnectionTimeout(100);
  assertEquals(builder.getConnectionTimeout(), new Integer(100));
  builder.build();
}
origin: jfrog/artifactory-client-java

  @Test
  public void socketTimeoutBuilderTest() {
    ArtifactoryClientBuilder builder = ArtifactoryClientBuilder.create();
    builder.setUrl("http://myhost.com:80/")
        .setSocketTimeout(100);

    assertEquals(builder.getSocketTimeout(), new Integer(100));
    builder.build();
  }
}
origin: jfrog/artifactory-client-java

@Test
public void proxyBuilderTest() {
  ArtifactoryClientBuilder builder = ArtifactoryClientBuilder.create();
  builder.setUrl("http://myhost.com:80/");
  ProxyConfig proxy = new ProxyConfig("localhost", 9090, "http", "user", "password");
  builder.setProxy(proxy);
  assertEquals(builder.getProxy(), proxy);
  builder.build();
}
origin: jfrog/artifactory-client-java

@Test
public void urlsBuilderTest() throws IOException {
  Artifactory artifactory;
  artifactory = ArtifactoryClientBuilder.create().setUrl("http://myhost.com/clienttests").build();
  artifactory = ArtifactoryClientBuilder.create().setUrl("http://myhost.com:80/clienttests").build();
  assertEquals("http://myhost.com:80", artifactory.getUri());
  assertEquals("clienttests", artifactory.getContextName());
  artifactory = ArtifactoryClientBuilder.create().setUrl("http://myhost.com:80/clienttests/").build();
  assertEquals("http://myhost.com:80", artifactory.getUri());
  assertEquals("clienttests", artifactory.getContextName());
  artifactory = ArtifactoryClientBuilder.create().setUrl("http://myhost.com").build();
  assertEquals("http://myhost.com", artifactory.getUri());
  assertEquals("", artifactory.getContextName());
  artifactory = ArtifactoryClientBuilder.create().setUrl("http://myhost.com:80").build();
  assertEquals("http://myhost.com:80", artifactory.getUri());
  assertEquals("", artifactory.getContextName());
  artifactory = ArtifactoryClientBuilder.create().setUrl("http://myhost.com:80/").build();
  assertEquals("http://myhost.com:80", artifactory.getUri());
  assertEquals("", artifactory.getContextName());
  artifactory = ArtifactoryClientBuilder.create()
    .setUrl("http://abc.com:80/ab/artifactory/webapp/webapp").build();
  assertEquals("http://abc.com:80", artifactory.getUri());
  assertEquals("ab/artifactory/webapp/webapp", artifactory.getContextName());
origin: jfrog/artifactory-client-java

@Test(dependsOnMethods = "testCreate")
public void testCreateDirectoryWithoutPermissions() throws IOException {
  Artifactory anonymousArtifactory = ArtifactoryClientBuilder.create().setUrl(url).build();
  try {
    anonymousArtifactory.repository(localRepository.getKey()).folder("myFolder").create();
  } catch (HttpResponseException e) {
    assertTrue(e.getStatusCode() == HttpStatus.SC_UNAUTHORIZED);
  }
}
origin: jfrog/artifactory-client-java

@Test
public void urlsTest() throws IOException {
  Artifactory artifactory;
  ArtifactoryClientBuilder artifactoryClientBuilder = ArtifactoryClientBuilder.create();
  artifactory = artifactoryClientBuilder.setUrl("http://myhost.com/clienttests").setUsername("").setPassword("").build();
  assertEquals("http://myhost.com", artifactory.getUri());
  assertEquals("clienttests", artifactory.getContextName());
  artifactory = artifactoryClientBuilder.setUrl("http://myhost.com:80/clienttests").setUsername("").setPassword("").build();
  assertEquals("http://myhost.com:80", artifactory.getUri());
  assertEquals("clienttests", artifactory.getContextName());
  artifactory = artifactoryClientBuilder.setUrl("http://myhost.com:80/clienttests/").setUsername("").setPassword("").build();
  assertEquals("http://myhost.com:80", artifactory.getUri());
  assertEquals("clienttests", artifactory.getContextName());
  artifactory = artifactoryClientBuilder.setUrl("http://myhost.com").setUsername("").setPassword("").build();
  assertEquals("http://myhost.com", artifactory.getUri());
  assertEquals("", artifactory.getContextName());
  artifactory = artifactoryClientBuilder.setUrl("http://myhost.com:80").setUsername("").setPassword("").build();
  assertEquals("http://myhost.com:80", artifactory.getUri());
  assertEquals("", artifactory.getContextName());
  artifactory = artifactoryClientBuilder.setUrl("http://myhost.com:80/").setUsername("").setPassword("").build();
  assertEquals("http://myhost.com:80", artifactory.getUri());
  assertEquals("", artifactory.getContextName());
  artifactory = artifactoryClientBuilder.setUrl("http://abc.com:80/ab/artifactory/webapp/webapp").setUsername("").setPassword("").build();
  assertEquals("http://abc.com:80", artifactory.getUri());
  assertEquals("ab/artifactory/webapp/webapp", artifactory.getContextName());
  artifactory = artifactoryClientBuilder.setUrl("http://myhost.com:80/").setUsername("").setPassword("").setUserAgent("testAgent").build();
  assertEquals(artifactory.getUri(), "http://myhost.com:80");
  assertEquals("", artifactory.getContextName());
  assertEquals("testAgent", artifactory.getUserAgent());
}
origin: jfrog/artifactory-client-java

fileMd5 = "8f17d4271b86478a2731deebdab8c846";
fileSha1 = "6c98d6766e72d5575f96c9479d1c1d3b865c6e25";
artifactory = ArtifactoryClientBuilder.create()
    .setUrl(url)
    .setUsername(username)
    .setPassword(password)
    .build();
deleteRepoIfExists(localRepositoryKey);
deleteRepoIfExists(getJCenterRepoName());
org.jfrog.artifactory.clientArtifactoryClientBuilder

Most used methods

  • build
  • create
  • setPassword
  • setUrl
  • setUsername
  • <init>
  • createClientBuilder
  • getConnectionTimeout
  • getProxy
  • getSocketTimeout
  • getUserAgent
  • setConnectionTimeout
  • getUserAgent,
  • setConnectionTimeout,
  • setProxy,
  • setSocketTimeout,
  • setUserAgent

Popular in Java

  • Running tasks concurrently on multiple threads
  • setContentView (Activity)
  • getExternalFilesDir (Context)
  • putExtra (Intent)
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • List (java.util)
    A List is a collection which maintains an ordering for its elements. Every element in the List has a
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.This exception may include information for locating the er
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now