Revision fc8b1f79

b/src/com/rackspace/cloud/android/ContainerObjectDetails.java
852 852
			HttpBundle bundle = null;
853 853
			try {
854 854
				bundle = (new ContainerObjectManager(getContext()))
855
						.deleteObject(containerNames, objects.getCName());
855
						.deleteObject(containerNames, objects.getCName(),otherUser);
856 856
			} catch (CloudServersException e) {
857 857
				exception = e;
858 858
			}
......
905 905
			try {
906 906
				if(arg0.length==1 && arg0[0]!=null)
907 907
					bundle = (new ContainerObjectManager(getContext())).getObject(
908
							containerNames, objects.getCName(),arg0[0]);
908
							containerNames, objects.getCName(),arg0[0], otherUser);
909 909
				else
910 910
					bundle = (new ContainerObjectManager(getContext())).getObject(
911
						containerNames, objects.getCName());
911
						containerNames, objects.getCName(),otherUser);
912 912
			} catch (CloudServersException e) {
913 913
				exception = e;
914 914
			}
......
1235 1235
			write = "write="+write;
1236 1236
			headers.put("X-Object-Sharing", read+";"+write);
1237 1237
		}
1238
		HttpBundle b = new ContainerObjectManager(getApplicationContext()).updateObject(objects.getContainerName(), objects.getCName(), "", null, headers);
1238
		HttpBundle b = new ContainerObjectManager(getApplicationContext()).updateObject(objects.getContainerName(), objects.getCName(), "", null, headers,otherUser);
1239 1239
		Log.i(LOG,"response:"+b.getResponse().getStatusLine().getStatusCode());
1240 1240
		return b;
1241 1241
	}
......
1247 1247
		headers.put("X-Source-Object","/"+objects.getContainerName()+"/"+objects.getCName());
1248 1248
		headers.put("X-Source-Version",version);
1249 1249
		headers.put("Content-Range","bytes 0-/*");
1250
		HttpBundle b = new ContainerObjectManager(getApplicationContext()).updateObject(objects.getContainerName(), objects.getCName(), "", "text/plain; charset=UTF-8", headers);
1250
		HttpBundle b = new ContainerObjectManager(getApplicationContext()).updateObject(objects.getContainerName(), objects.getCName(), "", "text/plain; charset=UTF-8", headers,otherUser);
1251 1251
		Log.i(LOG,"response:"+b.getResponse().getStatusLine().getStatusCode());
1252 1252
		return b;
1253 1253
	}
b/src/com/rackspace/cloud/android/ContainerObjectsActivity.java
42 42
import com.rackspace.cloud.files.api.client.ContainerManager;
43 43
import com.rackspace.cloud.files.api.client.ContainerObjectManager;
44 44
import com.rackspace.cloud.files.api.client.ContainerObjects;
45
import com.rackspace.cloud.files.api.client.parsers.OthersXmlParser;
45 46
import com.rackspace.cloud.servers.api.client.CloudServersException;
46 47
import com.rackspace.cloud.servers.api.client.http.HttpBundle;
47 48

  
......
819 820
			try {
820 821

  
821 822
				bundle = (new ContainerObjectManager(getContext())).addObject(
822
						container.getName(), currentPath, data[0], data[1]);
823
						container.getName(), currentPath, data[0], data[1],container.getOtherUser());
823 824
			} catch (CloudServersException e) {
824 825
				exception = e;
825 826
			}
......
871 872
			try {
872 873

  
873 874
				bundle = (new ContainerObjectManager(getContext())).addFileObject(
874
						container.getName(), currentPath, data[0], data[1], data[2]);
875
						container.getName(), currentPath, data[0], data[1], data[2], container.getOtherUser());
875 876
			} catch (CloudServersException e) {
876 877
				exception = e;
877 878
			}
......
927 928
				String cpath = args[1];
928 929
				bundle = (new ContainerObjectManager(getContext()))
929 930
						.deleteObject(cname, cpath
930
								.substring(0, cpath.length() - 1));
931
								.substring(0, cpath.length() - 1),container.getOtherUser());
931 932
			} catch (CloudServersException e) {
932 933
				exception = e;
933 934
			}
b/src/com/rackspace/cloud/android/PithosGroupsActivity.java
163 163
						else{
164 164
							headers.put("X-Account-Group-"+group.getName(), "~");
165 165
						}
166
						bundel = new ContainerObjectManager(getApplicationContext()).updateObject(null, null, null, "application/json", headers);
166
						bundel = new ContainerObjectManager(getApplicationContext()).updateObject(null, null, null, "application/json", headers,null);
167 167
						//Log.d("papala",bundel.getResponse().getStatusLine().getStatusCode()+" status");
168 168
						if(false)
169 169
							throw new CloudServersException();
......
198 198
    				headers.put("X-Account-Group-"+group.getName(), group.getUserString()+value);
199 199
    				HttpBundle bundel;
200 200
					try {
201
						bundel = new ContainerObjectManager(getApplicationContext()).updateObject(null, null, null, "application/json", headers);
201
						bundel = new ContainerObjectManager(getApplicationContext()).updateObject(null, null, null, "application/json", headers,null);
202 202
						refresh();
203 203
					} catch (CloudServersException e) {
204 204
						// TODO Auto-generated catch block
......
234 234
				headers.put("X-Account-Group-"+value, "placeholder,");
235 235
				HttpBundle bundel;
236 236
				try {
237
					bundel = new ContainerObjectManager(getApplicationContext()).updateObject(null, null, null, "application/json", headers);
237
					bundel = new ContainerObjectManager(getApplicationContext()).updateObject(null, null, null, "application/json", headers,null);
238 238
					refresh();
239 239
				} catch (CloudServersException e) {
240 240
					// TODO Auto-generated catch block
b/src/com/rackspace/cloud/files/api/client/ContainerObjectManager.java
508 508
		return bundle;
509 509
	}
510 510

  
511
	public HttpBundle deleteObject(String Container, String Object)
511
	public HttpBundle deleteObject(String Container, String Object, String username)
512 512
			throws CloudServersException {
513 513
		
514 514
		String url = getSafeURL(Account.getAccount().getStorageUrl(), Container
515 515
				+ "/" + Object);
516
		if(username!=null)
517
			url = url.replaceFirst(Account.getAccount().getUsername(), username);
516 518
		return executeMethod(DELETE, url);
517 519
	}
518 520
	
......
536 538
		return executeMethod(PUT, url,"text/plain; charset=UTF-8",headers);
537 539
	}
538 540

  
539
	public HttpBundle getObject(String Container, String Object)
541
	public HttpBundle getObject(String Container, String Object, String username)
540 542
			throws CloudServersException {
541 543
		String url = getSafeURL(Account.getAccount().getStorageUrl(), Container
542 544
				+ "/" + Object);
545
		if(username!=null)
546
			url = url.replaceFirst(Account.getAccount().getUsername(), username);
543 547
		return executeMethod(GET, url);
544 548
	}
545 549
	
546 550
	
547
	public HttpBundle getObject(String Container, String Object, String version)
551
	public HttpBundle getObject(String Container, String Object, String version, String username)
548 552
			throws CloudServersException {
549 553
		String url = getSafeURL(Account.getAccount().getStorageUrl(), Container
550 554
				+ "/" + Object+"?version="+version);
555
		if(username!=null)
556
			url = url.replaceFirst(Account.getAccount().getUsername(), username);
551 557
		return executeMethod(GET, url);
552 558
	}
553 559
	
554 560
	
555 561

  
556 562
	public HttpBundle addObject(String Container, String Path, String Object,
557
			String type) throws CloudServersException {
563
			String type, String username) throws CloudServersException {
558 564
		String url = getSafeURL(Account.getAccount().getStorageUrl(), Container
559 565
				+ "/" + Path + Object);
566
		if(username!=null)
567
			url = url.replaceFirst(Account.getAccount().getUsername(), username);
560 568
		return executeMethod(PUT, url,type);
561 569
	}
562 570
	
563 571
	
564 572
	
565 573
	public HttpBundle updateObject(String Container, String Path, String Object,
566
			String type, Map<String,String> headers) throws CloudServersException {
574
			String type, Map<String,String> headers, String username) throws CloudServersException {
567 575
		String url;
568 576
		if(Container !=null)
569 577
			url = getSafeURL(Account.getAccount().getStorageUrl(), Container
......
574 582
				url = url.substring(0, url.length()-1);
575 583
		}
576 584
		url =url+"?update=";
585
		if(username!=null)
586
			url = url.replaceFirst(Account.getAccount().getUsername(), username);
577 587
		Log.d(LOG,"Update URL="+ url);
578 588
		return executeMethod(POST, url,  "	text/plain; charset=UTF-8", headers);
579 589
	}
......
585 595
	 * for the file
586 596
	 */
587 597
	public HttpBundle addFileObject(String Container, String Path, String Object,
588
			String type,  String file) throws CloudServersException {
598
			String type,  String file, String username) throws CloudServersException {
589 599
		HttpResponse resp = null;
590 600
		CustomHttpClient httpclient = new CustomHttpClient(context);
591 601
		String url = getSafeURL(Account.getAccount().getStorageUrl(), Container
592 602
				+ "/" + Path + Object);
603
		if(username!=null)
604
			url = url.replaceFirst(Account.getAccount().getUsername(), username);
593 605
		HttpPut addObject = new HttpPut(url);
594 606

  
595 607
		addObject

Also available in: Unified diff