mirror of
				https://github.com/owncloud/android-library.git
				synced 2025-10-31 02:17:41 +00:00 
			
		
		
		
	Revert "Changes from comments in PR#442, in oc-project"
This reverts commit 3bf858e2a7ea154e4a00e98fe95d98153b416bbf.
This commit is contained in:
		
							parent
							
								
									3bf858e2a7
								
							
						
					
					
						commit
						7696616a44
					
				| @ -101,24 +101,6 @@ public class CreateRemoteShareOperation extends RemoteOperation { | |||||||
| 		PostMethod post = null; | 		PostMethod post = null; | ||||||
| 
 | 
 | ||||||
| 		try { | 		try { | ||||||
| 
 |  | ||||||
| 			// Check if the share link already exists |  | ||||||
| 			GetRemoteSharesForFileOperation operation = new GetRemoteSharesForFileOperation(mRemoteFilePath, false, false); |  | ||||||
| 			result = ((GetRemoteSharesForFileOperation)operation).execute(client); |  | ||||||
| 
 |  | ||||||
| 			if (result.isSuccess()) {  |  | ||||||
| 				if (result.getData().size() > 0) { |  | ||||||
| 					OCShare share = (OCShare) result.getData().get(0); |  | ||||||
| 					// Update the link, build it with the token: server address + "/public.php?service=files&t=" + token |  | ||||||
| 					share.setShareLink(client.getBaseUri() + ShareUtils.SHARING_LINK_TOKEN + share.getToken()); |  | ||||||
| 					Log.d(TAG, "Build Share link= " + share.getShareLink()); |  | ||||||
| 					 |  | ||||||
| 					result = new RemoteOperationResult(ResultCode.OK); |  | ||||||
| 					ArrayList<Object> sharesObjects = new ArrayList<Object>(); |  | ||||||
| 					sharesObjects.add(share); |  | ||||||
| 					result.setData(sharesObjects); |  | ||||||
| 				} |  | ||||||
| 			} else { |  | ||||||
| 			// Post Method | 			// Post Method | ||||||
| 			post = new PostMethod(client.getBaseUri() + ShareUtils.SHARING_API_PATH); | 			post = new PostMethod(client.getBaseUri() + ShareUtils.SHARING_API_PATH); | ||||||
| 			Log.d(TAG, "URL ------> " + client.getBaseUri() + ShareUtils.SHARING_API_PATH); | 			Log.d(TAG, "URL ------> " + client.getBaseUri() + ShareUtils.SHARING_API_PATH); | ||||||
| @ -168,8 +150,6 @@ public class CreateRemoteShareOperation extends RemoteOperation { | |||||||
| 			} else { | 			} else { | ||||||
| 				result = new RemoteOperationResult(false, status, post.getResponseHeaders()); | 				result = new RemoteOperationResult(false, status, post.getResponseHeaders()); | ||||||
| 			} | 			} | ||||||
| 	        } |  | ||||||
| 	         |  | ||||||
| 			 | 			 | ||||||
| 		} catch (Exception e) { | 		} catch (Exception e) { | ||||||
| 			result = new RemoteOperationResult(e); | 			result = new RemoteOperationResult(e); | ||||||
|  | |||||||
| @ -36,7 +36,4 @@ public class ShareUtils { | |||||||
| 	// OCS Route | 	// OCS Route | ||||||
| 	public static final String SHARING_API_PATH ="/ocs/v1.php/apps/files_sharing/api/v1/shares";  | 	public static final String SHARING_API_PATH ="/ocs/v1.php/apps/files_sharing/api/v1/shares";  | ||||||
| 
 | 
 | ||||||
|     // String to build the link with the token of a share: server address + "/public.php?service=files&t=" + token |  | ||||||
|     public static final String SHARING_LINK_TOKEN = "/public.php?service=files&t="; |  | ||||||
| 
 |  | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user