/** * Creates a OwnCloudClient to access a URL and sets the desired parameters for ownCloud * client connections. * * @param uri URL to the ownCloud server; BASE ENTRY POINT, not WebDavPATH * @param context Android context where the OwnCloudClient is being created. * @return A OwnCloudClient object ready to be used */ public static OwnCloudClient createOwnCloudClient(Uri uri, Context context, boolean followRedirects, boolean useNextcloudUserAgent) { try { NetworkUtils.registerAdvancedSslContext(true, context); } catch (GeneralSecurityException e) { Log_OC.e(TAG, "Advanced SSL Context could not be loaded. Default SSL management in" + " the system will be used for HTTPS connections", e); } catch (IOException e) { Log_OC.e(TAG, "The local server truststore could not be read. Default SSL management" + " in the system will be used for HTTPS connections", e); } OwnCloudClient client = new OwnCloudClient(uri, NetworkUtils.getMultiThreadedConnManager(), useNextcloudUserAgent); client.setDefaultTimeouts(DEFAULT_DATA_TIMEOUT, DEFAULT_CONNECTION_TIMEOUT); client.setFollowRedirects(followRedirects); return client; }