Revision 7b27f0dc src/com/rackspace/cloud/files/api/client/ContainerObjects.java
b/src/com/rackspace/cloud/files/api/client/ContainerObjects.java | ||
---|---|---|
2 | 2 |
|
3 | 3 |
import java.util.Map; |
4 | 4 |
|
5 |
import com.rackspace.cloud.servers.api.client.Account; |
|
5 | 6 |
import com.rackspace.cloud.servers.api.client.Entity; |
6 | 7 |
|
7 | 8 |
/** |
... | ... | |
14 | 15 |
private String object; |
15 | 16 |
private String hash; |
16 | 17 |
private String lastMod; |
17 |
private int bytes; |
|
18 |
private int bytes=0;
|
|
18 | 19 |
private String cname; |
19 | 20 |
private String contentType; |
20 | 21 |
private String containerName; |
22 |
private boolean subDir = false; |
|
21 | 23 |
|
22 |
private boolean isFolder() { |
|
23 |
return contentType.startsWith("application/folder;"); |
|
24 |
public boolean isSubDir() { |
|
25 |
return subDir; |
|
26 |
} |
|
27 |
|
|
28 |
public void setSubDir(boolean subDir) { |
|
29 |
this.subDir = subDir; |
|
30 |
} |
|
31 |
|
|
32 |
public boolean isFolder() { |
|
33 |
return isSubDir()||getContentType().startsWith("application/directory")||getContentType().startsWith("application/folder"); |
|
24 | 34 |
} |
25 | 35 |
|
26 | 36 |
public boolean isShared(){ |
... | ... | |
28 | 38 |
return true; |
29 | 39 |
} |
30 | 40 |
if(getObjectSharing()!=null){ |
31 |
if(getObjectSharing().split(":").length>1) |
|
32 |
return true; |
|
41 |
if(getPermissions().size()>0){ |
|
42 |
for(Permission p : getPermissions()){ |
|
43 |
if(p.getGroup()!=null ||(p.getUser()!=null && !p.getUser().equals(Account.getAccount().getUsername()))){ |
|
44 |
if(p.isRead()||p.isWrite()) |
|
45 |
return true; |
|
46 |
} |
|
47 |
} |
|
48 |
} |
|
49 |
|
|
33 | 50 |
} |
34 | 51 |
return false; |
35 | 52 |
} |
Also available in: Unified diff