|
|
@ -1243,10 +1243,15 @@ public class CacheImporter @Inject constructor( |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private fun readFile(store: Store, index: Int, file: Int): File? { |
|
|
|
private fun readFile(store: Store, index: Int, file: Int): File? { |
|
|
|
|
|
|
|
try { |
|
|
|
store.read(index, file).use { buf -> |
|
|
|
store.read(index, file).use { buf -> |
|
|
|
val version = VersionTrailer.strip(buf) ?: return null |
|
|
|
val version = VersionTrailer.strip(buf) ?: return null |
|
|
|
return File(index, file, buf.retain(), version) |
|
|
|
return File(index, file, buf.retain(), version) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} catch (ex: IOException) { |
|
|
|
|
|
|
|
logger.warn(ex) { "Skipping corrupt file (index $index, group $file)" } |
|
|
|
|
|
|
|
return null |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private fun addFiles(connection: Connection, sourceId: Int, files: List<File>) { |
|
|
|
private fun addFiles(connection: Connection, sourceId: Int, files: List<File>) { |
|
|
|