use of com.foobnix.ext.CacheZipUtils.UnZipRes in project LibreraReader by foobnix.
the class FileMetaCore method getEbookMeta.
public EbookMeta getEbookMeta(String path, CacheDir folder, boolean withPDF) {
EbookMeta ebookMeta = EbookMeta.Empty();
try {
if (path.toLowerCase(Locale.US).endsWith(".zip")) {
CacheZipUtils.cacheLock.lock();
try {
UnZipRes res = CacheZipUtils.extracIfNeed(path, folder);
ebookMeta = getEbookMeta(path, res.unZipPath, res.entryName, withPDF);
ebookMeta.setUnzipPath(res.unZipPath);
} finally {
CacheZipUtils.cacheLock.unlock();
}
} else {
ebookMeta = getEbookMeta(path, path, null, withPDF);
ebookMeta.setUnzipPath(path);
}
} catch (Exception e) {
LOG.e(e);
}
return ebookMeta;
}
Aggregations