@@ -66,12 +66,14 @@ public class ContributionsIndexer {
6666 private final File packagesFolder ;
6767 private final File stagingFolder ;
6868 private final File preferencesFolder ;
69+ private final File builtInHardwareFolder ;
6970 private final Platform platform ;
7071 private final SignatureVerifier signatureVerifier ;
7172 private ContributionsIndex index ;
7273
73- public ContributionsIndexer (File preferencesFolder , Platform platform , SignatureVerifier signatureVerifier ) {
74+ public ContributionsIndexer (File preferencesFolder , File builtInHardwareFolder , Platform platform , SignatureVerifier signatureVerifier ) {
7475 this .preferencesFolder = preferencesFolder ;
76+ this .builtInHardwareFolder = builtInHardwareFolder ;
7577 this .platform = platform ;
7678 this .signatureVerifier = signatureVerifier ;
7779 packagesFolder = new File (preferencesFolder , "packages" );
@@ -188,22 +190,22 @@ private ContributionsIndex parseIndex(File indexFile) throws IOException {
188190 }
189191 }
190192
191- public void syncWithFilesystem (File hardwareFolder ) throws IOException {
192- syncBuiltInHardwareFolder ( hardwareFolder );
193+ public void syncWithFilesystem () throws IOException {
194+ syncBuiltInHardware ( );
193195
194- syncLocalPackagesFolder ();
196+ syncLocalPackages ();
195197 }
196198
197- private void syncBuiltInHardwareFolder ( File hardwareFolder ) throws IOException {
199+ private void syncBuiltInHardware ( ) throws IOException {
198200 if (index == null ) {
199201 return ;
200202 }
201- for (File folder : hardwareFolder .listFiles (ONLY_DIRS )) {
203+ for (File folder : builtInHardwareFolder .listFiles (ONLY_DIRS )) {
202204 ContributedPackage pack = index .findPackage (folder .getName ());
203205 if (pack != null ) {
204206 syncBuiltInPackageWithFilesystem (pack , folder );
205207
206- File toolsFolder = new File (hardwareFolder , "tools" );
208+ File toolsFolder = new File (builtInHardwareFolder , "tools" );
207209 if (toolsFolder .isDirectory ()) {
208210 for (File toolFolder : toolsFolder .listFiles (ONLY_DIRS )) {
209211 File builtInToolsMetadata = new File (toolFolder , "builtin_tools_versions.txt" );
@@ -231,7 +233,7 @@ private void syncBuiltInPackageWithFilesystem(ContributedPackage pack, File hard
231233 }
232234 }
233235
234- private void syncLocalPackagesFolder () {
236+ private void syncLocalPackages () {
235237 if (!packagesFolder .isDirectory ()) {
236238 return ;
237239 }
0 commit comments