1
0
mirror of https://github.com/owncloud/android-library.git synced 2025-06-14 19:36:13 +00:00

Merge pull request #183 from owncloud/master

Release 0.9.19
This commit is contained in:
David González Verdugo 2018-02-02 12:13:54 +01:00 committed by GitHub
commit c517faeac2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 226 additions and 184 deletions

View File

@ -2,33 +2,40 @@ sudo: false
language: android
jdk:
- oraclejdk8
android:
components:
# first 'tools' updates SDK tools 'til last version ** in remote repository number 10 **
- tools
# second 'tools' updates SDK tools 'til last version ** in remote repository number 11 ** (current last one)
- tools
- platform-tools
- build-tools-25.0.2
- android-24
- sys-img-armeabi-v7a-android-24
branches:
only:
- master
before_install:
- echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI
-c 20M
- emulator -avd test -no-window &
install:
# Let's use the new command 'sdkmanager' to install Android SDK components
- yes | sdkmanager --verbose "build-tools;26.0.2"
- 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.
# Library tests are old-style tests, and trust on legacy Android ant environment.
# Need to disable tests until they are ported to JUnit 4 and gradle build.
#- echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI -c 20M
#- emulator -avd test -no-window &
- rm pom.xml
- android update project -p .
- chmod +x ./wait_for_emulator.sh
- ./wait_for_emulator.sh
#- android update project -p .
#- chmod +x ./wait_for_emulator.sh
#- ./wait_for_emulator.sh
#
# 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:
- ant clean
- ant debug
- cd test_client/tests
- ant acceptance-test
- cd ../..
#- ant clean
#- ant debug
#- cd test_client/tests
#- ant acceptance-test
#- cd ../..
- ./gradlew clean build
env:
global:
@ -36,7 +43,7 @@ env:
# via the "travis encrypt" command using the project repo's public key
- secure: epTZ0zZGDbHL3o6vSC9uNkZsi5j5SA6O/tvQBH7QW/dluuzIJxIjfhNbZHDyBReYDleirLzUFQpdWAUdvulCMLs/qZdIzFGlYXZSpxEnvPYMGQcilwADdJcxLw8L+3+ET5hSexxhjrTGw427IljkqGUpqQTxaLwFdFu98lDWSbc=
matrix:
- ANDROID_TARGET=android-24 ANDROID_ABI=armeabi-v7a
- ANDROID_TARGET=android-26 ANDROID_ABI=armeabi-v7a
addons:
coverity_scan:
project:

View File

@ -35,7 +35,7 @@
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="24" />
android:targetSdkVersion="26" />
</manifest>

View File

@ -18,8 +18,8 @@ dependencies {
}
android {
compileSdkVersion 24
buildToolsVersion '25.0.2'
compileSdkVersion 26
buildToolsVersion '26.0.2'
sourceSets {
main {

View File

@ -30,7 +30,7 @@
<uses-permission android:name="android.permission.INTERNET" />
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="24" />
android:targetSdkVersion="26" />
<application android:label="@string/app_name" android:icon="@drawable/ic_launcher">
<activity android:name="MainActivity"
android:label="@string/app_name"

View File

@ -9,8 +9,8 @@ dependencies {
}
android {
compileSdkVersion 24
buildToolsVersion "25.0.2"
compileSdkVersion 26
buildToolsVersion "26.0.2"
sourceSets {
main {

View File

@ -45,13 +45,14 @@ public class WebdavEntry {
public static final String EXTENDED_PROPERTY_NAME_PERMISSIONS = "permissions";
public static final String EXTENDED_PROPERTY_NAME_REMOTE_ID = "id";
public static final String EXTENDED_PROPERTY_NAME_SIZE = "size";
public static final String EXTENDED_PROPERTY_NAME_PRIVATE_LINK = "privatelink";
public static final String PROPERTY_QUOTA_USED_BYTES = "quota-used-bytes";
public static final String PROPERTY_QUOTA_AVAILABLE_BYTES = "quota-available-bytes";
private static final int CODE_PROP_NOT_FOUND = 404;
private String mName, mPath, mUri, mContentType, mEtag, mPermissions, mRemoteId;
private String mName, mPath, mUri, mContentType, mEtag, mPermissions, mRemoteId, mPrivateLink;
private long mContentLength, mCreateTimestamp, mModifiedTimestamp, mSize;
private BigDecimal mQuotaUsedBytes, mQuotaAvailableBytes;
@ -72,8 +73,7 @@ public class WebdavEntry {
if (prop != null) {
mName = (String) prop.getName().toString();
mName = mName.substring(1, mName.length() - 1);
}
else {
} else {
String[] tmp = mPath.split("/");
if (tmp.length > 0)
mName = tmp[tmp.length - 1];
@ -176,7 +176,6 @@ public class WebdavEntry {
mRemoteId = prop.getValue().toString();
}
// TODO: is it necessary?
// OC size property <oc:size>
prop = propSet.get(
EXTENDED_PROPERTY_NAME_SIZE, Namespace.getNamespace(NAMESPACE_OC)
@ -185,6 +184,14 @@ public class WebdavEntry {
mSize = Long.parseLong((String) prop.getValue());
}
// OC privatelink property <oc:privatelink>
prop = propSet.get(
EXTENDED_PROPERTY_NAME_PRIVATE_LINK, Namespace.getNamespace(NAMESPACE_OC)
);
if (prop != null) {
mPrivateLink = prop.getValue().toString();
}
} else {
Log_OC.e("WebdavEntry",
"General fuckup, no status for webdav response");
@ -251,11 +258,17 @@ public class WebdavEntry {
return mQuotaAvailableBytes;
}
public String privateLink() {
return mPrivateLink;
}
private void resetData() {
mName = mUri = mContentType = mPermissions = null; mRemoteId = null;
mName = mUri = mContentType = mPermissions = null;
mRemoteId = null;
mContentLength = mCreateTimestamp = mModifiedTimestamp = 0;
mSize = 0;
mQuotaUsedBytes = null;
mQuotaAvailableBytes = null;
mPrivateLink = null;
}
}

View File

@ -107,6 +107,8 @@ public class WebdavUtils {
Namespace.getNamespace(WebdavEntry.NAMESPACE_OC));
propSet.add(WebdavEntry.EXTENDED_PROPERTY_NAME_SIZE,
Namespace.getNamespace(WebdavEntry.NAMESPACE_OC));
propSet.add(WebdavEntry.EXTENDED_PROPERTY_NAME_PRIVATE_LINK,
Namespace.getNamespace(WebdavEntry.NAMESPACE_OC));
return propSet;
}
@ -130,6 +132,10 @@ public class WebdavUtils {
Namespace.getNamespace(WebdavEntry.NAMESPACE_OC));
propSet.add(WebdavEntry.EXTENDED_PROPERTY_NAME_SIZE,
Namespace.getNamespace(WebdavEntry.NAMESPACE_OC));
propSet.add(WebdavEntry.EXTENDED_PROPERTY_NAME_SIZE,
Namespace.getNamespace(WebdavEntry.NAMESPACE_OC));
propSet.add(WebdavEntry.EXTENDED_PROPERTY_NAME_PRIVATE_LINK,
Namespace.getNamespace(WebdavEntry.NAMESPACE_OC));
return propSet;
}

View File

@ -171,6 +171,7 @@ public class ReadRemoteFolderOperation extends RemoteOperation {
file.setSize(we.size());
file.setQuotaUsedBytes(we.quotaUsedBytes());
file.setQuotaAvailableBytes(we.quotaAvailableBytes());
file.setPrivateLink(we.privateLink());
return file;
}
}

View File

@ -40,8 +40,10 @@ import com.owncloud.android.lib.common.network.WebdavEntry;
public class RemoteFile implements Parcelable, Serializable {
/** Generated - should be refreshed every time the class changes!! */
private static final long serialVersionUID = 3130865437811248451L;
/**
* Generated - should be refreshed every time the class changes!!
*/
private static final long serialVersionUID = -8965995357413958539L;
private String mRemotePath;
private String mMimeType;
@ -54,6 +56,7 @@ public class RemoteFile implements Parcelable, Serializable {
private long mSize;
private BigDecimal mQuotaUsedBytes;
private BigDecimal mQuotaAvailableBytes;
private String mPrivateLink;
/**
* Getters and Setters
@ -139,13 +142,21 @@ public class RemoteFile implements Parcelable, Serializable {
mQuotaAvailableBytes = quotaAvailableBytes;
}
public String getPrivateLink() {
return mPrivateLink;
}
public void setPrivateLink(String privateLink) {
mPrivateLink = privateLink;
}
public RemoteFile() {
resetData();
}
/**
* Create new {@link RemoteFile} with given path.
*
* <p>
* The path received must be URL-decoded. Path separator must be OCFile.PATH_SEPARATOR, and it must be the first character in 'path'.
*
* @param path The remote path of the file.
@ -158,18 +169,19 @@ public class RemoteFile implements Parcelable, Serializable {
mRemotePath = path;
}
public RemoteFile(WebdavEntry we) {
this(we.decodedPath());
this.setCreationTimestamp(we.createTimestamp());
this.setLength(we.contentLength());
this.setMimeType(we.contentType());
this.setModifiedTimestamp(we.modifiedTimestamp());
this.setEtag(we.etag());
this.setPermissions(we.permissions());
this.setRemoteId(we.remoteId());
this.setSize(we.size());
this.setQuotaUsedBytes(we.quotaUsedBytes());
this.setQuotaAvailableBytes(we.quotaAvailableBytes());
public RemoteFile(WebdavEntry webdavEntry) {
this(webdavEntry.decodedPath());
this.setCreationTimestamp(webdavEntry.createTimestamp());
this.setLength(webdavEntry.contentLength());
this.setMimeType(webdavEntry.contentType());
this.setModifiedTimestamp(webdavEntry.modifiedTimestamp());
this.setEtag(webdavEntry.etag());
this.setPermissions(webdavEntry.permissions());
this.setRemoteId(webdavEntry.remoteId());
this.setSize(webdavEntry.size());
this.setQuotaUsedBytes(webdavEntry.quotaUsedBytes());
this.setQuotaAvailableBytes(webdavEntry.quotaAvailableBytes());
this.setPrivateLink(webdavEntry.privateLink());
}
/**
@ -187,6 +199,7 @@ public class RemoteFile implements Parcelable, Serializable {
mSize = 0;
mQuotaUsedBytes = null;
mQuotaAvailableBytes = null;
mPrivateLink = null;
}
/**
@ -226,6 +239,7 @@ public class RemoteFile implements Parcelable, Serializable {
mSize = source.readLong();
mQuotaUsedBytes = (BigDecimal) source.readSerializable();
mQuotaAvailableBytes = (BigDecimal) source.readSerializable();
mPrivateLink = source.readString();
}
@Override
@ -246,6 +260,7 @@ public class RemoteFile implements Parcelable, Serializable {
dest.writeLong(mSize);
dest.writeSerializable(mQuotaUsedBytes);
dest.writeSerializable(mQuotaAvailableBytes);
dest.writeString(mPrivateLink);
}
}

View File

@ -39,7 +39,7 @@
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="24" />
android:targetSdkVersion="26" />
<application
android:allowBackup="true"

View File

@ -11,8 +11,8 @@ dependencies {
}
android {
compileSdkVersion 24
buildToolsVersion "25.0.2"
compileSdkVersion 26
buildToolsVersion "26.0.2"
sourceSets {
main {

View File

@ -6,8 +6,8 @@ dependencies {
}
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
compileSdkVersion 26
buildToolsVersion "26.0.2"
sourceSets {
main {