Revision fc8b1f79 src/com/rackspace/cloud/files/api/client/ContainerObjectManager.java
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