Fix Dropbox vault unlock in vault version 7 and caching enabled
This commit is contained in:
parent
543a03212f
commit
3ae90ab521
@ -7,6 +7,7 @@ import com.dropbox.core.NetworkIOException
|
|||||||
import com.dropbox.core.v2.files.CreateFolderErrorException
|
import com.dropbox.core.v2.files.CreateFolderErrorException
|
||||||
import com.dropbox.core.v2.files.DeleteErrorException
|
import com.dropbox.core.v2.files.DeleteErrorException
|
||||||
import com.dropbox.core.v2.files.DownloadErrorException
|
import com.dropbox.core.v2.files.DownloadErrorException
|
||||||
|
import com.dropbox.core.v2.files.GetMetadataErrorException
|
||||||
import com.dropbox.core.v2.files.ListFolderErrorException
|
import com.dropbox.core.v2.files.ListFolderErrorException
|
||||||
import com.dropbox.core.v2.files.RelocationErrorException
|
import com.dropbox.core.v2.files.RelocationErrorException
|
||||||
import org.cryptomator.data.cloud.InterceptingCloudContentRepository
|
import org.cryptomator.data.cloud.InterceptingCloudContentRepository
|
||||||
@ -157,22 +158,26 @@ internal class DropboxCloudContentRepository(private val cloud: DropboxCloud, co
|
|||||||
try {
|
try {
|
||||||
cloud.read(file, encryptedTmpFile, data, progressAware)
|
cloud.read(file, encryptedTmpFile, data, progressAware)
|
||||||
} catch (e: IOException) {
|
} catch (e: IOException) {
|
||||||
if (ExceptionUtil.contains(e, DownloadErrorException::class.java)) {
|
mapToNoSuchCloudFileExceptionIfMatches(e, file)?.let { throw it } ?: throw FatalBackendException(e)
|
||||||
if (ExceptionUtil.extract(e, DownloadErrorException::class.java).get().errorValue.pathValue.isNotFound) {
|
|
||||||
throw NoSuchCloudFileException(file.name)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
throw FatalBackendException(e)
|
|
||||||
} catch (e: DbxException) {
|
} catch (e: DbxException) {
|
||||||
if (ExceptionUtil.contains(e, DownloadErrorException::class.java)) {
|
mapToNoSuchCloudFileExceptionIfMatches(e, file)?.let { throw it } ?: throw FatalBackendException(e)
|
||||||
if (ExceptionUtil.extract(e, DownloadErrorException::class.java).get().errorValue.pathValue.isNotFound) {
|
|
||||||
throw NoSuchCloudFileException(file.name)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
throw FatalBackendException(e)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun mapToNoSuchCloudFileExceptionIfMatches(e: Exception, file: DropboxFile) : NoSuchCloudFileException? {
|
||||||
|
if (ExceptionUtil.contains(e, GetMetadataErrorException::class.java)) {
|
||||||
|
if (ExceptionUtil.extract(e, GetMetadataErrorException::class.java).get().errorValue.pathValue.isNotFound) {
|
||||||
|
return NoSuchCloudFileException(file.name)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (ExceptionUtil.contains(e, DownloadErrorException::class.java)) {
|
||||||
|
if (ExceptionUtil.extract(e, DownloadErrorException::class.java).get().errorValue.pathValue.isNotFound) {
|
||||||
|
return NoSuchCloudFileException(file.name)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
@Throws(BackendException::class)
|
@Throws(BackendException::class)
|
||||||
override fun delete(node: DropboxNode) {
|
override fun delete(node: DropboxNode) {
|
||||||
try {
|
try {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user