Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Initialises cache file member variable if not already initialised.
- */
- private void initCacheFile() {
- if (cacheFile == null) {
- if (cacheFileName == null || cacheFileName.equals(""))
- { /* Old Code that broke under Linux
- * cacheFileName = System.getProperty("java.io.tmpdir")
- * + "ExchangeRates.xml";
- */
- /*
- * The name of the cache file is saved as a part of the package
- * Preferences. This code checks to see if a name has been saved.
- * If not a new File is created in the temp directory identified
- * by java.util.tmpdir. The Preferences are then updated.
- */
- if (prefs.get("cacheFileName", "").equals(""))
- {
- cacheFile = new File(System.getProperty("java.util.tmpdir",
- "ExchangeRates.xml"));
- prefs.put("cacheFileName", cacheFile.getName());
- }
- else {
- cacheFile = new File(prefs.get("cacheFileName",""));
- }
- }
- }
- cacheFileName = cacheFile.getName();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement