Esempio n. 1
0
 public synchronized void unlockEntry(Object locker) throws IOException {
   try {
     view.unlockEntry(locker);
   } catch (FileNotFoundException ex) {
     archive.unlockEntry(locker);
   }
 }
Esempio n. 2
0
 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);
 }
Esempio n. 3
0
 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);
 }
Esempio n. 4
0
  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;
  }
Esempio n. 6
0
 public synchronized void close() throws IOException {
   try {
     for (ViewEntry entry : openedEntries) {
       entry.doClose();
     }
     openedEntries.clear();
   } finally {
     try {
       if (!sharedArchive) {
         archive.close();
       }
     } finally {
       view.close();
     }
   }
 }
Esempio n. 7
0
 public synchronized void flush() throws IOException {
   // first flush all the ext2 files
   for (ViewEntry entry : openedEntries) {
     entry.flush();
   }
   view.flush();
 }
Esempio n. 8
0
 public long getUsedCache() {
   return view.getUsedCache();
 }
Esempio n. 9
0
 public String getSystemId() {
   return view.getSystemId();
 }
Esempio n. 10
0
 public String getDependId() {
   return archive.getSystemId();
 }
Esempio n. 11
0
 public synchronized boolean exists(String name) {
   if (view.exists(name) || archive.exists(name)) {
     return true;
   }
   return false;
 }
Esempio n. 12
0
 public ArchiveEntry createEntry(String name) throws IOException {
   return view.createEntry(name);
 }
Esempio n. 13
0
 public void setCacheSize(long cacheSize) {
   view.setCacheSize(cacheSize);
 }
Esempio n. 14
0
 public boolean removeEntry(String name) throws IOException {
   return view.removeEntry(name);
 }
Esempio n. 15
0
 public void refresh() throws IOException {
   // archive.refresh( ); donot need to refresh archive, because archive in
   // ONLY in r mode
   view.refresh();
 }
Esempio n. 16
0
 public String getName() {
   return view.getName();
 }
Esempio n. 17
0
 public void save() throws IOException {
   view.save();
 }