Search in sources :

Example 11 with SourceStorage

use of org.eclipse.che.api.core.model.project.SourceStorage in project che by eclipse.

the class ResourceManager method asDto.

private NewProjectConfigDto asDto(MutableProjectConfig config) {
    final SourceStorage source = config.getSource();
    final SourceStorageDto sourceStorageDto = dtoFactory.createDto(SourceStorageDto.class).withType(source.getType()).withLocation(source.getLocation()).withParameters(source.getParameters());
    return dtoFactory.createDto(NewProjectConfigDto.class).withName(config.getName()).withPath(config.getPath()).withDescription(config.getDescription()).withSource(sourceStorageDto).withType(config.getType()).withMixins(config.getMixins()).withAttributes(config.getAttributes()).withOptions(config.getOptions());
}
Also used : SourceStorage(org.eclipse.che.api.core.model.project.SourceStorage) SourceStorageDto(org.eclipse.che.api.workspace.shared.dto.SourceStorageDto)

Example 12 with SourceStorage

use of org.eclipse.che.api.core.model.project.SourceStorage in project che by eclipse.

the class DtoConverter method asDto.

/** Converts {@link ProjectConfig} to {@link ProjectConfigDto}. */
public static ProjectConfigDto asDto(ProjectConfig projectCfg) {
    final ProjectConfigDto projectConfigDto = newDto(ProjectConfigDto.class).withName(projectCfg.getName()).withDescription(projectCfg.getDescription()).withPath(projectCfg.getPath()).withType(projectCfg.getType()).withAttributes(projectCfg.getAttributes()).withMixins(projectCfg.getMixins());
    final SourceStorage source = projectCfg.getSource();
    if (source != null) {
        projectConfigDto.withSource(newDto(SourceStorageDto.class).withLocation(source.getLocation()).withType(source.getType()).withParameters(source.getParameters()));
    }
    return projectConfigDto;
}
Also used : SourceStorage(org.eclipse.che.api.core.model.project.SourceStorage) ProjectConfigDto(org.eclipse.che.api.workspace.shared.dto.ProjectConfigDto)

Aggregations

SourceStorage (org.eclipse.che.api.core.model.project.SourceStorage)12 SourceStorageDto (org.eclipse.che.api.workspace.shared.dto.SourceStorageDto)7 ConflictException (org.eclipse.che.api.core.ConflictException)4 ForbiddenException (org.eclipse.che.api.core.ForbiddenException)4 ServerException (org.eclipse.che.api.core.ServerException)4 NotFoundException (org.eclipse.che.api.core.NotFoundException)3 NewProjectConfig (org.eclipse.che.api.core.model.project.NewProjectConfig)3 LineConsumerFactory (org.eclipse.che.api.core.util.LineConsumerFactory)3 ProjectImportOutputWSLineConsumer (org.eclipse.che.api.project.server.importer.ProjectImportOutputWSLineConsumer)3 ProjectImporter (org.eclipse.che.api.project.server.importer.ProjectImporter)3 Function (org.eclipse.che.api.promises.client.Function)3 FunctionException (org.eclipse.che.api.promises.client.FunctionException)3 Promise (org.eclipse.che.api.promises.client.Promise)3 NewProjectConfigDto (org.eclipse.che.api.workspace.shared.dto.NewProjectConfigDto)3 ProjectConfigDto (org.eclipse.che.api.workspace.shared.dto.ProjectConfigDto)3 Project (org.eclipse.che.ide.api.resources.Project)3 Test (org.junit.Test)3 Optional (com.google.common.base.Optional)2 IOException (java.io.IOException)2 ArrayList (java.util.ArrayList)2