fall back to using previously downloaded database.xml if necessary #99
Conversation
neogeographica
added
some commits
Jul 30, 2015
|
Note that while this partially addresses issue #10, it does NOT disable installing. If you try to install something and QI can't contact the repository, you'll get the "Couldn't open file! www.quaddicted.com" error dialog. So at least it kind of fails gracefully. |
SpiritQuaddicted
merged commit 0cfcaab into hrehfeld:master Aug 7, 2015
hrehfeld
commented on the diff
Aug 8, 2015
src/de/haukerehfeld/quakeinjector/QuakeInjector.java
| + private BufferedInputStream cachedDatabaseStream() throws IOException { | ||
| + if (cache != null && cache.exists() && cache.canRead()) { | ||
| + try { | ||
| + return new BufferedInputStream(new FileInputStream(cache)); | ||
| + } | ||
| + catch (IOException e) {} | ||
| + } | ||
| + throw new IOException("cannot download package database or read local cache"); |
|
|
neogeographica
deleted the
neogeographica:offline_database branch
Aug 8, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
neogeographica commentedJul 31, 2015
If unable to download a new database.xml, or if we download something zero-length or otherwise unparseable, then try to use a previously downloaded database.xml.
The main changes here:
Note that because of the first problem above, any existing database.xml files in QuakeInjector installations are likely corrupted. For "offline mode" to work, you need to have used this new version of QuakeInjector at least once to successfully fetch database.xml. (Or get an uncorrupted copy of database.xml from a friend.)