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