1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-30 16:24:09 +03:00

Some ArchiveExtractor bugs fixed and its code formatted

This commit is contained in:
Federico Fissore
2015-03-18 14:56:26 +01:00
parent 323458c8d8
commit 6b5244eafe
4 changed files with 105 additions and 72 deletions

View File

@ -44,6 +44,17 @@ import cc.arduino.utils.Progress;
public class LibraryInstaller {
private static final String LIBRARY_INDEX_URL;
static {
String extenalLibraryIndexUrl = System.getProperty("LIBRARY_INDEX_URL");
if (extenalLibraryIndexUrl != null && !"".equals(extenalLibraryIndexUrl)) {
LIBRARY_INDEX_URL = extenalLibraryIndexUrl;
} else {
LIBRARY_INDEX_URL = "http://arduino.cc/download.php?f=/libraries/library_index.json";
}
}
private LibrariesIndexer indexer;
private File stagingFolder;
private DownloadableContributionsDownloader downloader;
@ -63,7 +74,7 @@ public class LibraryInstaller {
final MultiStepProgress progress = new MultiStepProgress(2);
// Step 1: Download index
URL url = new URL("http://arduino.cc/download.php?f=/libraries/library_index.json");
URL url = new URL(LIBRARY_INDEX_URL);
File outputFile = indexer.getIndexFile();
File tmpFile = new File(outputFile.getAbsolutePath() + ".tmp");
try {