コード例 #1
0
 public List<VirtualRepository> getVirtualRepositoryKeys() {
   Credentials resolvingCredentials = getResolvingCredentials();
   try {
     ArtifactoryBuildInfoClient client =
         createArtifactoryClient(
             resolvingCredentials.getUsername(), resolvingCredentials.getPassword());
     List<String> keys = client.getVirtualRepositoryKeys();
     virtualRepositories =
         Lists.newArrayList(
             Lists.transform(
                 keys,
                 new Function<String, VirtualRepository>() {
                   public VirtualRepository apply(String from) {
                     return new VirtualRepository(from, from);
                   }
                 }));
   } catch (IOException e) {
     log.log(Level.WARNING, "Failed to obtain list of virtual repositories: " + e.getMessage());
     return Lists.newArrayList();
   }
   virtualRepositories.add(
       0,
       new VirtualRepository(
           "-- To use Artifactory for resolution select a virtual repository --", ""));
   return virtualRepositories;
 }
コード例 #2
0
 public List<String> getRepositoryKeys() {
   Credentials resolvingCredentials = getResolvingCredentials();
   try {
     ArtifactoryBuildInfoClient client =
         createArtifactoryClient(
             resolvingCredentials.getUsername(), resolvingCredentials.getPassword());
     repositories = client.getLocalRepositoriesKeys();
   } catch (IOException e) {
     log.log(Level.WARNING, "Failed to obtain list of local repositories: " + e.getMessage());
     return Lists.newArrayList();
   }
   return repositories;
 }
コード例 #3
0
  public boolean isPowerPack() {

    Credentials resolvingCredentials = getResolvingCredentials();

    try {
      ArtifactoryHttpClient client =
          new ArtifactoryHttpClient(
              url,
              resolvingCredentials.getUsername(),
              resolvingCredentials.getPassword(),
              new NullLog());
      ArtifactoryHttpClient.Version version = client.getVersion();
      return version.hasAddons();
    } catch (IOException e) {
      log.log(Level.WARNING, "Failed to obtain list of virtual repositories: " + e.getMessage());
    }
    return false;
  }