public synchronized void unlockEntry(Object locker) throws IOException { try { view.unlockEntry(locker); } catch (FileNotFoundException ex) { archive.unlockEntry(locker); } }
public synchronized Object lockEntry(String entry) throws IOException { if (view.exists(entry)) { return view.lockEntry(entry); } if (archive.exists(entry)) { return archive.lockEntry(entry); } return view.lockEntry(entry); }
public synchronized ArchiveEntry openEntry(String name) throws IOException { if (view.exists(name)) { ArchiveEntry entry = view.openEntry(name); return new ViewEntry(this, name, entry); } if (archive.exists(name)) { ArchiveEntry entry = archive.openEntry(name); return new ViewEntry(this, name, entry); } throw new FileNotFoundException(name); }
public synchronized List<String> listEntries(String namePattern) { List<String> viewList = view.listEntries(namePattern); List<String> archiveList = archive.listEntries(namePattern); if (archiveList.isEmpty()) { return viewList; } LinkedHashSet<String> entries = new LinkedHashSet<String>(viewList); entries.addAll(archiveList); return new ArrayList<String>(entries); }
private synchronized InputStream getInputStream( final MapTile pTile, final ITileSource tileSource) { for (final IArchiveFile archiveFile : mArchiveFiles) { final InputStream in = archiveFile.getInputStream(tileSource, pTile); if (in != null) { if (OpenStreetMapTileProviderConstants.DEBUGMODE) { Log.d(IMapView.LOGTAG, "Found tile " + pTile + " in " + archiveFile); } return in; } } return null; }
public synchronized void close() throws IOException { try { for (ViewEntry entry : openedEntries) { entry.doClose(); } openedEntries.clear(); } finally { try { if (!sharedArchive) { archive.close(); } } finally { view.close(); } } }
public synchronized void flush() throws IOException { // first flush all the ext2 files for (ViewEntry entry : openedEntries) { entry.flush(); } view.flush(); }
public long getUsedCache() { return view.getUsedCache(); }
public String getSystemId() { return view.getSystemId(); }
public String getDependId() { return archive.getSystemId(); }
public synchronized boolean exists(String name) { if (view.exists(name) || archive.exists(name)) { return true; } return false; }
public ArchiveEntry createEntry(String name) throws IOException { return view.createEntry(name); }
public void setCacheSize(long cacheSize) { view.setCacheSize(cacheSize); }
public boolean removeEntry(String name) throws IOException { return view.removeEntry(name); }
public void refresh() throws IOException { // archive.refresh( ); donot need to refresh archive, because archive in // ONLY in r mode view.refresh(); }
public String getName() { return view.getName(); }
public void save() throws IOException { view.save(); }