Java Code Examples for org.sonatype.nexus.repository.Repository#getUrl()

The following examples show how to use org.sonatype.nexus.repository.Repository#getUrl() . 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: MavenApiRepositoryAdapter.java    From nexus-public with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public AbstractApiRepository adapt(final Repository repository) {
  boolean online = repository.getConfiguration().isOnline();
  String name = repository.getName();
  String url = repository.getUrl();

  switch (repository.getType().toString()) {
    case HostedType.NAME:
      return new MavenHostedApiRepository(name, url, online, getHostedStorageAttributes(repository),
          getCleanupPolicyAttributes(repository), createMavenAttributes(repository));
    case ProxyType.NAME:
      return new MavenProxyApiRepository(name, url, online, getHostedStorageAttributes(repository),
          getCleanupPolicyAttributes(repository), getProxyAttributes(repository),
          getNegativeCacheAttributes(repository), getHttpClientAttributes(repository), getRoutingRuleName(repository),
          createMavenAttributes(repository));
    default:
      return super.adapt(repository);
  }
}
 
Example 2
Source File: AptApiRepositoryAdapter.java    From nexus-public with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public AbstractApiRepository adapt(final Repository repository) {
  boolean online = repository.getConfiguration().isOnline();
  String name = repository.getName();
  String url = repository.getUrl();

  switch (repository.getType().toString()) {
    case HostedType.NAME:
      return new AptHostedApiRepository(name, url, online, getHostedStorageAttributes(repository),
          getCleanupPolicyAttributes(repository), createAptHostedRepositoriesAttributes(repository),
          createAptSigningRepositoriesAttributes(repository));
    case ProxyType.NAME:
      return new AptProxyApiRepository(name, url, online, getHostedStorageAttributes(repository),
          getCleanupPolicyAttributes(repository), createAptProxyRepositoriesAttributes(repository),
          getProxyAttributes(repository), getNegativeCacheAttributes(repository),
          getHttpClientAttributes(repository), getRoutingRuleName(repository));
  }
  return null;
}
 
Example 3
Source File: RepositoryBrowseResource.java    From nexus-public with Eclipse Public License 1.0 6 votes vote down vote up
private String getListItemPath(final Repository repository,
                               final BrowseNode browseNode,
                               final Asset asset)
{
  final String listItemPath;

  if (asset == null) {
    listItemPath = escapeHelper.uri(browseNode.getName()) + "/";
  }
  else {
    listItemPath = repository.getUrl() + "/" +
        Stream.of(asset.name().split("/"))
            .map(escapeHelper::uri)
            .collect(Collectors.joining("/"));
  }

  return listItemPath;
}
 
Example 4
Source File: SimpleApiRepositoryAdapter.java    From nexus-public with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public AbstractApiRepository adapt(final Repository repository) {
  boolean online = repository.getConfiguration().isOnline();
  String name = repository.getName();
  String format = repository.getFormat().toString();
  String url = repository.getUrl();

  switch (repository.getType().toString()) {
    case GroupType.NAME:
      return new SimpleApiGroupRepository(name, format, url, online, getStorageAttributes(repository),
          getGroupAttributes(repository));
    case HostedType.NAME:
      return new SimpleApiHostedRepository(name, format, url, online, getHostedStorageAttributes(repository),
          getCleanupPolicyAttributes(repository));
    case ProxyType.NAME:
      return new SimpleApiProxyRepository(name, format, url, online, getStorageAttributes(repository),
          getCleanupPolicyAttributes(repository), getProxyAttributes(repository),
          getNegativeCacheAttributes(repository), getHttpClientAttributes(repository),
          getRoutingRuleName(repository));
    default:
      return null;
  }
}