@Override
 public List<RemoteRepository> getRemoteRepositories() throws RepositoryAdminException {
   List<RemoteRepository> remoteRepositories =
       new ArrayList<>(
           getArchivaConfiguration().getConfiguration().getRemoteRepositories().size());
   for (RemoteRepositoryConfiguration repositoryConfiguration :
       getArchivaConfiguration().getConfiguration().getRemoteRepositories()) {
     RemoteRepository remoteRepository =
         new RemoteRepository(
             repositoryConfiguration.getId(),
             repositoryConfiguration.getName(),
             repositoryConfiguration.getUrl(),
             repositoryConfiguration.getLayout(),
             repositoryConfiguration.getUsername(),
             repositoryConfiguration.getPassword(),
             repositoryConfiguration.getTimeout());
     remoteRepository.setDownloadRemoteIndex(repositoryConfiguration.isDownloadRemoteIndex());
     remoteRepository.setRemoteIndexUrl(repositoryConfiguration.getRemoteIndexUrl());
     remoteRepository.setCronExpression(repositoryConfiguration.getRefreshCronExpression());
     remoteRepository.setIndexDirectory(repositoryConfiguration.getIndexDir());
     remoteRepository.setRemoteDownloadNetworkProxyId(
         repositoryConfiguration.getRemoteDownloadNetworkProxyId());
     remoteRepository.setRemoteDownloadTimeout(repositoryConfiguration.getRemoteDownloadTimeout());
     remoteRepository.setDownloadRemoteIndexOnStartup(
         repositoryConfiguration.isDownloadRemoteIndexOnStartup());
     remoteRepository.setDescription(repositoryConfiguration.getDescription());
     remoteRepository.setExtraHeaders(repositoryConfiguration.getExtraHeaders());
     remoteRepository.setExtraParameters(repositoryConfiguration.getExtraParameters());
     remoteRepositories.add(remoteRepository);
   }
   return remoteRepositories;
 }
 private RemoteRepositoryConfiguration getRemoteRepositoryConfiguration(
     RemoteRepository remoteRepository) {
   RemoteRepositoryConfiguration remoteRepositoryConfiguration =
       new RemoteRepositoryConfiguration();
   remoteRepositoryConfiguration.setId(remoteRepository.getId());
   remoteRepositoryConfiguration.setPassword(remoteRepository.getPassword());
   remoteRepositoryConfiguration.setTimeout(remoteRepository.getTimeout());
   remoteRepositoryConfiguration.setUrl(remoteRepository.getUrl());
   remoteRepositoryConfiguration.setUsername(remoteRepository.getUserName());
   remoteRepositoryConfiguration.setLayout(remoteRepository.getLayout());
   remoteRepositoryConfiguration.setName(remoteRepository.getName());
   remoteRepositoryConfiguration.setDownloadRemoteIndex(remoteRepository.isDownloadRemoteIndex());
   remoteRepositoryConfiguration.setRemoteIndexUrl(remoteRepository.getRemoteIndexUrl());
   remoteRepositoryConfiguration.setRefreshCronExpression(remoteRepository.getCronExpression());
   remoteRepositoryConfiguration.setIndexDir(remoteRepository.getIndexDirectory());
   remoteRepositoryConfiguration.setRemoteDownloadNetworkProxyId(
       remoteRepository.getRemoteDownloadNetworkProxyId());
   remoteRepositoryConfiguration.setRemoteDownloadTimeout(
       remoteRepository.getRemoteDownloadTimeout());
   remoteRepositoryConfiguration.setDownloadRemoteIndexOnStartup(
       remoteRepository.isDownloadRemoteIndexOnStartup());
   remoteRepositoryConfiguration.setDescription(remoteRepository.getDescription());
   remoteRepositoryConfiguration.setExtraHeaders(remoteRepository.getExtraHeaders());
   remoteRepositoryConfiguration.setExtraParameters(remoteRepository.getExtraParameters());
   return remoteRepositoryConfiguration;
 }