|
1 | 1 | package org.hydev.mcpm.client.local;
|
2 | 2 |
|
| 3 | +import com.fasterxml.jackson.core.type.TypeReference; |
3 | 4 | import com.fasterxml.jackson.databind.ObjectMapper;
|
4 | 5 |
|
5 | 6 | import org.hydev.mcpm.client.database.tracker.SuperPluginTracker;
|
6 | 7 | import org.hydev.mcpm.client.models.PluginModel;
|
7 | 8 | import org.hydev.mcpm.client.models.PluginVersion;
|
8 | 9 | import org.hydev.mcpm.client.models.PluginYml;
|
| 10 | +import org.hydev.mcpm.client.models.*; |
9 | 11 | import org.hydev.mcpm.client.models.PluginYml.InvalidPluginMetaStructure;
|
10 | 12 | import org.hydev.mcpm.client.search.SearchPackagesBoundary;
|
11 | 13 | import org.hydev.mcpm.client.search.SearchPackagesInput;
|
12 | 14 | import org.hydev.mcpm.client.search.SearchPackagesResult;
|
13 | 15 | import org.hydev.mcpm.client.search.SearchPackagesType;
|
| 16 | +import org.hydev.mcpm.utils.Pair; |
14 | 17 | import org.hydev.mcpm.utils.PluginJarFile;
|
15 | 18 | import org.hydev.mcpm.client.models.PluginTrackerModel;
|
| 19 | +import org.jetbrains.annotations.Nullable; |
16 | 20 |
|
17 | 21 | import java.io.*;
|
| 22 | +import java.io.File; |
| 23 | +import java.io.FileNotFoundException; |
| 24 | +import java.io.IOException; |
18 | 25 | import java.nio.file.Paths;
|
19 | 26 | import java.util.*;
|
| 27 | +import java.util.stream.Stream; |
20 | 28 |
|
21 | 29 | /**
|
22 | 30 | * This class keeps track of locally installed packages
|
23 | 31 | */
|
24 | 32 | public class SuperLocalPluginTracker implements SuperPluginTracker {
|
25 |
| - // CSV file storing the list of manually installed plugins. |
26 |
| - // Now, each row in the csv file represents something as follows: |
27 |
| - // ""name", "boolean", "versionId", "pluginId" |
| 33 | + /** Lock file containing installed plugin information */ |
| 34 | + private final String mainLockFile; |
28 | 35 |
|
29 |
| - private String mainLockFile = "plugins/mcpm.lock.json"; |
30 |
| - |
31 |
| - // Directory containing the plugins |
32 |
| - private String pluginDirectory = "plugins"; |
| 36 | + /** Directory containing all the plugins */ |
| 37 | + private final String pluginDirectory; |
33 | 38 |
|
| 39 | + /** Json deserializer */ |
34 | 40 | final ObjectMapper mapper = new ObjectMapper();
|
35 | 41 |
|
36 | 42 | /**
|
37 | 43 | * Instantiates a LocalPluginTracker with default parameters for general use
|
38 | 44 | */
|
39 | 45 | public SuperLocalPluginTracker() {
|
| 46 | + this("plugins/mcpm.lock.json", "plugins"); |
40 | 47 | }
|
41 | 48 |
|
42 | 49 | /**
|
|
0 commit comments