mirror of
https://github.com/owncloud/android-library.git
synced 2025-07-29 04:36:54 +00:00
commit
33fc492b37
@ -1,9 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<classpath>
|
|
||||||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
|
|
||||||
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
|
|
||||||
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
|
|
||||||
<classpathentry kind="src" path="src"/>
|
|
||||||
<classpathentry kind="src" path="gen"/>
|
|
||||||
<classpathentry kind="output" path="bin/classes"/>
|
|
||||||
</classpath>
|
|
34
.idea/codeStyles/Project.xml
generated
34
.idea/codeStyles/Project.xml
generated
@ -2,17 +2,11 @@
|
|||||||
<code_scheme name="Project" version="173">
|
<code_scheme name="Project" version="173">
|
||||||
<option name="LINE_SEPARATOR" value=" " />
|
<option name="LINE_SEPARATOR" value=" " />
|
||||||
<option name="RIGHT_MARGIN" value="150" />
|
<option name="RIGHT_MARGIN" value="150" />
|
||||||
<AndroidXmlCodeStyleSettings>
|
|
||||||
<option name="USE_CUSTOM_SETTINGS" value="true" />
|
|
||||||
</AndroidXmlCodeStyleSettings>
|
|
||||||
<JavaCodeStyleSettings>
|
<JavaCodeStyleSettings>
|
||||||
<option name="FIELD_NAME_PREFIX" value="m" />
|
<option name="FIELD_NAME_PREFIX" value="m" />
|
||||||
<option name="STATIC_FIELD_NAME_PREFIX" value="s" />
|
<option name="STATIC_FIELD_NAME_PREFIX" value="s" />
|
||||||
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99999" />
|
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99999" />
|
||||||
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99999" />
|
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99999" />
|
||||||
<option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND">
|
|
||||||
<value />
|
|
||||||
</option>
|
|
||||||
<option name="IMPORT_LAYOUT_TABLE">
|
<option name="IMPORT_LAYOUT_TABLE">
|
||||||
<value>
|
<value>
|
||||||
<package name="android" withSubpackages="true" static="false" />
|
<package name="android" withSubpackages="true" static="false" />
|
||||||
@ -40,36 +34,9 @@
|
|||||||
<MarkdownNavigatorCodeStyleSettings>
|
<MarkdownNavigatorCodeStyleSettings>
|
||||||
<option name="RIGHT_MARGIN" value="72" />
|
<option name="RIGHT_MARGIN" value="72" />
|
||||||
</MarkdownNavigatorCodeStyleSettings>
|
</MarkdownNavigatorCodeStyleSettings>
|
||||||
<Objective-C-extensions>
|
|
||||||
<file>
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" />
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" />
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" />
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" />
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" />
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" />
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" />
|
|
||||||
</file>
|
|
||||||
<class>
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" />
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" />
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" />
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" />
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" />
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" />
|
|
||||||
</class>
|
|
||||||
<extensions>
|
|
||||||
<pair source="cpp" header="h" fileNamingConvention="NONE" />
|
|
||||||
<pair source="c" header="h" fileNamingConvention="NONE" />
|
|
||||||
</extensions>
|
|
||||||
</Objective-C-extensions>
|
|
||||||
<XML>
|
<XML>
|
||||||
<option name="XML_ATTRIBUTE_WRAP" value="0" />
|
<option name="XML_ATTRIBUTE_WRAP" value="0" />
|
||||||
<option name="XML_KEEP_BLANK_LINES" value="1" />
|
<option name="XML_KEEP_BLANK_LINES" value="1" />
|
||||||
<option name="XML_ALIGN_ATTRIBUTES" value="false" />
|
|
||||||
<option name="XML_SPACE_INSIDE_EMPTY_TAG" value="true" />
|
|
||||||
<option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
|
<option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
|
||||||
</XML>
|
</XML>
|
||||||
<codeStyleSettings language="JAVA">
|
<codeStyleSettings language="JAVA">
|
||||||
@ -244,7 +211,6 @@
|
|||||||
</arrangement>
|
</arrangement>
|
||||||
</codeStyleSettings>
|
</codeStyleSettings>
|
||||||
<codeStyleSettings language="XML">
|
<codeStyleSettings language="XML">
|
||||||
<option name="FORCE_REARRANGE_MODE" value="1" />
|
|
||||||
<indentOptions>
|
<indentOptions>
|
||||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
||||||
</indentOptions>
|
</indentOptions>
|
||||||
|
44
.travis.yml
44
.travis.yml
@ -1,44 +0,0 @@
|
|||||||
sudo: false
|
|
||||||
language: android
|
|
||||||
jdk:
|
|
||||||
- oraclejdk8
|
|
||||||
branches:
|
|
||||||
only:
|
|
||||||
- master
|
|
||||||
install:
|
|
||||||
# Let's use the new command 'sdkmanager' to install Android SDK components
|
|
||||||
- yes | sdkmanager --verbose "build-tools;26.0.3"
|
|
||||||
- yes | sdkmanager --verbose "platform-tools"
|
|
||||||
- yes | sdkmanager --verbose "tools"
|
|
||||||
- yes | sdkmanager --verbose "platforms;android-26"
|
|
||||||
- yes | sdkmanager --verbose "system-images;android-24;default;armeabi-v7a"
|
|
||||||
|
|
||||||
# Check tools and dependencies installed
|
|
||||||
- yes | sdkmanager --list
|
|
||||||
|
|
||||||
# After Travis updated image with Android base environment, building via ant is not possible anymore.
|
|
||||||
# Port library tests to new-style with JUnit 4 and gradle build.
|
|
||||||
- rm pom.xml
|
|
||||||
|
|
||||||
# On the other hand, Travis still uses 'android' command behind the 'components' section update.
|
|
||||||
# That command is obsolete and cannot update Android SDK Tools after 25.2.5.
|
|
||||||
# Let's solve it here with the new command 'sdkmanager'
|
|
||||||
- yes | sdkmanager --verbose tools
|
|
||||||
script:
|
|
||||||
- ./gradlew clean build
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
|
|
||||||
# via the "travis encrypt" command using the project repo's public key
|
|
||||||
- secure: epTZ0zZGDbHL3o6vSC9uNkZsi5j5SA6O/tvQBH7QW/dluuzIJxIjfhNbZHDyBReYDleirLzUFQpdWAUdvulCMLs/qZdIzFGlYXZSpxEnvPYMGQcilwADdJcxLw8L+3+ET5hSexxhjrTGw427IljkqGUpqQTxaLwFdFu98lDWSbc=
|
|
||||||
matrix:
|
|
||||||
- ANDROID_TARGET=android-26 ANDROID_ABI=armeabi-v7a
|
|
||||||
addons:
|
|
||||||
coverity_scan:
|
|
||||||
project:
|
|
||||||
name: owncloud/android-library
|
|
||||||
description: Build submitted via Travis CI
|
|
||||||
notification_email: lukas@owncloud.com
|
|
||||||
build_command_prepend: gradle clean
|
|
||||||
build_command: gradle build
|
|
||||||
branch_pattern: coverity_scan
|
|
@ -1,7 +1,7 @@
|
|||||||
buildscript {
|
buildscript {
|
||||||
ext {
|
ext {
|
||||||
// Libraries
|
// Libraries
|
||||||
kotlinVersion = '1.3.21'
|
kotlinVersion = '1.3.50'
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
@ -9,7 +9,7 @@ buildscript {
|
|||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:3.4.1'
|
classpath 'com.android.tools.build:gradle:3.5.0'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
|
||||||
classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlinVersion"
|
classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlinVersion"
|
||||||
}
|
}
|
||||||
|
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,6 +1,6 @@
|
|||||||
#Wed Aug 17 12:51:45 CEST 2016
|
#Sun Sep 08 09:13:16 CEST 2019
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.1-all.zip
|
||||||
|
@ -16,14 +16,14 @@ allOpen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 28
|
compileSdkVersion 29
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 19
|
minSdkVersion 19
|
||||||
targetSdkVersion 28
|
targetSdkVersion 28
|
||||||
|
|
||||||
versionCode = 10000200
|
versionCode = 10000300
|
||||||
versionName = "1.0.2"
|
versionName = "1.0.3"
|
||||||
}
|
}
|
||||||
|
|
||||||
lintOptions {
|
lintOptions {
|
||||||
|
@ -50,6 +50,7 @@ public class HttpConstants {
|
|||||||
public static final String CONTENT_TYPE_URLENCODED_UTF8 = "application/x-www-form-urlencoded; charset=utf-8";
|
public static final String CONTENT_TYPE_URLENCODED_UTF8 = "application/x-www-form-urlencoded; charset=utf-8";
|
||||||
public static final String ACCEPT_ENCODING_HEADER = "Accept-Encoding";
|
public static final String ACCEPT_ENCODING_HEADER = "Accept-Encoding";
|
||||||
public static final String ACCEPT_ENCODING_IDENTITY = "identity";
|
public static final String ACCEPT_ENCODING_IDENTITY = "identity";
|
||||||
|
public static final String OC_FILE_REMOTE_ID = "OC-FileId";
|
||||||
|
|
||||||
/***********************************************************************************************************
|
/***********************************************************************************************************
|
||||||
************************************************ STATUS CODES *********************************************
|
************************************************ STATUS CODES *********************************************
|
||||||
|
@ -47,7 +47,7 @@ import java.util.concurrent.TimeUnit;
|
|||||||
* @author David A. Velasco
|
* @author David A. Velasco
|
||||||
* @author Christian Schabesberger
|
* @author Christian Schabesberger
|
||||||
*/
|
*/
|
||||||
public class CopyRemoteFileOperation extends RemoteOperation {
|
public class CopyRemoteFileOperation extends RemoteOperation<String> {
|
||||||
|
|
||||||
private static final String TAG = CopyRemoteFileOperation.class.getSimpleName();
|
private static final String TAG = CopyRemoteFileOperation.class.getSimpleName();
|
||||||
|
|
||||||
@ -80,8 +80,7 @@ public class CopyRemoteFileOperation extends RemoteOperation {
|
|||||||
* @param client Client object to communicate with the remote ownCloud server.
|
* @param client Client object to communicate with the remote ownCloud server.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected RemoteOperationResult run(OwnCloudClient client) {
|
protected RemoteOperationResult<String> run(OwnCloudClient client) {
|
||||||
|
|
||||||
OwnCloudVersion version = client.getOwnCloudVersion();
|
OwnCloudVersion version = client.getOwnCloudVersion();
|
||||||
boolean versionWithForbiddenChars =
|
boolean versionWithForbiddenChars =
|
||||||
(version != null && version.isVersionWithForbiddenCharacters());
|
(version != null && version.isVersionWithForbiddenCharacters());
|
||||||
@ -101,9 +100,10 @@ public class CopyRemoteFileOperation extends RemoteOperation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// perform remote operation
|
/// perform remote operation
|
||||||
RemoteOperationResult result = null;
|
RemoteOperationResult<String> result;
|
||||||
try {
|
try {
|
||||||
CopyMethod copyMethod = new CopyMethod(new URL(client.getUserFilesWebDavUri() + WebdavUtils.encodePath(mSrcRemotePath)),
|
CopyMethod copyMethod =
|
||||||
|
new CopyMethod(new URL(client.getUserFilesWebDavUri() + WebdavUtils.encodePath(mSrcRemotePath)),
|
||||||
client.getUserFilesWebDavUri() + WebdavUtils.encodePath(mTargetRemotePath),
|
client.getUserFilesWebDavUri() + WebdavUtils.encodePath(mTargetRemotePath),
|
||||||
mOverwrite);
|
mOverwrite);
|
||||||
|
|
||||||
@ -113,16 +113,17 @@ public class CopyRemoteFileOperation extends RemoteOperation {
|
|||||||
final int status = client.executeHttpMethod(copyMethod);
|
final int status = client.executeHttpMethod(copyMethod);
|
||||||
|
|
||||||
if (status == HttpConstants.HTTP_CREATED || status == HttpConstants.HTTP_NO_CONTENT) {
|
if (status == HttpConstants.HTTP_CREATED || status == HttpConstants.HTTP_NO_CONTENT) {
|
||||||
|
String fileRemoteId = copyMethod.getResponseHeader(HttpConstants.OC_FILE_REMOTE_ID);
|
||||||
result = new RemoteOperationResult<>(ResultCode.OK);
|
result = new RemoteOperationResult<>(ResultCode.OK);
|
||||||
|
result.setData(fileRemoteId);
|
||||||
} else if (status == HttpConstants.HTTP_PRECONDITION_FAILED && !mOverwrite) {
|
} else if (status == HttpConstants.HTTP_PRECONDITION_FAILED && !mOverwrite) {
|
||||||
|
|
||||||
result = new RemoteOperationResult<>(ResultCode.INVALID_OVERWRITE);
|
result = new RemoteOperationResult<>(ResultCode.INVALID_OVERWRITE);
|
||||||
client.exhaustResponse(copyMethod.getResponseBodyAsStream());
|
client.exhaustResponse(copyMethod.getResponseBodyAsStream());
|
||||||
|
|
||||||
/// for other errors that could be explicitly handled, check first:
|
/// for other errors that could be explicitly handled, check first:
|
||||||
/// http://www.webdav.org/specs/rfc4918.html#rfc.section.9.9.4
|
/// http://www.webdav.org/specs/rfc4918.html#rfc.section.9.9.4
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
result = new RemoteOperationResult<>(copyMethod);
|
result = new RemoteOperationResult<>(copyMethod);
|
||||||
client.exhaustResponse(copyMethod.getResponseBodyAsStream());
|
client.exhaustResponse(copyMethod.getResponseBodyAsStream());
|
||||||
}
|
}
|
||||||
|
@ -104,19 +104,19 @@ class RemoteShare : Parcelable, Serializable {
|
|||||||
|
|
||||||
fun readFromParcel(source: Parcel) {
|
fun readFromParcel(source: Parcel) {
|
||||||
id = source.readLong()
|
id = source.readLong()
|
||||||
shareWith = source.readString()
|
shareWith = source.readString().toString()
|
||||||
path = source.readString()
|
path = source.readString().toString()
|
||||||
token = source.readString()
|
token = source.readString().toString()
|
||||||
sharedWithDisplayName = source.readString()
|
sharedWithDisplayName = source.readString().toString()
|
||||||
sharedWithAdditionalInfo = source.readString()
|
sharedWithAdditionalInfo = source.readString().toString()
|
||||||
name = source.readString()
|
name = source.readString().toString()
|
||||||
shareLink = source.readString()
|
shareLink = source.readString().toString()
|
||||||
fileSource = source.readLong()
|
fileSource = source.readLong()
|
||||||
itemSource = source.readLong()
|
itemSource = source.readLong()
|
||||||
|
shareType = ShareType.NO_SHARED
|
||||||
try {
|
try {
|
||||||
shareType = ShareType.valueOf(source.readString())
|
shareType = source.readString()?.let { ShareType.valueOf(it) }
|
||||||
} catch (x: IllegalArgumentException) {
|
} catch (x: IllegalArgumentException) {
|
||||||
shareType = ShareType.NO_SHARED
|
|
||||||
}
|
}
|
||||||
permissions = source.readInt()
|
permissions = source.readInt()
|
||||||
sharedDate = source.readLong()
|
sharedDate = source.readLong()
|
||||||
|
@ -47,7 +47,7 @@ class ShareToRemoteOperationResultParser(private var shareXmlParser: ShareXMLPar
|
|||||||
}
|
}
|
||||||
|
|
||||||
var result: RemoteOperationResult<ShareParserResult>
|
var result: RemoteOperationResult<ShareParserResult>
|
||||||
var resultData: List<RemoteShare>?
|
val resultData: List<RemoteShare>?
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Parse xml response and obtain the list of shares
|
// Parse xml response and obtain the list of shares
|
||||||
@ -81,7 +81,9 @@ class ShareToRemoteOperationResultParser(private var shareXmlParser: ShareXMLPar
|
|||||||
share
|
share
|
||||||
}
|
}
|
||||||
|
|
||||||
result.setData(ShareParserResult(ArrayList(resultData)))
|
if (resultData != null) {
|
||||||
|
result.setData(ShareParserResult(ArrayList(resultData.toMutableList())))
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
result = RemoteOperationResult(RemoteOperationResult.ResultCode.WRONG_SERVER_RESPONSE)
|
result = RemoteOperationResult(RemoteOperationResult.ResultCode.WRONG_SERVER_RESPONSE)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user