org.jlot.client.remote.LocaleListRestCommand Maven / Gradle / Ivy
package org.jlot.client.remote;
import java.util.ArrayList;
import java.util.List;
import org.jlot.api.JlotApiUrls;
import org.jlot.client.remote.rest.AbstractLoginRestCommand;
import org.jlot.core.dto.LocalizationDTO;
import org.jlot.core.form.ProjectForm;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
@Component
public class LocaleListRestCommand extends AbstractLoginRestCommand>
{
@Override
protected List executeInternal ( ProjectForm projectForm )
{
RestTemplate restTemplate = getRestTemplate();
LocalizationDTOList list = restTemplate.getForObject(getUrl(), LocalizationDTOList.class, projectForm.getName());
return new ArrayList(list);
}
@Override
protected String getPath ( )
{
return JlotApiUrls.LOCALIZATIONS;
}
}
/**
* http://stackoverflow.com/a/6179440/351758
*/
class LocalizationDTOList extends ArrayList
{
private static final long serialVersionUID = 1L;
}