package org.ligi.gradecoba;

import java.util.ArrayList;
import java.util.List;

public class ArtifactProvider {
	private List<Artifact> artifacts;
	
	public List<Artifact> getArtifacts() {
		if (artifacts==null) {
            artifacts = new ArrayList<Artifact>();
			artifacts.add(new GoogleArtifact("play-services","3.2.25","google",false));
			artifacts.add(new AndroidArtifact("gridlayout-v7","18.0.0","android-support",false));
			artifacts.add(new AndroidArtifact("support-v13","18.0.0","android-support",false));
			artifacts.add(new AndroidArtifact("mediarouter-v7","18.0.0","android-support",false));
			artifacts.add(new AndroidArtifact("appcompat","18.0.0","android-support",false));
			artifacts.add(new AndroidArtifact("support-v4","18.0.0","android-support",false));
		}
		
		return artifacts; 
	}


    public List<Artifact> searchArtifacts(String query) {
        List<Artifact> res = new ArrayList<Artifact>();

        if (query.startsWith("gms")) {
            query="play";
        }

        for (Artifact artifact:getArtifacts()) {
            if (artifact.getName().contains(query)) {
                res.add(artifact);
            }
        }
        return res;
    }
}


@@ -316,14 +316,14 @@
 s%22,%22
-3.2.25
+4.0.30
 %22,%22g
@@ -476,25 +476,25 @@
 port-v13%22,%221
-8
+9
 .0.0%22,%22andro
@@ -566,25 +566,25 @@
 outer-v7%22,%221
-8
+9
 .0.0%22,%22andro
@@ -651,21 +651,24 @@
 ppcompat
+-v7
 %22,%221
-8
+9
 .0.0%22,%22a
@@ -740,25 +740,25 @@
 pport-v4%22,%221
-8
+9
 .0.0%22,%22andro

update to most recent data