Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

…lines 1–573 unchanged (573 lines)
574 result = new RemoteOperationResult<>(ResultCode.LOCK_FAILED);
575 } catch (Exception e) {
576 Log_OC.e(TAG, "UploadFileOperation exception: " + e.getLocalizedMessage());
577 result = new RemoteOperationResult<>(e);
578 } finally {
579 result = cleanupE2EUpload(fileLock, channel, e2eFiles, result, object, client, token);
580 }
581
582 completeE2EUpload(result, e2eFiles, client);
583
584 return result;
585 }
586
…lines 587–1185 unchanged (599 lines)
1186
1187 if (result == null) {
1188 result = new RemoteOperationResult<>(ResultCode.UNKNOWN_ERROR);
1189 }
1190
1191 logResult(result, mOriginalStoragePath, mRemotePath);
1192 }
1193
1194 if (result.isSuccess()) {
1195 handleLocalBehaviour(temporalFile, expectedFile, originalFile, client);
1196 } else if (result.getCode() == ResultCode.SYNC_CONFLICT) {
1197 getStorageManager().saveConflict(mFile, mFile.getEtagInConflict());
1198 }
…lines 1199–1773 unchanged (575 lines)

After

…lines 1–574 unchanged (574 lines)
575 } catch (Exception e) {
576 Log_OC.e(TAG, "UploadFileOperation exception: " + e.getLocalizedMessage());
577 result = new RemoteOperationResult<>(e);
578 } finally {
579 result = cleanupE2EUpload(fileLock, channel, e2eFiles, result, object, client, token);
580
581 // update upload status
582 uploadsStorageManager.updateDatabaseUploadResult(result, this);
583 }
584
585 completeE2EUpload(result, e2eFiles, client);
586
587 return result;
588 }
…lines 589–1189 unchanged (601 lines)
1190 if (result == null) {
1191 result = new RemoteOperationResult<>(ResultCode.UNKNOWN_ERROR);
1192 }
1193
1194 logResult(result, mOriginalStoragePath, mRemotePath);
1195
1196 // update upload status
1197 uploadsStorageManager.updateDatabaseUploadResult(result, this);
1198 }
1199
1200 if (result.isSuccess()) {
1201 handleLocalBehaviour(temporalFile, expectedFile, originalFile, client);
1202 } else if (result.getCode() == ResultCode.SYNC_CONFLICT) {
1203 getStorageManager().saveConflict(mFile, mFile.getEtagInConflict());
…lines 1204–1779 unchanged (576 lines)

Before

program
block_comment "/*\n * Nextcloud - Android Client\n *\n * SPDX-FileCopyrightTex"...
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "operations"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "android"
. "."
identifier "annotation"
. "."
identifier "SuppressLint"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "android"
. "."
identifier "content"
. "."
identifier "Context"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "android"
. "."
identifier "net"
. "."
identifier "Uri"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "android"
. "."
identifier "text"
. "."
identifier "TextUtils"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "nextcloud"
. "."
identifier "client"
. "."
identifier "account"
. "."
identifier "User"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "nextcloud"
. "."
identifier "client"
. "."
identifier "device"
. "."
identifier "BatteryStatus"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "nextcloud"
. "."
identifier "client"
. "."
identifier "device"
. "."
identifier "PowerManagementService"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "nextcloud"
. "."
identifier "client"
. "."
identifier "jobs"
. "."
identifier "upload"
. "."
identifier "FileUploadHelper"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "nextcloud"
. "."
identifier "client"
. "."
identifier "jobs"
. "."
identifier "upload"
. "."
identifier "FileUploadWorker"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "nextcloud"
. "."
identifier "client"
. "."
identifier "network"
. "."
identifier "Connectivity"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "nextcloud"
. "."
identifier "client"
. "."
identifier "network"
. "."
identifier "ConnectivityService"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "nextcloud"
. "."
identifier "utils"
. "."
identifier "autoRename"
. "."
identifier "AutoRename"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "nextcloud"
. "."
identifier "utils"
. "."
identifier "e2ee"
. "."
identifier "E2EVersionHelper"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "datamodel"
. "."
identifier "ArbitraryDataProvider"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "datamodel"
. "."
identifier "ArbitraryDataProviderImpl"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "datamodel"
. "."
identifier "FileDataStorageManager"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "datamodel"
. "."
identifier "OCFile"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "datamodel"
. "."
identifier "ThumbnailsCacheManager"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "datamodel"
. "."
identifier "UploadsStorageManager"
; ";"
import_declaration (+25 nodes collapsed)
import_declaration (+25 nodes collapsed)
import_declaration (+25 nodes collapsed)
import_declaration (+25 nodes collapsed)
import_declaration (+25 nodes collapsed)
import_declaration (+25 nodes collapsed)
import_declaration (+25 nodes collapsed)
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "db"
. "."
identifier "OCUpload"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "files"
. "."
identifier "services"
. "."
identifier "NameCollisionPolicy"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "lib"
. "."
identifier "common"
. "."
identifier "OwnCloudClient"
; ";"
import_declaration (+22 nodes collapsed)
import_declaration (+22 nodes collapsed)
import_declaration (+22 nodes collapsed)
import_declaration (+22 nodes collapsed)
import_declaration (+22 nodes collapsed)
import_declaration (+25 nodes collapsed)
import_declaration (+22 nodes collapsed)
import_declaration (+22 nodes collapsed)
import_declaration (+22 nodes collapsed)
import_declaration (+22 nodes collapsed)
import_declaration (+22 nodes collapsed)
import_declaration (+25 nodes collapsed)
import_declaration (+22 nodes collapsed)
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "operations"
. "."
identifier "common"
. "."
identifier "SyncOperation"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "operations"
. "."
identifier "e2e"
. "."
identifier "E2EClientData"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "operations"
. "."
identifier "e2e"
. "."
identifier "E2EData"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "operations"
. "."
identifier "e2e"
. "."
identifier "E2EFiles"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "operations"
. "."
identifier "upload"
. "."
identifier "UploadFileException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "operations"
. "."
identifier "upload"
. "."
identifier "UploadFileOperationExtensionsKt"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "utils"
. "."
identifier "EncryptionUtils"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "utils"
. "."
identifier "EncryptionUtilsV2"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "utils"
. "."
identifier "FileStorageUtils"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "utils"
. "."
identifier "FileUtil"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "utils"
. "."
identifier "MimeType"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "utils"
. "."
identifier "MimeTypeUtil"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "utils"
. "."
identifier "UriUtils"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "utils"
. "."
identifier "theme"
. "."
identifier "CapabilityUtils"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "httpclient"
. "."
identifier "HttpStatus"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "httpclient"
. "."
identifier "methods"
. "."
identifier "RequestEntity"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "File"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "FileInputStream"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "FileNotFoundException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "FileOutputStream"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "IOException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "InputStream"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "OutputStream"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "RandomAccessFile"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "nio"
. "."
identifier "channels"
. "."
identifier "FileChannel"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "nio"
. "."
identifier "channels"
. "."
identifier "FileLock"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "nio"
. "."
identifier "channels"
. "."
identifier "OverlappingFileLockException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "nio"
. "."
identifier "file"
. "."
identifier "Files"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "nio"
. "."
identifier "file"
. "."
identifier "Paths"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "security"
. "."
identifier "InvalidAlgorithmParameterException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "security"
. "."
identifier "InvalidKeyException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "security"
. "."
identifier "NoSuchAlgorithmException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "security"
. "."
identifier "cert"
. "."
identifier "CertificateException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "security"
. "."
identifier "spec"
. "."
identifier "InvalidParameterSpecException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "ArrayList"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "HashMap"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "HashSet"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "List"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Map"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Set"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "concurrent"
. "."
identifier "atomic"
. "."
identifier "AtomicBoolean"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "javax"
. "."
identifier "crypto"
. "."
identifier "BadPaddingException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "javax"
. "."
identifier "crypto"
. "."
identifier "Cipher"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "javax"
. "."
identifier "crypto"
. "."
identifier "IllegalBlockSizeException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "javax"
. "."
identifier "crypto"
. "."
identifier "NoSuchPaddingException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "androidx"
. "."
identifier "annotation"
. "."
identifier "CheckResult"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "androidx"
. "."
identifier "annotation"
. "."
identifier "Nullable"
; ";"
import_declaration
import "import"
scoped_identifier
identifier "kotlin"
. "."
identifier "Triple"
; ";"
import_declaration
import "import"
scoped_identifier
identifier "kotlin"
. "."
identifier "Unit"
; ";"
block_comment "/**\n * Operation performing the update in the ownCloud serve"...
class_declaration
modifiers
public "public"
class "class"
identifier "UploadFileOperation"
superclass
extends "extends"
type_identifier "SyncOperation"
class_body
{ "{"
field_declaration
modifiers
private "private"
static "static"
final "final"
type_identifier "String"
variable_declarator
identifier "TAG"
= "="
method_invocation
class_literal
type_identifier "UploadFileOperation"
. "."
class "class"
. "."
identifier "getSimpleName"
argument_list
( "("
) ")"
; ";"
field_declaration
modifiers
public "public"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "CREATED_BY_USER"
= "="
decimal_integer_literal "0"
; ";"
field_declaration
modifiers
public "public"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "CREATED_AS_INSTANT_PICTURE"
= "="
decimal_integer_literal "1"
; ";"
field_declaration
modifiers
public "public"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "CREATED_AS_INSTANT_VIDEO"
= "="
decimal_integer_literal "2"
; ";"
field_declaration
modifiers
public "public"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "MISSING_FILE_PERMISSION_NOTIFICATION_ID"
= "="
decimal_integer_literal "2501"
; ";"
block_comment "/**\n * OCFile which is to be uploaded.\n */"
field_declaration
modifiers
private "private"
type_identifier "OCFile"
variable_declarator
identifier "mFile"
; ";"
block_comment "/**\n * Original OCFile which is to be uploaded in case f"...
field_declaration
modifiers
private "private"
type_identifier "OCFile"
variable_declarator
identifier "mOldFile"
; ";"
field_declaration
modifiers
private "private"
type_identifier "String"
variable_declarator
identifier "mRemotePath"
; ";"
field_declaration
modifiers
private "private"
type_identifier "String"
variable_declarator
identifier "mFolderUnlockToken"
; ";"
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "mRemoteFolderToBeCreated"
; ";"
field_declaration
modifiers
private "private"
type_identifier "NameCollisionPolicy"
variable_declarator
identifier "mNameCollisionPolicy"
; ";"
field_declaration
modifiers
private "private"
integral_type
int "int"
variable_declarator
identifier "mLocalBehaviour"
; ";"
field_declaration
modifiers
private "private"
integral_type
int "int"
variable_declarator
identifier "mCreatedBy"
; ";"
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "mOnWifiOnly"
; ";"
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "mWhileChargingOnly"
; ";"
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "mIgnoringPowerSaveMode"
; ";"
field_declaration
modifiers
private "private"
final "final"
boolean_type "boolean"
variable_declarator
identifier "mDisableRetries"
; ";"
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "mWasRenamed"
; ";"
field_declaration
modifiers
private "private"
integral_type
long "long"
variable_declarator
identifier "mOCUploadId"
; ";"
block_comment "/**\n * Local path to file which is to be uploaded (befor"...
field_declaration
modifiers
private "private"
type_identifier "String"
variable_declarator
identifier "mOriginalStoragePath"
; ";"
field_declaration (+24 nodes collapsed)
field_declaration
modifiers
private "private"
type_identifier "OnRenameListener"
variable_declarator
identifier "mRenameUploadListener"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "AtomicBoolean"
variable_declarator
identifier "mCancellationRequested"
= "="
object_creation_expression
new "new"
type_identifier "AtomicBoolean"
argument_list
( "("
false "false"
) ")"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "AtomicBoolean"
variable_declarator
identifier "mUploadStarted"
= "="
object_creation_expression
new "new"
type_identifier "AtomicBoolean"
argument_list
( "("
false "false"
) ")"
; ";"
field_declaration
modifiers
private "private"
type_identifier "Context"
variable_declarator
identifier "mContext"
; ";"
field_declaration
modifiers
private "private"
type_identifier "UploadFileRemoteOperation"
variable_declarator
identifier "mUploadOperation"
; ";"
field_declaration
modifiers
private "private"
type_identifier "RequestEntity"
variable_declarator
identifier "mEntity"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "User"
variable_declarator
identifier "user"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "OCUpload"
variable_declarator
identifier "mUpload"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "UploadsStorageManager"
variable_declarator
identifier "uploadsStorageManager"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "ConnectivityService"
variable_declarator
identifier "connectivityService"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "PowerManagementService"
variable_declarator
identifier "powerManagementService"
; ";"
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "encryptedAncestor"
; ";"
field_declaration
modifiers
private "private"
type_identifier "OCFile"
variable_declarator
identifier "duplicatedEncryptedFile"
; ";"
field_declaration
modifiers
private "private"
type_identifier "AtomicBoolean"
variable_declarator
identifier "missingPermissionThrown"
= "="
object_creation_expression
new "new"
type_identifier "AtomicBoolean"
argument_list
( "("
false "false"
) ")"
; ";"
method_declaration (+184 nodes collapsed)
constructor_declaration (+89 nodes collapsed)
constructor_declaration (+437 nodes collapsed)
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isWifiRequired"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "mOnWifiOnly"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isChargingRequired"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "mWhileChargingOnly"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isIgnoringPowerSaveMode"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "mIgnoringPowerSaveMode"
; ";"
} "}"
method_declaration
modifiers
public "public"
type_identifier "User"
identifier "getUser"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "user"
; ";"
} "}"
method_declaration (+32 nodes collapsed)
method_declaration
modifiers
public "public"
type_identifier "OCFile"
identifier "getFile"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "mFile"
; ";"
} "}"
block_comment "/**\n * If remote file was renamed, return original OCFil"...
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Nullable"
public "public"
type_identifier "OCFile"
identifier "getOldFile"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "mOldFile"
; ";"
} "}"
method_declaration
modifiers
public "public"
type_identifier "String"
identifier "getOriginalStoragePath"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "mOriginalStoragePath"
; ";"
} "}"
method_declaration (+21 nodes collapsed)
method_declaration (+21 nodes collapsed)
method_declaration (+21 nodes collapsed)
method_declaration (+21 nodes collapsed)
method_declaration
modifiers
public "public"
integral_type
int "int"
identifier "getLocalBehaviour"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "mLocalBehaviour"
; ";"
} "}"
method_declaration (+21 nodes collapsed)
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "wasRenamed"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "mWasRenamed"
; ";"
} "}"
method_declaration (+45 nodes collapsed)
method_declaration
modifiers
public "public"
integral_type
int "int"
identifier "getCreatedBy"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "mCreatedBy"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isInstantPicture"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
binary_expression
identifier "mCreatedBy"
== "=="
identifier "CREATED_AS_INSTANT_PICTURE"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isInstantVideo"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
binary_expression
identifier "mCreatedBy"
== "=="
identifier "CREATED_AS_INSTANT_VIDEO"
; ";"
} "}"
method_declaration (+21 nodes collapsed)
method_declaration
modifiers
public "public"
integral_type
long "long"
identifier "getOCUploadId"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "mOCUploadId"
; ";"
} "}"
method_declaration
modifiers
public "public"
generic_type
type_identifier "Set"
type_arguments
< "<"
type_identifier "OnDatatransferProgressListener"
> ">"
identifier "getDataTransferListeners"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "mDataTransferListeners"
; ";"
} "}"
method_declaration (+84 nodes collapsed)
method_declaration (+84 nodes collapsed)
method_declaration (+24 nodes collapsed)
method_declaration
modifiers
public "public"
type_identifier "Context"
identifier "getContext"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "mContext"
; ";"
} "}"
method_declaration (+21 nodes collapsed)
method_declaration (+615 nodes collapsed)
line_comment "// region E2E Upload"
method_declaration
modifiers
annotation
@ "@"
identifier "SuppressLint"
annotation_argument_list
( "("
string_literal
" "\""
string_fragment "AndroidLintUseSparseArrays"
" "\""
) ")"
line_comment "// gson cannot handle sparse arrays easily, therefore use ha"...
private "private"
type_identifier "RemoteOperationResult"
identifier "encryptedUpload"
formal_parameters
( "("
formal_parameter
type_identifier "OwnCloudClient"
identifier "client"
, ","
formal_parameter
type_identifier "OCFile"
identifier "parentFile"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "RemoteOperationResult"
variable_declarator
identifier "result"
= "="
null_literal "null"
; ";"
local_variable_declaration (+27 nodes collapsed)
local_variable_declaration
type_identifier "FileLock"
variable_declarator
identifier "fileLock"
= "="
null_literal "null"
; ";"
local_variable_declaration
integral_type
long "long"
variable_declarator
identifier "size"
; ";"
local_variable_declaration
boolean_type "boolean"
variable_declarator
identifier "metadataExists"
= "="
false "false"
; ";"
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "token"
= "="
null_literal "null"
; ";"
local_variable_declaration
type_identifier "Object"
variable_declarator
identifier "object"
= "="
null_literal "null"
; ";"
local_variable_declaration
type_identifier "FileChannel"
variable_declarator
identifier "channel"
= "="
null_literal "null"
; ";"
local_variable_declaration
type_identifier "ArbitraryDataProvider"
variable_declarator
identifier "arbitraryDataProvider"
= "="
object_creation_expression
new "new"
type_identifier "ArbitraryDataProviderImpl"
argument_list
( "("
method_invocation
identifier "getContext"
argument_list
( "("
) ")"
) ")"
; ";"
local_variable_declaration (+25 nodes collapsed)
try_statement
try "try"
block (+749 nodes collapsed)
catch_clause (+54 nodes collapsed)
catch_clause (+45 nodes collapsed)
catch_clause (+51 nodes collapsed)
finally_clause
finally "finally"
block
{ "{"
expression_statement (+23 nodes collapsed)
} "}"
expression_statement
method_invocation
identifier "completeE2EUpload"
argument_list
( "("
identifier "result"
, ","
identifier "e2eFiles"
, ","
identifier "client"
) ")"
; ";"
return_statement
return "return"
identifier "result"
; ";"
} "}"
method_declaration (+41 nodes collapsed)
method_declaration (+57 nodes collapsed)
method_declaration (+174 nodes collapsed)
method_declaration (+177 nodes collapsed)
method_declaration (+217 nodes collapsed)
method_declaration (+135 nodes collapsed)
method_declaration (+183 nodes collapsed)
method_declaration (+436 nodes collapsed)
method_declaration (+63 nodes collapsed)
method_declaration (+139 nodes collapsed)
method_declaration (+184 nodes collapsed)
method_declaration (+211 nodes collapsed)
method_declaration (+355 nodes collapsed)
method_declaration (+130 nodes collapsed)
method_declaration (+122 nodes collapsed)
method_declaration (+635 nodes collapsed)
line_comment "// endregion"
method_declaration (+338 nodes collapsed)
method_declaration
modifiers
private "private"
type_identifier "RemoteOperationResult"
identifier "normalUpload"
formal_parameters
( "("
formal_parameter
type_identifier "OwnCloudClient"
identifier "client"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "RemoteOperationResult"
variable_declarator
identifier "result"
= "="
null_literal "null"
; ";"
local_variable_declaration
type_identifier "File"
variable_declarator
identifier "temporalFile"
= "="
null_literal "null"
; ";"
local_variable_declaration
type_identifier "File"
variable_declarator
identifier "originalFile"
= "="
object_creation_expression
new "new"
type_identifier "File"
argument_list
( "("
identifier "mOriginalStoragePath"
) ")"
; ";"
local_variable_declaration
type_identifier "File"
variable_declarator
identifier "expectedFile"
= "="
null_literal "null"
; ";"
local_variable_declaration
type_identifier "FileLock"
variable_declarator
identifier "fileLock"
= "="
null_literal "null"
; ";"
local_variable_declaration
type_identifier "FileChannel"
variable_declarator
identifier "channel"
= "="
null_literal "null"
; ";"
local_variable_declaration
type_identifier "FileInputStream"
variable_declarator
identifier "fileInputStream"
= "="
null_literal "null"
; ";"
local_variable_declaration
integral_type
long "long"
variable_declarator
identifier "size"
; ";"
try_statement
try "try"
block (+936 nodes collapsed)
catch_clause (+48 nodes collapsed)
catch_clause (+27 nodes collapsed)
finally_clause
finally "finally"
block
{ "{"
expression_statement
method_invocation
identifier "mUploadStarted"
. "."
identifier "set"
argument_list
( "("
false "false"
) ")"
; ";"
if_statement (+104 nodes collapsed)
if_statement (+92 nodes collapsed)
if_statement (+92 nodes collapsed)
if_statement (+55 nodes collapsed)
if_statement (+31 nodes collapsed)
expression_statement
method_invocation
identifier "logResult"
argument_list
( "("
identifier "result"
, ","
identifier "mOriginalStoragePath"
, ","
identifier "mRemotePath"
) ")"
; ";"
} "}"
if_statement (+73 nodes collapsed)
line_comment "// delete temporal file"
if_statement (+56 nodes collapsed)
return_statement
return "return"
identifier "result"
; ";"
} "}"
method_declaration (+65 nodes collapsed)
method_declaration (+258 nodes collapsed)
method_declaration (+152 nodes collapsed)
method_declaration (+441 nodes collapsed)
method_declaration (+76 nodes collapsed)
method_declaration (+595 nodes collapsed)
method_declaration (+22 nodes collapsed)
block_comment "/**\n * Checks the existence of the folder where the curr"...
method_declaration (+228 nodes collapsed)
method_declaration (+177 nodes collapsed)
block_comment "/**\n * Create a new OCFile mFile with new remote path. T"...
method_declaration (+200 nodes collapsed)
block_comment "/**\n * Returns a new and available (does not exists on t"...
method_declaration (+215 nodes collapsed)
method_declaration (+140 nodes collapsed)
block_comment "/**\n * Cancels the current upload process.\n *\n *"...
method_declaration (+116 nodes collapsed)
block_comment "/**\n * As soon as this method return true, upload can be"...
method_declaration (+21 nodes collapsed)
block_comment "/**\n * TODO rewrite with homogeneous fail handling, remo"...
method_declaration (+633 nodes collapsed)
block_comment "/**\n * TODO rewrite with homogeneous fail handling, remo"...
method_declaration (+239 nodes collapsed)
block_comment "/**\n * Saves a OC File after a successful upload.\n *"...
method_declaration (+473 nodes collapsed)
method_declaration (+162 nodes collapsed)
interface_declaration
modifiers
public "public"
interface "interface"
identifier "OnRenameListener"
interface_body
{ "{"
method_declaration
void_type "void"
identifier "onRenameUpload"
formal_parameters
( "("
) ")"
; ";"
} "}"
} "}"

After

program
block_comment "/*\n * Nextcloud - Android Client\n *\n * SPDX-FileCopyrightTex"...
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "operations"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "android"
. "."
identifier "annotation"
. "."
identifier "SuppressLint"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "android"
. "."
identifier "content"
. "."
identifier "Context"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "android"
. "."
identifier "net"
. "."
identifier "Uri"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "android"
. "."
identifier "text"
. "."
identifier "TextUtils"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "nextcloud"
. "."
identifier "client"
. "."
identifier "account"
. "."
identifier "User"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "nextcloud"
. "."
identifier "client"
. "."
identifier "device"
. "."
identifier "BatteryStatus"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "nextcloud"
. "."
identifier "client"
. "."
identifier "device"
. "."
identifier "PowerManagementService"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "nextcloud"
. "."
identifier "client"
. "."
identifier "jobs"
. "."
identifier "upload"
. "."
identifier "FileUploadHelper"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "nextcloud"
. "."
identifier "client"
. "."
identifier "jobs"
. "."
identifier "upload"
. "."
identifier "FileUploadWorker"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "nextcloud"
. "."
identifier "client"
. "."
identifier "network"
. "."
identifier "Connectivity"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "nextcloud"
. "."
identifier "client"
. "."
identifier "network"
. "."
identifier "ConnectivityService"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "nextcloud"
. "."
identifier "utils"
. "."
identifier "autoRename"
. "."
identifier "AutoRename"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "nextcloud"
. "."
identifier "utils"
. "."
identifier "e2ee"
. "."
identifier "E2EVersionHelper"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "datamodel"
. "."
identifier "ArbitraryDataProvider"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "datamodel"
. "."
identifier "ArbitraryDataProviderImpl"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "datamodel"
. "."
identifier "FileDataStorageManager"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "datamodel"
. "."
identifier "OCFile"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "datamodel"
. "."
identifier "ThumbnailsCacheManager"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "datamodel"
. "."
identifier "UploadsStorageManager"
; ";"
import_declaration (+25 nodes collapsed)
import_declaration (+25 nodes collapsed)
import_declaration (+25 nodes collapsed)
import_declaration (+25 nodes collapsed)
import_declaration (+25 nodes collapsed)
import_declaration (+25 nodes collapsed)
import_declaration (+25 nodes collapsed)
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "db"
. "."
identifier "OCUpload"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "files"
. "."
identifier "services"
. "."
identifier "NameCollisionPolicy"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "lib"
. "."
identifier "common"
. "."
identifier "OwnCloudClient"
; ";"
import_declaration (+22 nodes collapsed)
import_declaration (+22 nodes collapsed)
import_declaration (+22 nodes collapsed)
import_declaration (+22 nodes collapsed)
import_declaration (+22 nodes collapsed)
import_declaration (+25 nodes collapsed)
import_declaration (+22 nodes collapsed)
import_declaration (+22 nodes collapsed)
import_declaration (+22 nodes collapsed)
import_declaration (+22 nodes collapsed)
import_declaration (+22 nodes collapsed)
import_declaration (+25 nodes collapsed)
import_declaration (+22 nodes collapsed)
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "operations"
. "."
identifier "common"
. "."
identifier "SyncOperation"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "operations"
. "."
identifier "e2e"
. "."
identifier "E2EClientData"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "operations"
. "."
identifier "e2e"
. "."
identifier "E2EData"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "operations"
. "."
identifier "e2e"
. "."
identifier "E2EFiles"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "operations"
. "."
identifier "upload"
. "."
identifier "UploadFileException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "operations"
. "."
identifier "upload"
. "."
identifier "UploadFileOperationExtensionsKt"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "utils"
. "."
identifier "EncryptionUtils"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "utils"
. "."
identifier "EncryptionUtilsV2"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "utils"
. "."
identifier "FileStorageUtils"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "utils"
. "."
identifier "FileUtil"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "utils"
. "."
identifier "MimeType"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "utils"
. "."
identifier "MimeTypeUtil"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "utils"
. "."
identifier "UriUtils"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "utils"
. "."
identifier "theme"
. "."
identifier "CapabilityUtils"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "httpclient"
. "."
identifier "HttpStatus"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "httpclient"
. "."
identifier "methods"
. "."
identifier "RequestEntity"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "File"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "FileInputStream"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "FileNotFoundException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "FileOutputStream"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "IOException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "InputStream"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "OutputStream"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "RandomAccessFile"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "nio"
. "."
identifier "channels"
. "."
identifier "FileChannel"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "nio"
. "."
identifier "channels"
. "."
identifier "FileLock"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "nio"
. "."
identifier "channels"
. "."
identifier "OverlappingFileLockException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "nio"
. "."
identifier "file"
. "."
identifier "Files"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "nio"
. "."
identifier "file"
. "."
identifier "Paths"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "security"
. "."
identifier "InvalidAlgorithmParameterException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "security"
. "."
identifier "InvalidKeyException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "security"
. "."
identifier "NoSuchAlgorithmException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "security"
. "."
identifier "cert"
. "."
identifier "CertificateException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "security"
. "."
identifier "spec"
. "."
identifier "InvalidParameterSpecException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "ArrayList"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "HashMap"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "HashSet"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "List"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Map"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Set"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "concurrent"
. "."
identifier "atomic"
. "."
identifier "AtomicBoolean"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "javax"
. "."
identifier "crypto"
. "."
identifier "BadPaddingException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "javax"
. "."
identifier "crypto"
. "."
identifier "Cipher"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "javax"
. "."
identifier "crypto"
. "."
identifier "IllegalBlockSizeException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "javax"
. "."
identifier "crypto"
. "."
identifier "NoSuchPaddingException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "androidx"
. "."
identifier "annotation"
. "."
identifier "CheckResult"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "androidx"
. "."
identifier "annotation"
. "."
identifier "Nullable"
; ";"
import_declaration
import "import"
scoped_identifier
identifier "kotlin"
. "."
identifier "Triple"
; ";"
import_declaration
import "import"
scoped_identifier
identifier "kotlin"
. "."
identifier "Unit"
; ";"
block_comment "/**\n * Operation performing the update in the ownCloud serve"...
class_declaration
modifiers
public "public"
class "class"
identifier "UploadFileOperation"
superclass
extends "extends"
type_identifier "SyncOperation"
class_body
{ "{"
field_declaration
modifiers
private "private"
static "static"
final "final"
type_identifier "String"
variable_declarator
identifier "TAG"
= "="
method_invocation
class_literal
type_identifier "UploadFileOperation"
. "."
class "class"
. "."
identifier "getSimpleName"
argument_list
( "("
) ")"
; ";"
field_declaration
modifiers
public "public"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "CREATED_BY_USER"
= "="
decimal_integer_literal "0"
; ";"
field_declaration
modifiers
public "public"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "CREATED_AS_INSTANT_PICTURE"
= "="
decimal_integer_literal "1"
; ";"
field_declaration
modifiers
public "public"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "CREATED_AS_INSTANT_VIDEO"
= "="
decimal_integer_literal "2"
; ";"
field_declaration
modifiers
public "public"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "MISSING_FILE_PERMISSION_NOTIFICATION_ID"
= "="
decimal_integer_literal "2501"
; ";"
block_comment "/**\n * OCFile which is to be uploaded.\n */"
field_declaration
modifiers
private "private"
type_identifier "OCFile"
variable_declarator
identifier "mFile"
; ";"
block_comment "/**\n * Original OCFile which is to be uploaded in case f"...
field_declaration
modifiers
private "private"
type_identifier "OCFile"
variable_declarator
identifier "mOldFile"
; ";"
field_declaration
modifiers
private "private"
type_identifier "String"
variable_declarator
identifier "mRemotePath"
; ";"
field_declaration
modifiers
private "private"
type_identifier "String"
variable_declarator
identifier "mFolderUnlockToken"
; ";"
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "mRemoteFolderToBeCreated"
; ";"
field_declaration
modifiers
private "private"
type_identifier "NameCollisionPolicy"
variable_declarator
identifier "mNameCollisionPolicy"
; ";"
field_declaration
modifiers
private "private"
integral_type
int "int"
variable_declarator
identifier "mLocalBehaviour"
; ";"
field_declaration
modifiers
private "private"
integral_type
int "int"
variable_declarator
identifier "mCreatedBy"
; ";"
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "mOnWifiOnly"
; ";"
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "mWhileChargingOnly"
; ";"
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "mIgnoringPowerSaveMode"
; ";"
field_declaration
modifiers
private "private"
final "final"
boolean_type "boolean"
variable_declarator
identifier "mDisableRetries"
; ";"
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "mWasRenamed"
; ";"
field_declaration
modifiers
private "private"
integral_type
long "long"
variable_declarator
identifier "mOCUploadId"
; ";"
block_comment "/**\n * Local path to file which is to be uploaded (befor"...
field_declaration
modifiers
private "private"
type_identifier "String"
variable_declarator
identifier "mOriginalStoragePath"
; ";"
field_declaration (+24 nodes collapsed)
field_declaration
modifiers
private "private"
type_identifier "OnRenameListener"
variable_declarator
identifier "mRenameUploadListener"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "AtomicBoolean"
variable_declarator
identifier "mCancellationRequested"
= "="
object_creation_expression
new "new"
type_identifier "AtomicBoolean"
argument_list
( "("
false "false"
) ")"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "AtomicBoolean"
variable_declarator
identifier "mUploadStarted"
= "="
object_creation_expression
new "new"
type_identifier "AtomicBoolean"
argument_list
( "("
false "false"
) ")"
; ";"
field_declaration
modifiers
private "private"
type_identifier "Context"
variable_declarator
identifier "mContext"
; ";"
field_declaration
modifiers
private "private"
type_identifier "UploadFileRemoteOperation"
variable_declarator
identifier "mUploadOperation"
; ";"
field_declaration
modifiers
private "private"
type_identifier "RequestEntity"
variable_declarator
identifier "mEntity"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "User"
variable_declarator
identifier "user"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "OCUpload"
variable_declarator
identifier "mUpload"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "UploadsStorageManager"
variable_declarator
identifier "uploadsStorageManager"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "ConnectivityService"
variable_declarator
identifier "connectivityService"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "PowerManagementService"
variable_declarator
identifier "powerManagementService"
; ";"
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "encryptedAncestor"
; ";"
field_declaration
modifiers
private "private"
type_identifier "OCFile"
variable_declarator
identifier "duplicatedEncryptedFile"
; ";"
field_declaration
modifiers
private "private"
type_identifier "AtomicBoolean"
variable_declarator
identifier "missingPermissionThrown"
= "="
object_creation_expression
new "new"
type_identifier "AtomicBoolean"
argument_list
( "("
false "false"
) ")"
; ";"
method_declaration (+184 nodes collapsed)
constructor_declaration (+89 nodes collapsed)
constructor_declaration (+437 nodes collapsed)
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isWifiRequired"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "mOnWifiOnly"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isChargingRequired"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "mWhileChargingOnly"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isIgnoringPowerSaveMode"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "mIgnoringPowerSaveMode"
; ";"
} "}"
method_declaration
modifiers
public "public"
type_identifier "User"
identifier "getUser"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "user"
; ";"
} "}"
method_declaration (+32 nodes collapsed)
method_declaration
modifiers
public "public"
type_identifier "OCFile"
identifier "getFile"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "mFile"
; ";"
} "}"
block_comment "/**\n * If remote file was renamed, return original OCFil"...
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Nullable"
public "public"
type_identifier "OCFile"
identifier "getOldFile"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "mOldFile"
; ";"
} "}"
method_declaration
modifiers
public "public"
type_identifier "String"
identifier "getOriginalStoragePath"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "mOriginalStoragePath"
; ";"
} "}"
method_declaration (+21 nodes collapsed)
method_declaration (+21 nodes collapsed)
method_declaration (+21 nodes collapsed)
method_declaration (+21 nodes collapsed)
method_declaration
modifiers
public "public"
integral_type
int "int"
identifier "getLocalBehaviour"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "mLocalBehaviour"
; ";"
} "}"
method_declaration (+21 nodes collapsed)
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "wasRenamed"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "mWasRenamed"
; ";"
} "}"
method_declaration (+45 nodes collapsed)
method_declaration
modifiers
public "public"
integral_type
int "int"
identifier "getCreatedBy"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "mCreatedBy"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isInstantPicture"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
binary_expression
identifier "mCreatedBy"
== "=="
identifier "CREATED_AS_INSTANT_PICTURE"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isInstantVideo"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
binary_expression
identifier "mCreatedBy"
== "=="
identifier "CREATED_AS_INSTANT_VIDEO"
; ";"
} "}"
method_declaration (+21 nodes collapsed)
method_declaration
modifiers
public "public"
integral_type
long "long"
identifier "getOCUploadId"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "mOCUploadId"
; ";"
} "}"
method_declaration
modifiers
public "public"
generic_type
type_identifier "Set"
type_arguments
< "<"
type_identifier "OnDatatransferProgressListener"
> ">"
identifier "getDataTransferListeners"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "mDataTransferListeners"
; ";"
} "}"
method_declaration (+84 nodes collapsed)
method_declaration (+84 nodes collapsed)
method_declaration (+24 nodes collapsed)
method_declaration
modifiers
public "public"
type_identifier "Context"
identifier "getContext"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "mContext"
; ";"
} "}"
method_declaration (+21 nodes collapsed)
method_declaration (+615 nodes collapsed)
line_comment "// region E2E Upload"
method_declaration
modifiers
annotation
@ "@"
identifier "SuppressLint"
annotation_argument_list
( "("
string_literal
" "\""
string_fragment "AndroidLintUseSparseArrays"
" "\""
) ")"
line_comment "// gson cannot handle sparse arrays easily, therefore use ha"...
private "private"
type_identifier "RemoteOperationResult"
identifier "encryptedUpload"
formal_parameters
( "("
formal_parameter
type_identifier "OwnCloudClient"
identifier "client"
, ","
formal_parameter
type_identifier "OCFile"
identifier "parentFile"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "RemoteOperationResult"
variable_declarator
identifier "result"
= "="
null_literal "null"
; ";"
local_variable_declaration (+27 nodes collapsed)
local_variable_declaration
type_identifier "FileLock"
variable_declarator
identifier "fileLock"
= "="
null_literal "null"
; ";"
local_variable_declaration
integral_type
long "long"
variable_declarator
identifier "size"
; ";"
local_variable_declaration
boolean_type "boolean"
variable_declarator
identifier "metadataExists"
= "="
false "false"
; ";"
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "token"
= "="
null_literal "null"
; ";"
local_variable_declaration
type_identifier "Object"
variable_declarator
identifier "object"
= "="
null_literal "null"
; ";"
local_variable_declaration
type_identifier "FileChannel"
variable_declarator
identifier "channel"
= "="
null_literal "null"
; ";"
local_variable_declaration
type_identifier "ArbitraryDataProvider"
variable_declarator
identifier "arbitraryDataProvider"
= "="
object_creation_expression
new "new"
type_identifier "ArbitraryDataProviderImpl"
argument_list
( "("
method_invocation
identifier "getContext"
argument_list
( "("
) ")"
) ")"
; ";"
local_variable_declaration (+25 nodes collapsed)
try_statement
try "try"
block (+749 nodes collapsed)
catch_clause (+54 nodes collapsed)
catch_clause (+45 nodes collapsed)
catch_clause (+51 nodes collapsed)
finally_clause
finally "finally"
block
{ "{"
expression_statement (+23 nodes collapsed)
line_comment "// update upload status"
expression_statement
method_invocation
identifier "uploadsStorageManager"
. "."
identifier "updateDatabaseUploadResult"
argument_list
( "("
identifier "result"
, ","
this "this"
) ")"
; ";"
} "}"
expression_statement
method_invocation
identifier "completeE2EUpload"
argument_list
( "("
identifier "result"
, ","
identifier "e2eFiles"
, ","
identifier "client"
) ")"
; ";"
return_statement
return "return"
identifier "result"
; ";"
} "}"
method_declaration (+41 nodes collapsed)
method_declaration (+57 nodes collapsed)
method_declaration (+174 nodes collapsed)
method_declaration (+177 nodes collapsed)
method_declaration (+217 nodes collapsed)
method_declaration (+135 nodes collapsed)
method_declaration (+183 nodes collapsed)
method_declaration (+436 nodes collapsed)
method_declaration (+63 nodes collapsed)
method_declaration (+139 nodes collapsed)
method_declaration (+184 nodes collapsed)
method_declaration (+211 nodes collapsed)
method_declaration (+355 nodes collapsed)
method_declaration (+130 nodes collapsed)
method_declaration (+122 nodes collapsed)
method_declaration (+635 nodes collapsed)
line_comment "// endregion"
method_declaration (+338 nodes collapsed)
method_declaration
modifiers
private "private"
type_identifier "RemoteOperationResult"
identifier "normalUpload"
formal_parameters
( "("
formal_parameter
type_identifier "OwnCloudClient"
identifier "client"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "RemoteOperationResult"
variable_declarator
identifier "result"
= "="
null_literal "null"
; ";"
local_variable_declaration
type_identifier "File"
variable_declarator
identifier "temporalFile"
= "="
null_literal "null"
; ";"
local_variable_declaration
type_identifier "File"
variable_declarator
identifier "originalFile"
= "="
object_creation_expression
new "new"
type_identifier "File"
argument_list
( "("
identifier "mOriginalStoragePath"
) ")"
; ";"
local_variable_declaration
type_identifier "File"
variable_declarator
identifier "expectedFile"
= "="
null_literal "null"
; ";"
local_variable_declaration
type_identifier "FileLock"
variable_declarator
identifier "fileLock"
= "="
null_literal "null"
; ";"
local_variable_declaration
type_identifier "FileChannel"
variable_declarator
identifier "channel"
= "="
null_literal "null"
; ";"
local_variable_declaration
type_identifier "FileInputStream"
variable_declarator
identifier "fileInputStream"
= "="
null_literal "null"
; ";"
local_variable_declaration
integral_type
long "long"
variable_declarator
identifier "size"
; ";"
try_statement
try "try"
block (+936 nodes collapsed)
catch_clause (+48 nodes collapsed)
catch_clause (+27 nodes collapsed)
finally_clause
finally "finally"
block
{ "{"
expression_statement
method_invocation
identifier "mUploadStarted"
. "."
identifier "set"
argument_list
( "("
false "false"
) ")"
; ";"
if_statement (+104 nodes collapsed)
if_statement (+92 nodes collapsed)
if_statement (+92 nodes collapsed)
if_statement (+55 nodes collapsed)
if_statement (+31 nodes collapsed)
expression_statement
method_invocation
identifier "logResult"
argument_list
( "("
identifier "result"
, ","
identifier "mOriginalStoragePath"
, ","
identifier "mRemotePath"
) ")"
; ";"
line_comment "// update upload status"
expression_statement
method_invocation
identifier "uploadsStorageManager"
. "."
identifier "updateDatabaseUploadResult"
argument_list
( "("
identifier "result"
, ","
this "this"
) ")"
; ";"
} "}"
if_statement (+73 nodes collapsed)
line_comment "// delete temporal file"
if_statement (+56 nodes collapsed)
return_statement
return "return"
identifier "result"
; ";"
} "}"
method_declaration (+65 nodes collapsed)
method_declaration (+258 nodes collapsed)
method_declaration (+152 nodes collapsed)
method_declaration (+441 nodes collapsed)
method_declaration (+76 nodes collapsed)
method_declaration (+595 nodes collapsed)
method_declaration (+22 nodes collapsed)
block_comment "/**\n * Checks the existence of the folder where the curr"...
method_declaration (+228 nodes collapsed)
method_declaration (+177 nodes collapsed)
block_comment "/**\n * Create a new OCFile mFile with new remote path. T"...
method_declaration (+200 nodes collapsed)
block_comment "/**\n * Returns a new and available (does not exists on t"...
method_declaration (+215 nodes collapsed)
method_declaration (+140 nodes collapsed)
block_comment "/**\n * Cancels the current upload process.\n *\n *"...
method_declaration (+116 nodes collapsed)
block_comment "/**\n * As soon as this method return true, upload can be"...
method_declaration (+21 nodes collapsed)
block_comment "/**\n * TODO rewrite with homogeneous fail handling, remo"...
method_declaration (+633 nodes collapsed)
block_comment "/**\n * TODO rewrite with homogeneous fail handling, remo"...
method_declaration (+239 nodes collapsed)
block_comment "/**\n * Saves a OC File after a successful upload.\n *"...
method_declaration (+473 nodes collapsed)
method_declaration (+162 nodes collapsed)
interface_declaration
modifiers
public "public"
interface "interface"
identifier "OnRenameListener"
interface_body
{ "{"
method_declaration
void_type "void"
identifier "onRenameUpload"
formal_parameters
( "("
) ")"
; ";"
} "}"
} "}"