-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update version of omh auth library * Update version of omh auth library
- Loading branch information
1 parent
ed4c933
commit fbdc1aa
Showing
11 changed files
with
43 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 5 additions & 2 deletions
7
...ve-nongms/src/main/java/com/omh/android/storage/api/drive/nongms/OmhStorageFactoryImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
package com.omh.android.storage.api.drive.nongms | ||
|
||
import android.content.Context | ||
import com.omh.android.auth.api.OmhAuthClient | ||
import com.omh.android.storage.api.OmhStorageClient | ||
import com.omh.android.storage.api.OmhStorageFactory | ||
|
||
class OmhStorageFactoryImpl : OmhStorageFactory { | ||
|
||
override fun getStorageClient( | ||
context: Context | ||
) = OmhStorageClientImpl.Builder().build(context) | ||
context: Context, | ||
authClient: OmhAuthClient | ||
): OmhStorageClient = OmhStorageClientImpl.Builder().build(context, authClient) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
...rc/main/java/com/omh/android/storage/api/drive/nongms/data/source/FileRemoteDataSource.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 5 additions & 3 deletions
8
storage-api/src/main/java/com/omh/android/storage/api/OmhStorageClient.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
package com.omh.android.storage.api | ||
|
||
import android.content.Context | ||
import com.omh.android.auth.api.OmhAuthClient | ||
|
||
interface OmhStorageClient { | ||
abstract class OmhStorageClient protected constructor(protected val authClient: OmhAuthClient) { | ||
|
||
interface Builder { | ||
fun build(context: Context): OmhStorageClient | ||
|
||
fun build(context: Context, authClient: OmhAuthClient): OmhStorageClient | ||
} | ||
|
||
fun setupAccessToken(token: String) | ||
abstract fun getRepository() | ||
} |
4 changes: 3 additions & 1 deletion
4
storage-api/src/main/java/com/omh/android/storage/api/OmhStorageFactory.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
package com.omh.android.storage.api | ||
|
||
import android.content.Context | ||
import com.omh.android.auth.api.OmhAuthClient | ||
|
||
interface OmhStorageFactory { | ||
fun getStorageClient(context: Context): OmhStorageClient | ||
|
||
fun getStorageClient(context: Context, authClient: OmhAuthClient): OmhStorageClient | ||
} |
5 changes: 3 additions & 2 deletions
5
storage-api/src/main/java/com/omh/android/storage/api/OmhStorageProvider.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
package com.omh.android.storage.api | ||
|
||
import android.content.Context | ||
import com.omh.android.auth.api.OmhAuthClient | ||
import kotlin.reflect.KClass | ||
|
||
object OmhStorageProvider { | ||
|
||
private const val NGMS_ADDRESS = "com.omh.android.storage.api.drive.nongms.OmhStorageFactoryImpl" | ||
|
||
@SuppressWarnings("SwallowedException") | ||
fun provideStorageClient(context: Context): OmhStorageClient { | ||
fun provideStorageClient(context: Context, authClient: OmhAuthClient): OmhStorageClient { | ||
val clazz: KClass<out Any> = Class.forName(NGMS_ADDRESS).kotlin | ||
val omhStorageFactory = clazz.objectInstance as OmhStorageFactory | ||
return omhStorageFactory.getStorageClient(context) | ||
return omhStorageFactory.getStorageClient(context, authClient) | ||
} | ||
} |