private void saveCache() throws Exception { loadReport.append("Saving unit cache.\n"); File unit_cache_path = new MegaMekFile(getUnitCacheDir(), FILENAME_UNITS_CACHE).getFile(); ObjectOutputStream wr = new ObjectOutputStream( new BufferedOutputStream(new FileOutputStream(unit_cache_path))); Integer length = new Integer(m_data.length); wr.writeObject(length); for (MechSummary element : m_data) { wr.writeObject(element); } wr.flush(); wr.close(); }
private boolean addLookupNames(long lLastCheck) { final String METHOD_NAME = "addLookupNames(long)"; //$NON-NLS-1$ File lookupNames = new MegaMekFile(getUnitCacheDir(), FILENAME_LOOKUP).getFile(); boolean needsUpdate = false;
if (f.equals(new MegaMekFile(getUnitCacheDir(), FILENAME_UNITS_CACHE).getFile())) { continue;
Set<String> sKnownFiles = new HashSet<String>(); long lLastCheck = 0; entityVerifier = EntityVerifier.getInstance(new MegaMekFile(getUnitCacheDir(), EntityVerifier.CONFIG_FILENAME).getFile()); hFailedFiles = new HashMap<String, String>(); File unit_cache_path = new MegaMekFile(getUnitCacheDir(), FILENAME_UNITS_CACHE).getFile();