<commit_before>package org.zanata.client.commands;

import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;

import javax.xml.bind.JAXBException;

import org.jboss.resteasy.client.ClientResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.zanata.rest.client.ClientUtility;
import org.zanata.rest.client.IProjectResource;
import org.zanata.rest.dto.Project;
import org.zanata.rest.dto.ProjectType;

/**
 * @author <NAME> <<EMAIL>>
 *
 */
public class PutProjectCommand extends ConfigurableCommand<PutProjectOptions>
{
   private static final Logger log = LoggerFactory.getLogger(PutProjectCommand.class);

   public PutProjectCommand(PutProjectOptions opts)
   {
      super(opts);
   }

   @Override
   public void run() throws JAXBException, URISyntaxException, IOException, Exception
   {
      Project project = new Project();
      project.setId(getOpts().getProjectSlug());
      project.setName(getOpts().getProjectName());
      project.setDescription(getOpts().getProjectDesc());
      project.setSourceViewURL(getOpts().getSourceViewUrl());
      project.setSourceCheckoutURL(getOpts().getSourceCheckoutUrl());
      project.setDefaultType(ProjectType.getValueOf(getOpts().getDefaultProjectType()));

      log.debug("{}", project);

      // send project to rest api
      IProjectResource projResource = getRequestFactory().getProject(getOpts().getProjectSlug());
      URI uri = getRequestFactory().getProjectURI(getOpts().getProjectSlug());

      ClientResponse<?> response = projResource.put(project);
      ClientUtility.checkResult(response, uri);
   }
}
<commit_msg>rhbz912583 change default project type to string<commit_after>package org.zanata.client.commands;

import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;

import javax.xml.bind.JAXBException;

import org.jboss.resteasy.client.ClientResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.zanata.rest.client.ClientUtility;
import org.zanata.rest.client.IProjectResource;
import org.zanata.rest.dto.Project;

/**
 * @author <NAME> <<EMAIL>>
 *
 */
public class PutProjectCommand extends ConfigurableCommand<PutProjectOptions>
{
   private static final Logger log = LoggerFactory.getLogger(PutProjectCommand.class);

   public PutProjectCommand(PutProjectOptions opts)
   {
      super(opts);
   }

   @Override
   public void run() throws JAXBException, URISyntaxException, IOException, Exception
   {
      Project project = new Project();
      project.setId(getOpts().getProjectSlug());
      project.setName(getOpts().getProjectName());
      project.setDescription(getOpts().getProjectDesc());
      project.setSourceViewURL(getOpts().getSourceViewUrl());
      project.setSourceCheckoutURL(getOpts().getSourceCheckoutUrl());

      if (getOpts().getDefaultProjectType() == null || getOpts().getDefaultProjectType().isEmpty())
      {
         throw new Exception("Default project type must not be null or empty.");
      }
      project.setDefaultType(getOpts().getDefaultProjectType());

      log.debug("{}", project);

      // send project to rest api
      IProjectResource projResource = getRequestFactory().getProject(getOpts().getProjectSlug());
      URI uri = getRequestFactory().getProjectURI(getOpts().getProjectSlug());

      ClientResponse<?> response = projResource.put(project);
      ClientUtility.checkResult(response, uri);
   }
}

{'fraction_non_alphanumeric': 0.12104499274310596, 'fraction_numerical': 0.002902757619738752, 'mean_word_length': 4.695867768595042, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4445760', 'n_tokens_mistral': 1003, 'n_tokens_neox': 1000, 'n_words': 177}