Skip to content

Commit

Permalink
Merge pull request #507 from cryptomator/refactoring/code-style
Browse files Browse the repository at this point in the history
Reformatted the project
  • Loading branch information
JaniruTEC committed Oct 27, 2023
2 parents 12311bf + 37cfd21 commit accc172
Show file tree
Hide file tree
Showing 105 changed files with 519 additions and 481 deletions.
38 changes: 36 additions & 2 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def liteFlavor() {
}

def getApiKeyLocal(key) {
if(!rootProject.file("local.properties").exists()) {
if (!rootProject.file("local.properties").exists()) {
return ""
}
def localPropertyList = new Properties()
Expand Down
122 changes: 61 additions & 61 deletions buildsystem/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -116,69 +116,69 @@ ext {
jsonWebTokenApiVersion = '0.11.5'

dependencies = [
android : "com.google.android:android:${androidVersion}",
androidAnnotations : "androidx.annotation:annotation:${androidSupportAnnotationsVersion}",
appcompat : "androidx.appcompat:appcompat:${androidSupportAppcompatVersion}",
androidxBiometric : "androidx.biometric:biometric:${androidxBiometricVersion}",
androidxCore : "androidx.core:core-ktx:${androidxCoreVersion}",
androidxFragment : "androidx.fragment:fragment-ktx:${androidxFragmentVersion}",
androidxViewpager : "androidx.viewpager:viewpager:${androidxViewpagerVersion}",
androidxSwiperefresh : "androidx.swiperefreshlayout:swiperefreshlayout:${androidxSwiperefreshVersion}",
androidxPreference : "androidx.preference:preference:${androidxPreferenceVersion}",
documentFile : "androidx.documentfile:documentfile:${androidxDocumentfileVersion}",
recyclerView : "androidx.recyclerview:recyclerview:${androidxRecyclerViewVersion}",
androidxSplashscreen : "androidx.core:core-splashscreen:${androidxSplashscreenVersion}",
androidxTestCore : "androidx.test:core:${androidxTestCoreVersion}",
androidxTestJunitKtln : "androidx.test.ext:junit-ktx:${androidxTestJunitKtlnVersion}",
commonsCodec : "commons-codec:commons-codec:${commonsCodecVersion}",
cryptolib : "org.cryptomator:cryptolib:${cryptolibVersion}",
dagger : "com.google.dagger:dagger:${daggerVersion}",
daggerCompiler : "com.google.dagger:dagger-compiler:${daggerVersion}",
design : "com.google.android.material:material:${androidMaterialDesignVersion}",
coreDesugaring : "com.android.tools:desugar_jdk_libs:${coreDesugaringVersion}",
dropbox : "com.dropbox.core:dropbox-core-sdk:${dropboxVersion}",
espresso : "androidx.test.espresso:espresso-core:${espressoVersion}",
googleApiClientAndroid: "com.google.api-client:google-api-client-android:${googleClientVersion}",
googleApiServicesDrive: "com.google.apis:google-api-services-drive:${googleApiServicesVersion}",
googlePlayServicesAuth: "com.google.android.gms:play-services-auth:${googlePlayServicesVersion}",
android : "com.google.android:android:${androidVersion}",
androidAnnotations : "androidx.annotation:annotation:${androidSupportAnnotationsVersion}",
appcompat : "androidx.appcompat:appcompat:${androidSupportAppcompatVersion}",
androidxBiometric : "androidx.biometric:biometric:${androidxBiometricVersion}",
androidxCore : "androidx.core:core-ktx:${androidxCoreVersion}",
androidxFragment : "androidx.fragment:fragment-ktx:${androidxFragmentVersion}",
androidxViewpager : "androidx.viewpager:viewpager:${androidxViewpagerVersion}",
androidxSwiperefresh : "androidx.swiperefreshlayout:swiperefreshlayout:${androidxSwiperefreshVersion}",
androidxPreference : "androidx.preference:preference:${androidxPreferenceVersion}",
documentFile : "androidx.documentfile:documentfile:${androidxDocumentfileVersion}",
recyclerView : "androidx.recyclerview:recyclerview:${androidxRecyclerViewVersion}",
androidxSplashscreen : "androidx.core:core-splashscreen:${androidxSplashscreenVersion}",
androidxTestCore : "androidx.test:core:${androidxTestCoreVersion}",
androidxTestJunitKtln : "androidx.test.ext:junit-ktx:${androidxTestJunitKtlnVersion}",
commonsCodec : "commons-codec:commons-codec:${commonsCodecVersion}",
cryptolib : "org.cryptomator:cryptolib:${cryptolibVersion}",
dagger : "com.google.dagger:dagger:${daggerVersion}",
daggerCompiler : "com.google.dagger:dagger-compiler:${daggerVersion}",
design : "com.google.android.material:material:${androidMaterialDesignVersion}",
coreDesugaring : "com.android.tools:desugar_jdk_libs:${coreDesugaringVersion}",
dropbox : "com.dropbox.core:dropbox-core-sdk:${dropboxVersion}",
espresso : "androidx.test.espresso:espresso-core:${espressoVersion}",
googleApiClientAndroid : "com.google.api-client:google-api-client-android:${googleClientVersion}",
googleApiServicesDrive : "com.google.apis:google-api-services-drive:${googleApiServicesVersion}",
googlePlayServicesAuth : "com.google.android.gms:play-services-auth:${googlePlayServicesVersion}",
trackingFreeGoogleCLient : files("lib/google-http-client-${trackingFreeGoogleCLientVersion}.jar"),
trackingFreeGoogleAndroidCLient: files("lib/google-http-client-android-${trackingFreeGoogleCLientVersion}.jar"),
greenDao : "org.greenrobot:greendao:${greenDaoVersion}",
gson : "com.google.code.gson:gson:${gsonVersion}",
hamcrest : "org.hamcrest:hamcrest-all:${hamcrestVersion}",
javaxAnnotation : "javax.annotation:jsr250-api:${javaxAnnotationVersion}",
junit : "org.junit.jupiter:junit-jupiter:${jUnitVersion}",
junitApi : "org.junit.jupiter:junit-jupiter-api:${jUnitVersion}",
junitEngine : "org.junit.jupiter:junit-jupiter-engine:${jUnitVersion}",
junitParams : "org.junit.jupiter:junit-jupiter-params:${jUnitVersion}",
junit4Engine : "org.junit.vintage:junit-vintage-engine:${jUnitVersion}",
minIo : "io.minio:minio:${minIoVersion}",
mockito : "org.mockito:mockito-core:${mockitoVersion}",
mockitoInline : "org.mockito:mockito-inline:${mockitoVersion}",
mockitoKotlin : "org.mockito.kotlin:mockito-kotlin:${mockitoKotlinVersion}",
msgraph : "com.microsoft.graph:microsoft-graph:${msgraphVersion}",
msgraphAuth : "com.microsoft.identity.client:msal:${msgraphAuthVersion}",
multidex : "androidx.multidex:multidex:${multidexVersion}",
okHttp : "com.squareup.okhttp3:okhttp:${okHttpVersion}",
okHttpDigest : "io.github.rburgst:okhttp-digest:${okHttpDigestVersion}",
recyclerViewFastScroll: "com.simplecityapps:recyclerview-fastscroll:${recyclerViewFastScrollVersion}",
rxJava : "io.reactivex.rxjava2:rxjava:${rxJavaVersion}",
rxAndroid : "io.reactivex.rxjava2:rxandroid:${rxAndroidVersion}",
rxBinding : "com.jakewharton.rxbinding2:rxbinding:${rxBindingVersion}",
stax : "stax:stax:${staxVersion}",
testingSupportLib : "com.android.support.test:testing-support-lib:${testingSupportLibVersion}",
timber : "com.jakewharton.timber:timber:${timberVersion}",
velocity : "org.apache.velocity:velocity-engine-core:${velocityVersion}",
runner : "androidx.test:runner:${runnerVersion}",
rules : "androidx.test:rules:${rulesVersion}",
contribution : "androidx.test.espresso:espresso-contrib:${contributionVersion}",
uiAutomator : "androidx.test.uiautomator:uiautomator:${uiautomatorVersion}",
zxcvbn : "com.nulab-inc:zxcvbn:${zxcvbnVersion}",
scaleImageView : "com.davemorrissey.labs:subsampling-scale-image-view:${scaleImageViewVersion}",
lruFileCache : "com.github.solkin:disk-lru-cache:${lruFileCacheVersion}",
jsonWebTokenApi : "io.jsonwebtoken:jjwt-api:${jsonWebTokenApiVersion}",
jsonWebTokenImpl : "io.jsonwebtoken:jjwt-impl:${jsonWebTokenApiVersion}",
jsonWebTokenJson : "io.jsonwebtoken:jjwt-orgjson:${jsonWebTokenApiVersion}"
greenDao : "org.greenrobot:greendao:${greenDaoVersion}",
gson : "com.google.code.gson:gson:${gsonVersion}",
hamcrest : "org.hamcrest:hamcrest-all:${hamcrestVersion}",
javaxAnnotation : "javax.annotation:jsr250-api:${javaxAnnotationVersion}",
junit : "org.junit.jupiter:junit-jupiter:${jUnitVersion}",
junitApi : "org.junit.jupiter:junit-jupiter-api:${jUnitVersion}",
junitEngine : "org.junit.jupiter:junit-jupiter-engine:${jUnitVersion}",
junitParams : "org.junit.jupiter:junit-jupiter-params:${jUnitVersion}",
junit4Engine : "org.junit.vintage:junit-vintage-engine:${jUnitVersion}",
minIo : "io.minio:minio:${minIoVersion}",
mockito : "org.mockito:mockito-core:${mockitoVersion}",
mockitoInline : "org.mockito:mockito-inline:${mockitoVersion}",
mockitoKotlin : "org.mockito.kotlin:mockito-kotlin:${mockitoKotlinVersion}",
msgraph : "com.microsoft.graph:microsoft-graph:${msgraphVersion}",
msgraphAuth : "com.microsoft.identity.client:msal:${msgraphAuthVersion}",
multidex : "androidx.multidex:multidex:${multidexVersion}",
okHttp : "com.squareup.okhttp3:okhttp:${okHttpVersion}",
okHttpDigest : "io.github.rburgst:okhttp-digest:${okHttpDigestVersion}",
recyclerViewFastScroll : "com.simplecityapps:recyclerview-fastscroll:${recyclerViewFastScrollVersion}",
rxJava : "io.reactivex.rxjava2:rxjava:${rxJavaVersion}",
rxAndroid : "io.reactivex.rxjava2:rxandroid:${rxAndroidVersion}",
rxBinding : "com.jakewharton.rxbinding2:rxbinding:${rxBindingVersion}",
stax : "stax:stax:${staxVersion}",
testingSupportLib : "com.android.support.test:testing-support-lib:${testingSupportLibVersion}",
timber : "com.jakewharton.timber:timber:${timberVersion}",
velocity : "org.apache.velocity:velocity-engine-core:${velocityVersion}",
runner : "androidx.test:runner:${runnerVersion}",
rules : "androidx.test:rules:${rulesVersion}",
contribution : "androidx.test.espresso:espresso-contrib:${contributionVersion}",
uiAutomator : "androidx.test.uiautomator:uiautomator:${uiautomatorVersion}",
zxcvbn : "com.nulab-inc:zxcvbn:${zxcvbnVersion}",
scaleImageView : "com.davemorrissey.labs:subsampling-scale-image-view:${scaleImageViewVersion}",
lruFileCache : "com.github.solkin:disk-lru-cache:${lruFileCacheVersion}",
jsonWebTokenApi : "io.jsonwebtoken:jjwt-api:${jsonWebTokenApiVersion}",
jsonWebTokenImpl : "io.jsonwebtoken:jjwt-impl:${jsonWebTokenApiVersion}",
jsonWebTokenJson : "io.jsonwebtoken:jjwt-orgjson:${jsonWebTokenApiVersion}"
]

}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import java.io.File
import java.io.IOException
import java.io.OutputStream

internal class DropboxCloudContentRepository(private val cloud: DropboxCloud, context: Context) : InterceptingCloudContentRepository<DropboxCloud, DropboxNode, DropboxFolder, DropboxFile>(Intercepted(cloud, context)){
internal class DropboxCloudContentRepository(private val cloud: DropboxCloud, context: Context) : InterceptingCloudContentRepository<DropboxCloud, DropboxNode, DropboxFolder, DropboxFile>(Intercepted(cloud, context)) {

@Throws(BackendException::class)
override fun throwWrappedIfRequired(e: Exception) {
Expand Down Expand Up @@ -164,13 +164,12 @@ internal class DropboxCloudContentRepository(private val cloud: DropboxCloud, co
}
}

private fun mapToNoSuchCloudFileExceptionIfMatches(e: Exception, file: DropboxFile) : NoSuchCloudFileException? {
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)) {
} else if (ExceptionUtil.contains(e, DownloadErrorException::class.java)) {
if (ExceptionUtil.extract(e, DownloadErrorException::class.java).get().errorValue.pathValue.isNotFound) {
return NoSuchCloudFileException(file.name)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package org.cryptomator.data.cloud.dropbox;

import static org.cryptomator.domain.CloudType.DROPBOX;

import android.content.Context;

import org.cryptomator.data.repository.CloudContentRepositoryFactory;
Expand All @@ -12,6 +10,8 @@
import javax.inject.Inject;
import javax.inject.Singleton;

import static org.cryptomator.domain.CloudType.DROPBOX;

@Singleton
public class DropboxCloudContentRepositoryFactory implements CloudContentRepositoryFactory {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import java.io.OutputStream
import java.net.SocketTimeoutException
import okhttp3.Request

internal class OnedriveCloudContentRepository(private val cloud: OnedriveCloud, graphServiceClient: GraphServiceClient<Request>, context: Context)
: InterceptingCloudContentRepository<OnedriveCloud, OnedriveNode, OnedriveFolder, OnedriveFile>(Intercepted(cloud, graphServiceClient, context)) {
internal class OnedriveCloudContentRepository(private val cloud: OnedriveCloud, graphServiceClient: GraphServiceClient<Request>, context: Context) :
InterceptingCloudContentRepository<OnedriveCloud, OnedriveNode, OnedriveFolder, OnedriveFile>(Intercepted(cloud, graphServiceClient, context)) {

@Throws(BackendException::class)
override fun throwWrappedIfRequired(e: Exception) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package org.cryptomator.data.cloud.onedrive;

import static org.cryptomator.domain.CloudType.ONEDRIVE;

import android.content.Context;

import org.cryptomator.data.repository.CloudContentRepositoryFactory;
Expand All @@ -12,6 +10,8 @@
import javax.inject.Inject;
import javax.inject.Singleton;

import static org.cryptomator.domain.CloudType.ONEDRIVE;

@Singleton
public class OnedriveCloudContentRepositoryFactory implements CloudContentRepositoryFactory {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ interface OnedriveNode : CloudNode {
override val name: String
override val path: String
override val parent: OnedriveFolder?

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package org.cryptomator.data.cloud.pcloud

import java.util.HashSet

object PCloudApiError {

@JvmField
Expand All @@ -14,6 +12,7 @@ object PCloudApiError {
PCloudApiErrorCodes.INVALID_FILE_OR_FOLDER_NAME.value //
)
)

@JvmField
val ignoreMoveSet = HashSet( //
listOf( //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import java.io.File
import java.io.IOException
import java.io.OutputStream

internal class PCloudContentRepository(private val cloud: PCloud, client: ApiClient, context: Context) : InterceptingCloudContentRepository<PCloud, PCloudNode, PCloudFolder, PCloudFile>(Intercepted(cloud, client, context)) {
internal class PCloudContentRepository(private val cloud: PCloud, client: ApiClient, context: Context) :
InterceptingCloudContentRepository<PCloud, PCloudNode, PCloudFolder, PCloudFile>(Intercepted(cloud, client, context)) {

@Throws(BackendException::class)
override fun throwWrappedIfRequired(e: Exception) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package org.cryptomator.data.cloud.pcloud;

import static org.cryptomator.domain.CloudType.PCLOUD;

import android.content.Context;

import org.cryptomator.data.repository.CloudContentRepositoryFactory;
Expand All @@ -12,6 +10,8 @@
import javax.inject.Inject;
import javax.inject.Singleton;

import static org.cryptomator.domain.CloudType.PCLOUD;

@Singleton
public class PCloudContentRepositoryFactory implements CloudContentRepositoryFactory {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package org.cryptomator.data.cloud;

import static java.util.Arrays.asList;

import org.cryptomator.data.cloud.crypto.CryptoCloudContentRepositoryFactory;
import org.cryptomator.data.cloud.dropbox.DropboxCloudContentRepositoryFactory;
import org.cryptomator.data.cloud.googledrive.GoogleDriveCloudContentRepositoryFactory;
Expand All @@ -18,6 +16,8 @@
import javax.inject.Inject;
import javax.inject.Singleton;

import static java.util.Arrays.asList;

@Singleton
public class CloudContentRepositoryFactories implements Iterable<CloudContentRepositoryFactory> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ internal class GoogleDriveImpl(context: Context, googleDriveCloud: GoogleDriveCl
folder?.let {
if (GoogleDriveCloudNodeFactory.isFolder(it)) {
return idCache.cache(GoogleDriveCloudNodeFactory.folder(parent, it))
} else if(GoogleDriveCloudNodeFactory.isShortcutFolder(it)) {
} else if (GoogleDriveCloudNodeFactory.isShortcutFolder(it)) {
return idCache.cache(GoogleDriveCloudNodeFactory.folder(parent, name, path, it.shortcutDetails.targetId))
}
}
Expand Down
Loading

0 comments on commit accc172

Please sign in to comment.