24
24
import ai .wanaku .core .mcp .common .resolvers .Resolver ;
25
25
import ai .wanaku .core .util .IndexHelper ;
26
26
27
+ /**
28
+ * Base provider class for tools and resources
29
+ * @param <Y> The type of the resolver
30
+ */
27
31
abstract class AbstractProvider <Y extends Resolver > {
28
32
private static File createSettingsDirectory (String settingsDirectory ) {
29
33
File resourcesDir = new File (settingsDirectory );
@@ -34,6 +38,12 @@ private static File createSettingsDirectory(String settingsDirectory) {
34
38
return resourcesDir ;
35
39
}
36
40
41
+ /**
42
+ * Initializes the persisted index of resources
43
+ * @param resourcesPath the path to the index file
44
+ * @param fileName the name of the index file
45
+ * @return the File object representing the initialized index of resources
46
+ */
37
47
protected File initializeResourcesIndex (String resourcesPath , String fileName ) {
38
48
File settingsDirectory = createSettingsDirectory (resourcesPath );
39
49
File indexFile = new File (settingsDirectory , fileName );
@@ -47,7 +57,15 @@ protected File initializeResourcesIndex(String resourcesPath, String fileName) {
47
57
return indexFile ;
48
58
}
49
59
60
+ /**
61
+ * Initializes the persisted index of resources
62
+ * @return the File object representing the initialized index of resources
63
+ */
50
64
abstract File initializeIndex ();
51
65
66
+ /**
67
+ * Gets the resolver associated with this provider
68
+ * @return the resolver instance
69
+ */
52
70
abstract Y getResolver ();
53
71
}
0 commit comments