2 * Copyright 2000-2011 JetBrains s.r.o.
\r
4 * Licensed under the Apache License, Version 2.0 (the "License");
\r
5 * you may not use this file except in compliance with the License.
\r
6 * You may obtain a copy of the License at
\r
8 * http://www.apache.org/licenses/LICENSE-2.0
\r
10 * Unless required by applicable law or agreed to in writing, software
\r
11 * distributed under the License is distributed on an "AS IS" BASIS,
\r
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
13 * See the License for the specific language governing permissions and
\r
14 * limitations under the License.
\r
17 package jetbrains.buildServer.nuget.server.toolRegistry.impl;
\r
19 import jetbrains.buildServer.nuget.server.toolRegistry.*;
\r
20 import org.jetbrains.annotations.NotNull;
\r
22 import java.io.File;
\r
23 import java.util.Arrays;
\r
24 import java.util.Collection;
\r
25 import java.util.List;
\r
28 * Created by Eugene Petrenko (eugene.petrenko@gmail.com)
\r
29 * Date: 11.08.11 1:07
\r
31 public class NuGetToolManagerImpl implements NuGetToolManager {
\r
32 private final AvailableToolsState myAvailables;
\r
34 public NuGetToolManagerImpl(AvailableToolsState availables) {
\r
35 myAvailables = availables;
\r
39 public Collection<NuGetInstalledTool> getInstalledTools() {
\r
40 return mockInstalledTools();
\r
44 public Collection<NuGetInstallingTool> getInstallingTool() {
\r
45 return mockInstallingTools();
\r
50 public Collection<NuGetTool> getAvailableTools() {
\r
51 //This must be cached to make if work faster!
\r
52 return myAvailables.getAvailable();
\r
56 public void installTool(@NotNull NuGetTool tool, @NotNull ActionProgress progress) {
\r
60 private List<NuGetInstallingTool> mockInstallingTools() {
\r
61 return Arrays.<NuGetInstallingTool>asList(
\r
62 new NuGetInstallingTool() {
\r
64 public Collection<String> getInstallMessages() {
\r
65 return Arrays.asList("mgs1", "msg2", "msg3");
\r
69 public String getId() {
\r
74 public String getVersion() {
\r
81 private List<NuGetInstalledTool> mockInstalledTools() {
\r
82 return Arrays.<NuGetInstalledTool>asList(
\r
83 new NuGetInstalledTool() {
\r
85 public File getPath() {
\r
86 return new File(".");
\r
90 public String getId() {
\r
95 public String getVersion() {
\r
99 new NuGetInstalledTool() {
\r
101 public File getPath() {
\r
102 return new File(".");
\r
106 public String getId() {
\r
111 public String getVersion() {
\r