private TypeSpecificConfigModel createRemoteTypeSpecific(
     RepoType type, HttpRepoDescriptor descriptor) {
   MavenTypeSpecificConfigModel mavenModel = null;
   TypeSpecificConfigModel model = null;
   switch (type) {
     case Maven:
       mavenModel = new MavenTypeSpecificConfigModel();
       break;
     case Gradle:
       mavenModel = new GradleTypeSpecificConfigModel();
       break;
     case Ivy:
       mavenModel = new IvyTypeSpecificConfigModel();
       break;
     case SBT:
       mavenModel = new SbtTypeSpecificConfigModel();
       break;
     case P2:
       mavenModel = new P2TypeSpecificConfigModel();
       break;
     case Debian:
       DebTypeSpecificConfigModel debType = new DebTypeSpecificConfigModel();
       debType.setListRemoteFolderItems(descriptor.isListRemoteFolderItems());
       model = debType;
       break;
     case Docker:
       DockerTypeSpecificConfigModel dockerType = new DockerTypeSpecificConfigModel();
       dockerType.setEnableTokenAuthentication(descriptor.isEnableTokenAuthentication());
       dockerType.setForceDockerAuthentication(descriptor.isForceDockerAuthentication());
       dockerType.setListRemoteFolderItems(descriptor.isListRemoteFolderItems());
       model = dockerType;
       break;
     case NuGet:
       NugetTypeSpecificConfigModel nugetType = new NugetTypeSpecificConfigModel();
       populateSharedNuGetValues(nugetType, descriptor);
       NuGetConfiguration nuget = descriptor.getNuget();
       if (nuget != null) {
         nugetType.setDownloadContextPath(nuget.getDownloadContextPath());
         nugetType.setFeedContextPath(nuget.getFeedContextPath());
       }
       nugetType.setListRemoteFolderItems(descriptor.isListRemoteFolderItems());
       model = nugetType;
       break;
     case Npm:
       NpmTypeSpecificConfigModel npmType = new NpmTypeSpecificConfigModel();
       npmType.setListRemoteFolderItems(descriptor.isListRemoteFolderItems());
       model = npmType;
       break;
     case Pypi:
       PypiTypeSpecificConfigModel pypiType = new PypiTypeSpecificConfigModel();
       pypiType.setListRemoteFolderItems(descriptor.isListRemoteFolderItems());
       model = pypiType;
       break;
     case VCS:
       VcsTypeSpecificConfigModel vcsType = new VcsTypeSpecificConfigModel();
       populateVcsValues(vcsType, descriptor);
       model = vcsType;
       break;
     case Bower:
       BowerTypeSpecificConfigModel bowerType = new BowerTypeSpecificConfigModel();
       populateVcsValues(bowerType, descriptor);
       BowerConfiguration bowerConfiguration = descriptor.getBower();
       if (bowerConfiguration != null) {
         bowerType.setRegistryUrl(bowerConfiguration.getBowerRegistryUrl());
       }
       model = bowerType;
       break;
     case Gems:
       GemsTypeSpecificConfigModel gemsType = new GemsTypeSpecificConfigModel();
       gemsType.setListRemoteFolderItems(descriptor.isListRemoteFolderItems());
       model = gemsType;
       break;
     case Generic:
       GenericTypeSpecificConfigModel genericType = new GenericTypeSpecificConfigModel();
       genericType.setListRemoteFolderItems(descriptor.isListRemoteFolderItems());
       model = genericType;
       break;
     case YUM:
       YumTypeSpecificConfigModel yumType = new YumTypeSpecificConfigModel();
       yumType.setListRemoteFolderItems(descriptor.isListRemoteFolderItems());
       yumType.setAutoCalculateYumMetadata(null);
       yumType.setMetadataFolderDepth(null);
       yumType.setGroupFileNames(null);
       model = yumType;
       break;
   }
   if (model != null) {
     return model;
   }
   populateMavenRemoteValues(mavenModel, descriptor);
   return mavenModel;
 }
 private void populateSharedNuGetValues(
     NugetTypeSpecificConfigModel nuget, RepoBaseDescriptor descriptor) {
   nuget.setForceNugetAuthentication(descriptor.isForceNugetAuthentication());
 }
 private TypeSpecificConfigModel createLocalTypeSpecific(
     RepoType type, LocalRepoDescriptor descriptor) {
   MavenTypeSpecificConfigModel mavenModel = null;
   TypeSpecificConfigModel model = null;
   switch (type) {
     case Bower:
       model = new BowerTypeSpecificConfigModel();
       break;
     case Docker:
       DockerTypeSpecificConfigModel dockerType = new DockerTypeSpecificConfigModel();
       DockerApiVersion dockerApiVersion = descriptor.getDockerApiVersion();
       if (dockerApiVersion != null) {
         dockerType.setDockerApiVersion(dockerApiVersion);
       }
       dockerType.setForceDockerAuthentication(descriptor.isForceDockerAuthentication());
       model = dockerType;
       break;
     case NuGet:
       NugetTypeSpecificConfigModel nugetType = new NugetTypeSpecificConfigModel();
       populateSharedNuGetValues(nugetType, descriptor);
       nugetType.setMaxUniqueSnapshots(descriptor.getMaxUniqueSnapshots());
       model = nugetType;
       break;
     case Npm:
       model = new NpmTypeSpecificConfigModel();
       break;
     case Pypi:
       model = new PypiTypeSpecificConfigModel();
       break;
     case Vagrant:
       model = new VagrantTypeSpecificConfigModel();
       break;
     case GitLfs:
       model = new GitLfsTypeSpecificConfigModel();
       break;
     case Debian:
       DebTypeSpecificConfigModel debType = new DebTypeSpecificConfigModel();
       debType.setTrivialLayout(descriptor.isDebianTrivialLayout());
       model = debType;
       break;
     case YUM:
       YumTypeSpecificConfigModel yumType = new YumTypeSpecificConfigModel();
       yumType.setMetadataFolderDepth(descriptor.getYumRootDepth());
       yumType.setGroupFileNames(descriptor.getYumGroupFileNames());
       yumType.setAutoCalculateYumMetadata(descriptor.isCalculateYumMetadata());
       model = yumType;
       break;
     case Gems:
       model = new GemsTypeSpecificConfigModel();
       break;
     case Generic:
       model = new GenericTypeSpecificConfigModel();
       break;
     case Maven:
       mavenModel = new MavenTypeSpecificConfigModel();
       break;
     case Gradle:
       mavenModel = new GradleTypeSpecificConfigModel();
       break;
     case Ivy:
       mavenModel = new IvyTypeSpecificConfigModel();
       break;
     case SBT:
       mavenModel = new SbtTypeSpecificConfigModel();
       break;
   }
   if (model != null) {
     return model;
   }
   // We will get here only if our model is maven / gradle / ivy / sbt and we populate the values
   populateMavenLocalValues(mavenModel, descriptor);
   return mavenModel;
 }