mirror of
https://github.com/owncloud/android-library.git
synced 2025-07-27 03:37:06 +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">
|
||||
<option name="LINE_SEPARATOR" value=" " />
|
||||
<option name="RIGHT_MARGIN" value="150" />
|
||||
<AndroidXmlCodeStyleSettings>
|
||||
<option name="USE_CUSTOM_SETTINGS" value="true" />
|
||||
</AndroidXmlCodeStyleSettings>
|
||||
<JavaCodeStyleSettings>
|
||||
<option name="FIELD_NAME_PREFIX" value="m" />
|
||||
<option name="STATIC_FIELD_NAME_PREFIX" value="s" />
|
||||
<option name="CLASS_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">
|
||||
<value>
|
||||
<package name="android" withSubpackages="true" static="false" />
|
||||
@ -40,36 +34,9 @@
|
||||
<MarkdownNavigatorCodeStyleSettings>
|
||||
<option name="RIGHT_MARGIN" value="72" />
|
||||
</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>
|
||||
<option name="XML_ATTRIBUTE_WRAP" value="0" />
|
||||
<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" />
|
||||
</XML>
|
||||
<codeStyleSettings language="JAVA">
|
||||
@ -244,7 +211,6 @@
|
||||
</arrangement>
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="XML">
|
||||
<option name="FORCE_REARRANGE_MODE" value="1" />
|
||||
<indentOptions>
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
||||
</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 {
|
||||
ext {
|
||||
// Libraries
|
||||
kotlinVersion = '1.3.21'
|
||||
kotlinVersion = '1.3.50'
|
||||
}
|
||||
|
||||
repositories {
|
||||
@ -9,7 +9,7 @@ buildscript {
|
||||
jcenter()
|
||||
}
|
||||
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-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
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
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 {
|
||||
compileSdkVersion 28
|
||||
compileSdkVersion 29
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 19
|
||||
targetSdkVersion 28
|
||||
|
||||
versionCode = 10000200
|
||||
versionName = "1.0.2"
|
||||
versionCode = 10000300
|
||||
versionName = "1.0.3"
|
||||
}
|
||||
|
||||
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 ACCEPT_ENCODING_HEADER = "Accept-Encoding";
|
||||
public static final String ACCEPT_ENCODING_IDENTITY = "identity";
|
||||
public static final String OC_FILE_REMOTE_ID = "OC-FileId";
|
||||
|
||||
/***********************************************************************************************************
|
||||
************************************************ STATUS CODES *********************************************
|
||||
|
@ -47,7 +47,7 @@ import java.util.concurrent.TimeUnit;
|
||||
* @author David A. Velasco
|
||||
* @author Christian Schabesberger
|
||||
*/
|
||||
public class CopyRemoteFileOperation extends RemoteOperation {
|
||||
public class CopyRemoteFileOperation extends RemoteOperation<String> {
|
||||
|
||||
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.
|
||||
*/
|
||||
@Override
|
||||
protected RemoteOperationResult run(OwnCloudClient client) {
|
||||
|
||||
protected RemoteOperationResult<String> run(OwnCloudClient client) {
|
||||
OwnCloudVersion version = client.getOwnCloudVersion();
|
||||
boolean versionWithForbiddenChars =
|
||||
(version != null && version.isVersionWithForbiddenCharacters());
|
||||
@ -101,9 +100,10 @@ public class CopyRemoteFileOperation extends RemoteOperation {
|
||||
}
|
||||
|
||||
/// perform remote operation
|
||||
RemoteOperationResult result = null;
|
||||
RemoteOperationResult<String> result;
|
||||
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),
|
||||
mOverwrite);
|
||||
|
||||
@ -113,16 +113,17 @@ public class CopyRemoteFileOperation extends RemoteOperation {
|
||||
final int status = client.executeHttpMethod(copyMethod);
|
||||
|
||||
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.setData(fileRemoteId);
|
||||
} else if (status == HttpConstants.HTTP_PRECONDITION_FAILED && !mOverwrite) {
|
||||
|
||||
result = new RemoteOperationResult<>(ResultCode.INVALID_OVERWRITE);
|
||||
client.exhaustResponse(copyMethod.getResponseBodyAsStream());
|
||||
|
||||
/// for other errors that could be explicitly handled, check first:
|
||||
/// http://www.webdav.org/specs/rfc4918.html#rfc.section.9.9.4
|
||||
|
||||
} else {
|
||||
|
||||
result = new RemoteOperationResult<>(copyMethod);
|
||||
client.exhaustResponse(copyMethod.getResponseBodyAsStream());
|
||||
}
|
||||
|
@ -104,19 +104,19 @@ class RemoteShare : Parcelable, Serializable {
|
||||
|
||||
fun readFromParcel(source: Parcel) {
|
||||
id = source.readLong()
|
||||
shareWith = source.readString()
|
||||
path = source.readString()
|
||||
token = source.readString()
|
||||
sharedWithDisplayName = source.readString()
|
||||
sharedWithAdditionalInfo = source.readString()
|
||||
name = source.readString()
|
||||
shareLink = source.readString()
|
||||
shareWith = source.readString().toString()
|
||||
path = source.readString().toString()
|
||||
token = source.readString().toString()
|
||||
sharedWithDisplayName = source.readString().toString()
|
||||
sharedWithAdditionalInfo = source.readString().toString()
|
||||
name = source.readString().toString()
|
||||
shareLink = source.readString().toString()
|
||||
fileSource = source.readLong()
|
||||
itemSource = source.readLong()
|
||||
shareType = ShareType.NO_SHARED
|
||||
try {
|
||||
shareType = ShareType.valueOf(source.readString())
|
||||
shareType = source.readString()?.let { ShareType.valueOf(it) }
|
||||
} catch (x: IllegalArgumentException) {
|
||||
shareType = ShareType.NO_SHARED
|
||||
}
|
||||
permissions = source.readInt()
|
||||
sharedDate = source.readLong()
|
||||
|
@ -47,7 +47,7 @@ class ShareToRemoteOperationResultParser(private var shareXmlParser: ShareXMLPar
|
||||
}
|
||||
|
||||
var result: RemoteOperationResult<ShareParserResult>
|
||||
var resultData: List<RemoteShare>?
|
||||
val resultData: List<RemoteShare>?
|
||||
|
||||
try {
|
||||
// Parse xml response and obtain the list of shares
|
||||
@ -81,7 +81,9 @@ class ShareToRemoteOperationResultParser(private var shareXmlParser: ShareXMLPar
|
||||
share
|
||||
}
|
||||
|
||||
result.setData(ShareParserResult(ArrayList(resultData)))
|
||||
if (resultData != null) {
|
||||
result.setData(ShareParserResult(ArrayList(resultData.toMutableList())))
|
||||
}
|
||||
|
||||
} else {
|
||||
result = RemoteOperationResult(RemoteOperationResult.ResultCode.WRONG_SERVER_RESPONSE)
|
||||
|
Loading…
x
Reference in New Issue
Block a user