@@ -66,12 +66,14 @@ public class ContributionsIndexer {
66
66
private final File packagesFolder ;
67
67
private final File stagingFolder ;
68
68
private final File preferencesFolder ;
69
+ private final File builtInHardwareFolder ;
69
70
private final Platform platform ;
70
71
private final SignatureVerifier signatureVerifier ;
71
72
private ContributionsIndex index ;
72
73
73
- public ContributionsIndexer (File preferencesFolder , Platform platform , SignatureVerifier signatureVerifier ) {
74
+ public ContributionsIndexer (File preferencesFolder , File builtInHardwareFolder , Platform platform , SignatureVerifier signatureVerifier ) {
74
75
this .preferencesFolder = preferencesFolder ;
76
+ this .builtInHardwareFolder = builtInHardwareFolder ;
75
77
this .platform = platform ;
76
78
this .signatureVerifier = signatureVerifier ;
77
79
packagesFolder = new File (preferencesFolder , "packages" );
@@ -188,22 +190,22 @@ private ContributionsIndex parseIndex(File indexFile) throws IOException {
188
190
}
189
191
}
190
192
191
- public void syncWithFilesystem (File hardwareFolder ) throws IOException {
192
- syncBuiltInHardwareFolder ( hardwareFolder );
193
+ public void syncWithFilesystem () throws IOException {
194
+ syncBuiltInHardware ( );
193
195
194
- syncLocalPackagesFolder ();
196
+ syncLocalPackages ();
195
197
}
196
198
197
- private void syncBuiltInHardwareFolder ( File hardwareFolder ) throws IOException {
199
+ private void syncBuiltInHardware ( ) throws IOException {
198
200
if (index == null ) {
199
201
return ;
200
202
}
201
- for (File folder : hardwareFolder .listFiles (ONLY_DIRS )) {
203
+ for (File folder : builtInHardwareFolder .listFiles (ONLY_DIRS )) {
202
204
ContributedPackage pack = index .findPackage (folder .getName ());
203
205
if (pack != null ) {
204
206
syncBuiltInPackageWithFilesystem (pack , folder );
205
207
206
- File toolsFolder = new File (hardwareFolder , "tools" );
208
+ File toolsFolder = new File (builtInHardwareFolder , "tools" );
207
209
if (toolsFolder .isDirectory ()) {
208
210
for (File toolFolder : toolsFolder .listFiles (ONLY_DIRS )) {
209
211
File builtInToolsMetadata = new File (toolFolder , "builtin_tools_versions.txt" );
@@ -231,7 +233,7 @@ private void syncBuiltInPackageWithFilesystem(ContributedPackage pack, File hard
231
233
}
232
234
}
233
235
234
- private void syncLocalPackagesFolder () {
236
+ private void syncLocalPackages () {
235
237
if (!packagesFolder .isDirectory ()) {
236
238
return ;
237
239
}
0 commit comments