Search in sources :

Example 1 with WorkspaceManager

use of org.eclipse.che.api.workspace.server.WorkspaceManager in project che by eclipse.

the class LocalWorkspaceFolderPathProvider method getPath.

@Override
public String getPath(@Assisted("workspace") String workspaceId) throws IOException {
    if (!isWindows && hostProjectsFolder != null) {
        return hostProjectsFolder;
    }
    try {
        WorkspaceManager workspaceManager = this.workspaceManager.get();
        Workspace workspace = workspaceManager.getWorkspace(workspaceId);
        String wsName = workspace.getConfig().getName();
        return doGetPathByName(wsName);
    } catch (NotFoundException | ServerException e) {
        throw new IOException(e.getLocalizedMessage());
    }
}
Also used : WorkspaceManager(org.eclipse.che.api.workspace.server.WorkspaceManager) ServerException(org.eclipse.che.api.core.ServerException) NotFoundException(org.eclipse.che.api.core.NotFoundException) IOException(java.io.IOException) Workspace(org.eclipse.che.api.core.model.workspace.Workspace)

Aggregations

IOException (java.io.IOException)1 NotFoundException (org.eclipse.che.api.core.NotFoundException)1 ServerException (org.eclipse.che.api.core.ServerException)1 Workspace (org.eclipse.che.api.core.model.workspace.Workspace)1 WorkspaceManager (org.eclipse.che.api.workspace.server.WorkspaceManager)1