| 17 | import java.util.List; |
| 18 | |
| 19 | public class Drive { |
| 20 | |
| 21 | @SerializedName("name") |
| 22 | private String name; |
| 23 | @SerializedName("server") |
| 24 | private String server; |
| 25 | @SerializedName("user") |
| 26 | private String user; |
| 27 | @SerializedName("pass") |
| 28 | private String pass; |
| 29 | @SerializedName("path") |
| 30 | private String path; |
| 31 | |
| 32 | private Sardine webdav; |
| 33 | |
| 34 | public static List<Drive> arrayFrom(String str) { |
| 35 | Type listType = TypeToken.getParameterized(List.class, Drive.class).getType(); |
| 36 | return new Gson().fromJson(str, listType); |
| 37 | } |
| 38 | |
| 39 | public Drive(String name) { |
| 40 | this.name = name; |
| 41 | } |
| 42 | |
| 43 | public String getName() { |
| 44 | return TextUtils.isEmpty(name) ? "" : name; |
| 45 | } |
| 46 | |
| 47 | public String getServer() { |
| 48 | return TextUtils.isEmpty(server) ? "" : server; |
| 49 | } |
| 50 | |
| 51 | public String getUser() { |
| 52 | return TextUtils.isEmpty(user) ? "" : user; |
| 53 | } |
| 54 | |
| 55 | public String getPass() { |
| 56 | return TextUtils.isEmpty(pass) ? "" : pass; |
| 57 | } |
| 58 | |
| 59 | public String getPath() { |
| 60 | return TextUtils.isEmpty(path) ? "" : path; |
| 61 | } |
| 62 | |
| 63 | public void setPath(String path) { |
| 64 | this.path = TextUtils.isEmpty(path) ? "" : path; |
| 65 | } |
| 66 | |
| 67 | public String getHost() { |
| 68 | return getServer().replace(getPath(), ""); |
| 69 | } |
| 70 | |
| 71 | public Sardine getWebdav() { |
| 72 | if (webdav == null) init(); |
| 73 | return webdav; |
| 74 | } |
| 75 | |
| 76 | public Class toType() { |
nothing calls this directly
no outgoing calls
no test coverage detected