mirror of
				https://github.com/owncloud/android-library.git
				synced 2025-10-31 10:27:45 +00:00 
			
		
		
		
	Merge pull request #109 from owncloud/target_marshmallow
Updated build target to Android APIv23
This commit is contained in:
		
						commit
						1007a80534
					
				| @ -2,8 +2,11 @@ sudo: false | |||||||
| language: android | language: android | ||||||
| android: | android: | ||||||
|   components: |   components: | ||||||
|   - build-tools-22.0.1 |   - platform-tools | ||||||
|   - android-19 |   - tools | ||||||
|  |   - build-tools-23.0.2 | ||||||
|  |   - android-23 | ||||||
|  |   - sys-img-armeabi-v7a-android-23 | ||||||
| branches: | branches: | ||||||
|   only: |   only: | ||||||
|   - master |   - master | ||||||
| @ -33,7 +36,7 @@ env: | |||||||
|   - secure: AnxLVarfwM7IhJ7Sca35USyRlFHFvlcBhWTt2TVDcyQ+ldDyb+U6IWXFK0Yy82QP0ZH/RCLu7FnmHK/rKG0BHNRt1Ymco1VkTQql0MZcHXP+4IKgEvgJyUn1TqYj+hSVmM6lgTA+QUjZYGSfwU8mhUFiU7644ZTdTe6ALdqa+v8= |   - secure: AnxLVarfwM7IhJ7Sca35USyRlFHFvlcBhWTt2TVDcyQ+ldDyb+U6IWXFK0Yy82QP0ZH/RCLu7FnmHK/rKG0BHNRt1Ymco1VkTQql0MZcHXP+4IKgEvgJyUn1TqYj+hSVmM6lgTA+QUjZYGSfwU8mhUFiU7644ZTdTe6ALdqa+v8= | ||||||
|   - secure: ezKyZbb3q1Phcv/vJntuJe0C2req+Hp4/C+tFZIWZ3o8wRO9jVI3bnED9TWQyQOOT0SoRYjJ5zqp0UcEOGCzPeWFO6bA7RWp+zA/R9sziLNcVWMVv3WXnuClQjPBHJeXRnP7YmNjxDmSfV97a14dk5d9LgJZYliTDepH4dLsxro= |   - secure: ezKyZbb3q1Phcv/vJntuJe0C2req+Hp4/C+tFZIWZ3o8wRO9jVI3bnED9TWQyQOOT0SoRYjJ5zqp0UcEOGCzPeWFO6bA7RWp+zA/R9sziLNcVWMVv3WXnuClQjPBHJeXRnP7YmNjxDmSfV97a14dk5d9LgJZYliTDepH4dLsxro= | ||||||
|   matrix: |   matrix: | ||||||
|   - ANDROID_TARGET=android-19 ANDROID_ABI=armeabi-v7a |   - ANDROID_TARGET=android-23 ANDROID_ABI=armeabi-v7a | ||||||
| addons: | addons: | ||||||
|   coverity_scan: |   coverity_scan: | ||||||
|     project: |     project: | ||||||
|  | |||||||
| @ -30,7 +30,7 @@ | |||||||
| 
 | 
 | ||||||
|     <uses-sdk |     <uses-sdk | ||||||
|         android:minSdkVersion="8" |         android:minSdkVersion="8" | ||||||
|         android:targetSdkVersion="19" /> |         android:targetSdkVersion="23" /> | ||||||
| 
 | 
 | ||||||
| </manifest> | </manifest> | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -3,7 +3,7 @@ buildscript { | |||||||
|         mavenCentral() |         mavenCentral() | ||||||
|     } |     } | ||||||
|     dependencies { |     dependencies { | ||||||
|         classpath 'com.android.tools.build:gradle:1.2.3' |         classpath 'com.android.tools.build:gradle:1.5.0' | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| @ -18,8 +18,8 @@ dependencies { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| android { | android { | ||||||
|     compileSdkVersion 19 |     compileSdkVersion 23 | ||||||
|     buildToolsVersion "22.0.1" |     buildToolsVersion "23.0.2" | ||||||
| 
 | 
 | ||||||
|     sourceSets { |     sourceSets { | ||||||
|         main { |         main { | ||||||
|  | |||||||
| @ -11,5 +11,5 @@ | |||||||
| #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt | ||||||
| 
 | 
 | ||||||
| # Project target. | # Project target. | ||||||
| target=android-19 | target=android-23 | ||||||
| android.library=true | android.library=true | ||||||
|  | |||||||
| @ -30,7 +30,7 @@ | |||||||
|     <uses-permission android:name="android.permission.INTERNET" /> |     <uses-permission android:name="android.permission.INTERNET" /> | ||||||
|     <uses-sdk |     <uses-sdk | ||||||
|         android:minSdkVersion="8" |         android:minSdkVersion="8" | ||||||
|         android:targetSdkVersion="19" /> |         android:targetSdkVersion="23" /> | ||||||
|     <application android:label="@string/app_name" android:icon="@drawable/ic_launcher"> |     <application android:label="@string/app_name" android:icon="@drawable/ic_launcher"> | ||||||
|         <activity 	android:name="MainActivity" |         <activity 	android:name="MainActivity" | ||||||
|                   	android:label="@string/app_name" |                   	android:label="@string/app_name" | ||||||
|  | |||||||
| @ -9,8 +9,8 @@ dependencies { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| android { | android { | ||||||
|     compileSdkVersion 19 |     compileSdkVersion 23 | ||||||
|     buildToolsVersion "22.0.1" |     buildToolsVersion "23.0.2" | ||||||
| 
 | 
 | ||||||
|     sourceSets { |     sourceSets { | ||||||
|         main { |         main { | ||||||
|  | |||||||
| @ -3,4 +3,4 @@ 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=http\://services.gradle.org/distributions/gradle-1.12-all.zip | distributionUrl=http\://services.gradle.org/distributions/gradle-2.2.1-all.zip | ||||||
|  | |||||||
| @ -11,5 +11,5 @@ | |||||||
| #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt | ||||||
| 
 | 
 | ||||||
| # Project target. | # Project target. | ||||||
| target=android-19 | target=android-23 | ||||||
| android.library.reference.1=.. | android.library.reference.1=.. | ||||||
|  | |||||||
| @ -36,14 +36,13 @@ import org.apache.commons.httpclient.HttpConnectionManager; | |||||||
| import org.apache.commons.httpclient.HttpException; | import org.apache.commons.httpclient.HttpException; | ||||||
| import org.apache.commons.httpclient.HttpMethod; | import org.apache.commons.httpclient.HttpMethod; | ||||||
| import org.apache.commons.httpclient.HttpMethodBase; | import org.apache.commons.httpclient.HttpMethodBase; | ||||||
|  | import org.apache.commons.httpclient.HttpStatus; | ||||||
| import org.apache.commons.httpclient.HttpVersion; | import org.apache.commons.httpclient.HttpVersion; | ||||||
| import org.apache.commons.httpclient.URI; | import org.apache.commons.httpclient.URI; | ||||||
| import org.apache.commons.httpclient.cookie.CookiePolicy; | import org.apache.commons.httpclient.cookie.CookiePolicy; | ||||||
| import org.apache.commons.httpclient.methods.HeadMethod; | import org.apache.commons.httpclient.methods.HeadMethod; | ||||||
| import org.apache.commons.httpclient.params.HttpMethodParams; | import org.apache.commons.httpclient.params.HttpMethodParams; | ||||||
| import org.apache.commons.httpclient.params.HttpParams; | import org.apache.commons.httpclient.params.HttpParams; | ||||||
| import org.apache.http.HttpStatus; |  | ||||||
| import org.apache.http.params.CoreProtocolPNames; |  | ||||||
| 
 | 
 | ||||||
| import android.net.Uri; | import android.net.Uri; | ||||||
| 
 | 
 | ||||||
| @ -60,6 +59,7 @@ public class OwnCloudClient extends HttpClient { | |||||||
|     public static final int MAX_REDIRECTIONS_COUNT = 3; |     public static final int MAX_REDIRECTIONS_COUNT = 3; | ||||||
|     private static final String PARAM_SINGLE_COOKIE_HEADER = "http.protocol.single-cookie-header"; |     private static final String PARAM_SINGLE_COOKIE_HEADER = "http.protocol.single-cookie-header"; | ||||||
|     private static final boolean PARAM_SINGLE_COOKIE_HEADER_VALUE = true; |     private static final boolean PARAM_SINGLE_COOKIE_HEADER_VALUE = true; | ||||||
|  |     private static final String PARAM_PROTOCOL_VERSION = "http.protocol.version"; | ||||||
|      |      | ||||||
|     private static byte[] sExhaustBuffer = new byte[1024]; |     private static byte[] sExhaustBuffer = new byte[1024]; | ||||||
|      |      | ||||||
| @ -89,7 +89,7 @@ public class OwnCloudClient extends HttpClient { | |||||||
|         String userAgent = OwnCloudClientManagerFactory.getUserAgent(); |         String userAgent = OwnCloudClientManagerFactory.getUserAgent(); | ||||||
|         getParams().setParameter(HttpMethodParams.USER_AGENT, userAgent); |         getParams().setParameter(HttpMethodParams.USER_AGENT, userAgent); | ||||||
|         getParams().setParameter( |         getParams().setParameter( | ||||||
|         		CoreProtocolPNames.PROTOCOL_VERSION,  |         		PARAM_PROTOCOL_VERSION, | ||||||
|         		HttpVersion.HTTP_1_1); |         		HttpVersion.HTTP_1_1); | ||||||
|          |          | ||||||
|         getParams().setCookiePolicy( |         getParams().setCookiePolicy( | ||||||
|  | |||||||
| @ -27,7 +27,7 @@ | |||||||
| 
 | 
 | ||||||
| package com.owncloud.android.lib.common.network; | package com.owncloud.android.lib.common.network; | ||||||
| 
 | 
 | ||||||
| import org.apache.http.HttpStatus; | import org.apache.commons.httpclient.HttpStatus; | ||||||
| 
 | 
 | ||||||
| import java.util.Arrays; | import java.util.Arrays; | ||||||
| 
 | 
 | ||||||
| @ -53,7 +53,6 @@ public class RedirectionPath { | |||||||
|     private String[] mLocations = null; |     private String[] mLocations = null; | ||||||
| 
 | 
 | ||||||
|     private int mLastLocation = -1; |     private int mLastLocation = -1; | ||||||
|     private int maxRedirections; |  | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|      * Public constructor. |      * Public constructor. | ||||||
|  | |||||||
| @ -36,8 +36,8 @@ import java.util.concurrent.atomic.AtomicBoolean; | |||||||
| 
 | 
 | ||||||
| import org.apache.commons.httpclient.Header; | import org.apache.commons.httpclient.Header; | ||||||
| import org.apache.commons.httpclient.HttpException; | import org.apache.commons.httpclient.HttpException; | ||||||
|  | import org.apache.commons.httpclient.HttpStatus; | ||||||
| import org.apache.commons.httpclient.methods.GetMethod; | import org.apache.commons.httpclient.methods.GetMethod; | ||||||
| import org.apache.http.HttpStatus; |  | ||||||
| 
 | 
 | ||||||
| import com.owncloud.android.lib.common.OwnCloudClient; | import com.owncloud.android.lib.common.OwnCloudClient; | ||||||
| import com.owncloud.android.lib.common.network.OnDatatransferProgressListener; | import com.owncloud.android.lib.common.network.OnDatatransferProgressListener; | ||||||
|  | |||||||
| @ -25,7 +25,7 @@ package com.owncloud.android.lib.resources.files; | |||||||
| 
 | 
 | ||||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||||
| 
 | 
 | ||||||
| import org.apache.http.HttpStatus; | import org.apache.commons.httpclient.HttpStatus; | ||||||
| import org.apache.jackrabbit.webdav.DavConstants; | import org.apache.jackrabbit.webdav.DavConstants; | ||||||
| import org.apache.jackrabbit.webdav.MultiStatus; | import org.apache.jackrabbit.webdav.MultiStatus; | ||||||
| import org.apache.jackrabbit.webdav.client.methods.PropFindMethod; | import org.apache.jackrabbit.webdav.client.methods.PropFindMethod; | ||||||
|  | |||||||
| @ -26,7 +26,7 @@ package com.owncloud.android.lib.resources.files; | |||||||
| 
 | 
 | ||||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||||
| 
 | 
 | ||||||
| import org.apache.http.HttpStatus; | import org.apache.commons.httpclient.HttpStatus; | ||||||
| import org.apache.jackrabbit.webdav.DavConstants; | import org.apache.jackrabbit.webdav.DavConstants; | ||||||
| import org.apache.jackrabbit.webdav.MultiStatus; | import org.apache.jackrabbit.webdav.MultiStatus; | ||||||
| import org.apache.jackrabbit.webdav.client.methods.PropFindMethod; | import org.apache.jackrabbit.webdav.client.methods.PropFindMethod; | ||||||
|  | |||||||
| @ -32,9 +32,9 @@ import java.util.HashSet; | |||||||
| import java.util.Set; | import java.util.Set; | ||||||
| import java.util.concurrent.atomic.AtomicBoolean; | import java.util.concurrent.atomic.AtomicBoolean; | ||||||
| 
 | 
 | ||||||
|  | import org.apache.commons.httpclient.HttpStatus; | ||||||
| import org.apache.commons.httpclient.methods.PutMethod; | import org.apache.commons.httpclient.methods.PutMethod; | ||||||
| import org.apache.commons.httpclient.methods.RequestEntity; | import org.apache.commons.httpclient.methods.RequestEntity; | ||||||
| import org.apache.http.HttpStatus; |  | ||||||
| 
 | 
 | ||||||
| import com.owncloud.android.lib.common.OwnCloudClient; | import com.owncloud.android.lib.common.OwnCloudClient; | ||||||
| import com.owncloud.android.lib.common.network.FileRequestEntity; | import com.owncloud.android.lib.common.network.FileRequestEntity; | ||||||
|  | |||||||
| @ -26,8 +26,8 @@ | |||||||
| 
 | 
 | ||||||
| package com.owncloud.android.lib.resources.shares; | package com.owncloud.android.lib.resources.shares; | ||||||
| 
 | 
 | ||||||
|  | import org.apache.commons.httpclient.HttpStatus; | ||||||
| import org.apache.commons.httpclient.methods.PostMethod; | import org.apache.commons.httpclient.methods.PostMethod; | ||||||
| import org.apache.http.HttpStatus; |  | ||||||
| 
 | 
 | ||||||
| import com.owncloud.android.lib.common.OwnCloudClient; | import com.owncloud.android.lib.common.OwnCloudClient; | ||||||
| import com.owncloud.android.lib.common.operations.RemoteOperation; | import com.owncloud.android.lib.common.operations.RemoteOperation; | ||||||
|  | |||||||
| @ -30,8 +30,8 @@ import com.owncloud.android.lib.common.operations.RemoteOperation; | |||||||
| import com.owncloud.android.lib.common.operations.RemoteOperationResult; | import com.owncloud.android.lib.common.operations.RemoteOperationResult; | ||||||
| import com.owncloud.android.lib.common.utils.Log_OC; | import com.owncloud.android.lib.common.utils.Log_OC; | ||||||
| 
 | 
 | ||||||
|  | import org.apache.commons.httpclient.HttpStatus; | ||||||
| import org.apache.commons.httpclient.methods.GetMethod; | import org.apache.commons.httpclient.methods.GetMethod; | ||||||
| import org.apache.http.HttpStatus; |  | ||||||
| 
 | 
 | ||||||
| /**  | /**  | ||||||
|  * Get the data about a Share resource, known its remote ID. |  * Get the data about a Share resource, known its remote ID. | ||||||
|  | |||||||
| @ -34,8 +34,8 @@ import com.owncloud.android.lib.common.operations.RemoteOperation; | |||||||
| import com.owncloud.android.lib.common.operations.RemoteOperationResult; | import com.owncloud.android.lib.common.operations.RemoteOperationResult; | ||||||
| import com.owncloud.android.lib.common.utils.Log_OC; | import com.owncloud.android.lib.common.utils.Log_OC; | ||||||
| 
 | 
 | ||||||
|  | import org.apache.commons.httpclient.HttpStatus; | ||||||
| import org.apache.commons.httpclient.methods.GetMethod; | import org.apache.commons.httpclient.methods.GetMethod; | ||||||
| import org.apache.http.HttpStatus; |  | ||||||
| import org.json.JSONArray; | import org.json.JSONArray; | ||||||
| import org.json.JSONObject; | import org.json.JSONObject; | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -26,9 +26,9 @@ | |||||||
| 
 | 
 | ||||||
| package com.owncloud.android.lib.resources.shares; | package com.owncloud.android.lib.resources.shares; | ||||||
| 
 | 
 | ||||||
|  | import org.apache.commons.httpclient.HttpStatus; | ||||||
| import org.apache.commons.httpclient.NameValuePair; | import org.apache.commons.httpclient.NameValuePair; | ||||||
| import org.apache.commons.httpclient.methods.GetMethod; | import org.apache.commons.httpclient.methods.GetMethod; | ||||||
| import org.apache.http.HttpStatus; |  | ||||||
| 
 | 
 | ||||||
| import com.owncloud.android.lib.common.OwnCloudClient; | import com.owncloud.android.lib.common.OwnCloudClient; | ||||||
| import com.owncloud.android.lib.common.operations.RemoteOperation; | import com.owncloud.android.lib.common.operations.RemoteOperation; | ||||||
|  | |||||||
| @ -26,8 +26,8 @@ | |||||||
| 
 | 
 | ||||||
| package com.owncloud.android.lib.resources.shares; | package com.owncloud.android.lib.resources.shares; | ||||||
| 
 | 
 | ||||||
|  | import org.apache.commons.httpclient.HttpStatus; | ||||||
| import org.apache.commons.httpclient.methods.GetMethod; | import org.apache.commons.httpclient.methods.GetMethod; | ||||||
| import org.apache.http.HttpStatus; |  | ||||||
| 
 | 
 | ||||||
| import com.owncloud.android.lib.common.OwnCloudClient; | import com.owncloud.android.lib.common.OwnCloudClient; | ||||||
| import com.owncloud.android.lib.common.operations.RemoteOperation; | import com.owncloud.android.lib.common.operations.RemoteOperation; | ||||||
|  | |||||||
| @ -33,9 +33,9 @@ package com.owncloud.android.lib.resources.shares; | |||||||
|         import com.owncloud.android.lib.common.operations.RemoteOperationResult; |         import com.owncloud.android.lib.common.operations.RemoteOperationResult; | ||||||
|         import com.owncloud.android.lib.common.utils.Log_OC; |         import com.owncloud.android.lib.common.utils.Log_OC; | ||||||
| 
 | 
 | ||||||
|  |         import org.apache.commons.httpclient.HttpStatus; | ||||||
|         import org.apache.commons.httpclient.methods.PutMethod; |         import org.apache.commons.httpclient.methods.PutMethod; | ||||||
|         import org.apache.commons.httpclient.methods.StringRequestEntity; |         import org.apache.commons.httpclient.methods.StringRequestEntity; | ||||||
|         import org.apache.http.HttpStatus; |  | ||||||
| 
 | 
 | ||||||
|         import java.text.DateFormat; |         import java.text.DateFormat; | ||||||
|         import java.text.SimpleDateFormat; |         import java.text.SimpleDateFormat; | ||||||
|  | |||||||
| @ -32,8 +32,8 @@ import com.owncloud.android.lib.common.operations.RemoteOperation; | |||||||
| import com.owncloud.android.lib.common.operations.RemoteOperationResult; | import com.owncloud.android.lib.common.operations.RemoteOperationResult; | ||||||
| import com.owncloud.android.lib.common.utils.Log_OC; | import com.owncloud.android.lib.common.utils.Log_OC; | ||||||
| 
 | 
 | ||||||
|  | import org.apache.commons.httpclient.HttpStatus; | ||||||
| import org.apache.commons.httpclient.methods.GetMethod; | import org.apache.commons.httpclient.methods.GetMethod; | ||||||
| import org.apache.http.HttpStatus; |  | ||||||
| import org.json.JSONObject; | import org.json.JSONObject; | ||||||
| 
 | 
 | ||||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||||
|  | |||||||
| @ -26,8 +26,8 @@ package com.owncloud.android.lib.resources.users; | |||||||
| 
 | 
 | ||||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||||
| 
 | 
 | ||||||
|  | import org.apache.commons.httpclient.HttpStatus; | ||||||
| import org.apache.commons.httpclient.methods.GetMethod; | import org.apache.commons.httpclient.methods.GetMethod; | ||||||
| import org.apache.http.HttpStatus; |  | ||||||
| import org.json.JSONObject; | import org.json.JSONObject; | ||||||
| 
 | 
 | ||||||
| import com.owncloud.android.lib.common.OwnCloudClient; | import com.owncloud.android.lib.common.OwnCloudClient; | ||||||
|  | |||||||
| @ -39,7 +39,7 @@ | |||||||
| 
 | 
 | ||||||
| 	<uses-sdk | 	<uses-sdk | ||||||
|         android:minSdkVersion="8" |         android:minSdkVersion="8" | ||||||
|         android:targetSdkVersion="19" /> |         android:targetSdkVersion="23" /> | ||||||
| 
 | 
 | ||||||
|     <application |     <application | ||||||
|         android:allowBackup="true" |         android:allowBackup="true" | ||||||
|  | |||||||
| @ -11,8 +11,8 @@ dependencies { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| android { | android { | ||||||
|     compileSdkVersion 19 |     compileSdkVersion 23 | ||||||
|     buildToolsVersion "22.0.1" |     buildToolsVersion "23.0.2" | ||||||
| 
 | 
 | ||||||
|     sourceSets { |     sourceSets { | ||||||
|         main { |         main { | ||||||
|  | |||||||
| @ -3,4 +3,4 @@ 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=http\://services.gradle.org/distributions/gradle-1.12-all.zip | distributionUrl=http\://services.gradle.org/distributions/gradle-2.2.1-all.zip | ||||||
|  | |||||||
| @ -11,5 +11,5 @@ | |||||||
| #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt | ||||||
| 
 | 
 | ||||||
| # Project target. | # Project target. | ||||||
| target=android-19 | target=android-23 | ||||||
| android.library.reference.1=.. | android.library.reference.1=.. | ||||||
|  | |||||||
| @ -37,7 +37,6 @@ import android.app.Activity; | |||||||
| import android.content.Context; | import android.content.Context; | ||||||
| import android.net.Uri; | import android.net.Uri; | ||||||
| import android.os.Bundle; | import android.os.Bundle; | ||||||
| import android.os.Environment; |  | ||||||
| import android.util.Log; | import android.util.Log; | ||||||
| import android.view.Menu; | import android.view.Menu; | ||||||
| 
 | 
 | ||||||
| @ -227,8 +226,8 @@ public class TestActivity extends Activity { | |||||||
| 	public RemoteOperationResult downloadFile(RemoteFile remoteFile, String temporalFolder) { | 	public RemoteOperationResult downloadFile(RemoteFile remoteFile, String temporalFolder) { | ||||||
| 		// Create folder  | 		// Create folder  | ||||||
| 		String path =  "/owncloud/tmp/" + temporalFolder; | 		String path =  "/owncloud/tmp/" + temporalFolder; | ||||||
| 		File sdCard = Environment.getExternalStorageDirectory(); | 		File privateFolder = getFilesDir(); | ||||||
| 		File folder = new File(sdCard.getAbsolutePath() + "/" + path); | 		File folder = new File(privateFolder.getAbsolutePath() + "/" + path); | ||||||
| 		folder.mkdirs(); | 		folder.mkdirs(); | ||||||
| 		 | 		 | ||||||
| 		DownloadRemoteFileOperation downloadOperation = new DownloadRemoteFileOperation(remoteFile.getRemotePath(), folder.getAbsolutePath()); | 		DownloadRemoteFileOperation downloadOperation = new DownloadRemoteFileOperation(remoteFile.getRemotePath(), folder.getAbsolutePath()); | ||||||
|  | |||||||
| @ -6,8 +6,8 @@ dependencies { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| android { | android { | ||||||
|     compileSdkVersion 19 |     compileSdkVersion 23 | ||||||
|     buildToolsVersion "20.0.0" |     buildToolsVersion "23.0.2" | ||||||
| 
 | 
 | ||||||
|     sourceSets { |     sourceSets { | ||||||
|         main { |         main { | ||||||
|  | |||||||
| @ -11,4 +11,4 @@ | |||||||
| #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt | ||||||
| 
 | 
 | ||||||
| # Project target. | # Project target. | ||||||
| target=android-19 | target=android-23 | ||||||
|  | |||||||
| @ -109,8 +109,6 @@ public class CopyFileTest extends ActivityInstrumentationTestCase2<TestActivity> | |||||||
| 
 | 
 | ||||||
|     private static final String SRC_PATH_TO_FILE_6 = SRC_BASE_FOLDER + FILE6; |     private static final String SRC_PATH_TO_FILE_6 = SRC_BASE_FOLDER + FILE6; | ||||||
| 
 | 
 | ||||||
|     private static final String SRC_PATH_TO_FILE_7 = SRC_BASE_FOLDER + FILE7; |  | ||||||
| 
 |  | ||||||
|     private static final String SRC_PATH_TO_NON_EXISTENT_FILE = SRC_BASE_FOLDER + NO_FILE; |     private static final String SRC_PATH_TO_NON_EXISTENT_FILE = SRC_BASE_FOLDER + NO_FILE; | ||||||
| 
 | 
 | ||||||
|     private static final String SRC_PATH_TO_EMPTY_FOLDER = SRC_BASE_FOLDER + EMPTY; |     private static final String SRC_PATH_TO_EMPTY_FOLDER = SRC_BASE_FOLDER + EMPTY; | ||||||
|  | |||||||
| @ -94,8 +94,7 @@ public class DownloadFileTest extends RemoteTest { | |||||||
| 	 */ | 	 */ | ||||||
| 	public void testDownloadFile() { | 	public void testDownloadFile() { | ||||||
| 		RemoteOperationResult result = mActivity.downloadFile( | 		RemoteOperationResult result = mActivity.downloadFile( | ||||||
| 				new RemoteFile(mFullPath2Image),  | 			new RemoteFile(mFullPath2Image), "" | ||||||
| 				mActivity.getFilesDir().getAbsolutePath() |  | ||||||
| 		); | 		); | ||||||
| 		mDownloadedFilePath = mFullPath2Image; | 		mDownloadedFilePath = mFullPath2Image; | ||||||
| 		assertTrue(result.isSuccess()); | 		assertTrue(result.isSuccess()); | ||||||
| @ -107,8 +106,7 @@ public class DownloadFileTest extends RemoteTest { | |||||||
| 	 */ | 	 */ | ||||||
| 	public void testDownloadFileSpecialChars() { | 	public void testDownloadFileSpecialChars() { | ||||||
| 		RemoteOperationResult result = mActivity.downloadFile( | 		RemoteOperationResult result = mActivity.downloadFile( | ||||||
| 				new RemoteFile(mFullPath2ImageWitSpecialChars), | 			new RemoteFile(mFullPath2ImageWitSpecialChars), "" | ||||||
| 				mActivity.getFilesDir().getAbsolutePath() |  | ||||||
| 		); | 		); | ||||||
| 		mDownloadedFilePath = mFullPath2ImageWitSpecialChars; | 		mDownloadedFilePath = mFullPath2ImageWitSpecialChars; | ||||||
| 		assertTrue(result.isSuccess()); | 		assertTrue(result.isSuccess()); | ||||||
| @ -120,8 +118,7 @@ public class DownloadFileTest extends RemoteTest { | |||||||
| 	 */ | 	 */ | ||||||
| 	public void testDownloadFileNotFound() { | 	public void testDownloadFileNotFound() { | ||||||
| 		RemoteOperationResult result = mActivity.downloadFile( | 		RemoteOperationResult result = mActivity.downloadFile( | ||||||
| 				new RemoteFile(mFullPath2ImageNotFound),  | 			new RemoteFile(mFullPath2ImageNotFound), "" | ||||||
| 				mActivity.getFilesDir().getAbsolutePath() |  | ||||||
| 		); | 		); | ||||||
| 		assertFalse(result.isSuccess()); | 		assertFalse(result.isSuccess()); | ||||||
| 	} | 	} | ||||||
|  | |||||||
| @ -30,10 +30,9 @@ import java.security.GeneralSecurityException; | |||||||
| import org.apache.commons.httpclient.ConnectTimeoutException; | import org.apache.commons.httpclient.ConnectTimeoutException; | ||||||
| import org.apache.commons.httpclient.HttpException; | import org.apache.commons.httpclient.HttpException; | ||||||
| import org.apache.commons.httpclient.methods.HeadMethod; | import org.apache.commons.httpclient.methods.HeadMethod; | ||||||
| import org.apache.commons.httpclient.params.HttpMethodParams; |  | ||||||
| import org.apache.commons.httpclient.protocol.Protocol; | import org.apache.commons.httpclient.protocol.Protocol; | ||||||
| import org.apache.commons.httpclient.protocol.ProtocolSocketFactory; | import org.apache.commons.httpclient.protocol.ProtocolSocketFactory; | ||||||
| import org.apache.http.HttpStatus; | import org.apache.commons.httpclient.HttpStatus; | ||||||
| import org.apache.jackrabbit.webdav.DavConstants; | import org.apache.jackrabbit.webdav.DavConstants; | ||||||
| import org.apache.jackrabbit.webdav.client.methods.PropFindMethod; | import org.apache.jackrabbit.webdav.client.methods.PropFindMethod; | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -28,7 +28,6 @@ package com.owncloud.android.lib.test_project.test; | |||||||
| 
 | 
 | ||||||
| import java.io.File; | import java.io.File; | ||||||
| import java.security.GeneralSecurityException; | import java.security.GeneralSecurityException; | ||||||
| import java.util.Calendar; |  | ||||||
| 
 | 
 | ||||||
| import junit.framework.AssertionFailedError; | import junit.framework.AssertionFailedError; | ||||||
| 
 | 
 | ||||||
| @ -207,8 +206,8 @@ public class UpdatePrivateShareTest extends RemoteTest { | |||||||
| 				UpdateRemoteShareOperation updateNoShare = new UpdateRemoteShareOperation( | 				UpdateRemoteShareOperation updateNoShare = new UpdateRemoteShareOperation( | ||||||
| 						mFileShare.getRemoteId() | 						mFileShare.getRemoteId() | ||||||
| 				); | 				); | ||||||
| 				updateShare.setPermissions(OCShare.READ_PERMISSION_FLAG);	// minimum permissions | 				updateNoShare.setPermissions(OCShare.READ_PERMISSION_FLAG);	// minimum permissions | ||||||
| 				result = updateShare.execute(mClient); | 				result = updateNoShare.execute(mClient); | ||||||
| 				assertFalse(result.isSuccess()); | 				assertFalse(result.isSuccess()); | ||||||
| 			} | 			} | ||||||
| 				 | 				 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user