Show specific message if the server doesn't support WebDAV
Fix wrong exception exposed
This commit is contained in:
parent
d93624c5dd
commit
f10ac8798a
@ -2,6 +2,7 @@ package org.cryptomator.data.cloud.webdav
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import org.cryptomator.data.cloud.webdav.network.ConnectionHandlerHandlerImpl
|
import org.cryptomator.data.cloud.webdav.network.ConnectionHandlerHandlerImpl
|
||||||
|
import org.cryptomator.data.cloud.webdav.network.ServerNotWebdavCompatibleException
|
||||||
import org.cryptomator.data.util.CopyStream
|
import org.cryptomator.data.util.CopyStream
|
||||||
import org.cryptomator.data.util.TransferredBytesAwareInputStream
|
import org.cryptomator.data.util.TransferredBytesAwareInputStream
|
||||||
import org.cryptomator.data.util.TransferredBytesAwareOutputStream
|
import org.cryptomator.data.util.TransferredBytesAwareOutputStream
|
||||||
@ -14,6 +15,7 @@ import org.cryptomator.domain.exception.FatalBackendException
|
|||||||
import org.cryptomator.domain.exception.NotFoundException
|
import org.cryptomator.domain.exception.NotFoundException
|
||||||
import org.cryptomator.domain.exception.ParentFolderDoesNotExistException
|
import org.cryptomator.domain.exception.ParentFolderDoesNotExistException
|
||||||
import org.cryptomator.domain.exception.ParentFolderIsNullException
|
import org.cryptomator.domain.exception.ParentFolderIsNullException
|
||||||
|
import org.cryptomator.domain.exception.authentication.WebDavNotSupportedException
|
||||||
import org.cryptomator.domain.usecases.ProgressAware
|
import org.cryptomator.domain.usecases.ProgressAware
|
||||||
import org.cryptomator.domain.usecases.cloud.DataSource
|
import org.cryptomator.domain.usecases.cloud.DataSource
|
||||||
import org.cryptomator.domain.usecases.cloud.DownloadState
|
import org.cryptomator.domain.usecases.cloud.DownloadState
|
||||||
@ -142,7 +144,11 @@ internal class WebDavImpl(private val cloud: WebDavCloud, private val connection
|
|||||||
|
|
||||||
@Throws(BackendException::class)
|
@Throws(BackendException::class)
|
||||||
fun checkAuthenticationAndServerCompatibility(url: String) {
|
fun checkAuthenticationAndServerCompatibility(url: String) {
|
||||||
connectionHandler.checkAuthenticationAndServerCompatibility(url)
|
try {
|
||||||
|
connectionHandler.checkAuthenticationAndServerCompatibility(url)
|
||||||
|
} catch (ex: ServerNotWebdavCompatibleException) {
|
||||||
|
throw WebDavNotSupportedException(cloud)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Throws(BackendException::class, IOException::class)
|
@Throws(BackendException::class, IOException::class)
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
package org.cryptomator.data.cloud.webdav.network;
|
||||||
|
|
||||||
|
import org.cryptomator.domain.exception.BackendException;
|
||||||
|
|
||||||
|
public class ServerNotWebdavCompatibleException extends BackendException {
|
||||||
|
|
||||||
|
}
|
@ -10,7 +10,6 @@ import org.cryptomator.domain.exception.FatalBackendException
|
|||||||
import org.cryptomator.domain.exception.ForbiddenException
|
import org.cryptomator.domain.exception.ForbiddenException
|
||||||
import org.cryptomator.domain.exception.NotFoundException
|
import org.cryptomator.domain.exception.NotFoundException
|
||||||
import org.cryptomator.domain.exception.ParentFolderDoesNotExistException
|
import org.cryptomator.domain.exception.ParentFolderDoesNotExistException
|
||||||
import org.cryptomator.domain.exception.ServerNotWebdavCompatibleException
|
|
||||||
import org.cryptomator.domain.exception.TypeMismatchException
|
import org.cryptomator.domain.exception.TypeMismatchException
|
||||||
import org.cryptomator.domain.exception.UnauthorizedException
|
import org.cryptomator.domain.exception.UnauthorizedException
|
||||||
import org.xmlpull.v1.XmlPullParserException
|
import org.xmlpull.v1.XmlPullParserException
|
||||||
@ -18,7 +17,6 @@ import java.io.ByteArrayInputStream
|
|||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
import java.io.InputStream
|
import java.io.InputStream
|
||||||
import java.net.HttpURLConnection
|
import java.net.HttpURLConnection
|
||||||
import java.util.ArrayList
|
|
||||||
import java.util.Collections
|
import java.util.Collections
|
||||||
import okhttp3.MediaType.Companion.toMediaTypeOrNull
|
import okhttp3.MediaType.Companion.toMediaTypeOrNull
|
||||||
import okhttp3.Request
|
import okhttp3.Request
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
package org.cryptomator.domain.exception;
|
|
||||||
|
|
||||||
public class ServerNotWebdavCompatibleException extends BackendException {
|
|
||||||
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user