-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathResult.java
More file actions
211 lines (172 loc) · 4.91 KB
/
Result.java
File metadata and controls
211 lines (172 loc) · 4.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
package io.imagekit.sdk.models.results;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.reflect.TypeToken;
import io.imagekit.sdk.models.BaseFile;
import io.imagekit.sdk.models.ResponseMetaData;
import io.imagekit.sdk.utils.Utils;
import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class Result extends BaseFile {
private BufferedImage image;
private String help;
@Deprecated
private String raw;
private ResponseMetaData responseMetaData = new ResponseMetaData();
public Result() {
}
public Result(String fileId, String name, String url, String thumbnail, int height, int width, long size,
String filePath, List<String> tags, boolean isPrivateFile, String customCoordinates, String fileType,
JsonArray aiTags, JsonObject versionInfo, JsonObject customMetadata, JsonObject embeddedMetadata,
JsonObject extensionStatus, String type, String mime, Boolean hasAlpha, Date createdAt, Date updatedAt) {
this.fileId = fileId;
this.name = name;
this.url = url;
this.thumbnail = thumbnail;
this.height = height;
this.width = width;
this.size = size;
this.filePath = filePath;
this.tags = tags;
this.isPrivateFile = isPrivateFile;
this.customCoordinates = customCoordinates;
this.fileType = fileType;
this.aiTags = aiTags;
this.versionInfo = versionInfo;
this.customMetadata = customMetadata;
this.embeddedMetadata = embeddedMetadata;
this.extensionStatus = extensionStatus;
this.type = type;
this.mime = mime;
this.hasAlpha = hasAlpha;
this.createdAt = createdAt;
this.updatedAt = updatedAt;
}
public BufferedImage getImage() {
return this.image;
}
public void setImage(BufferedImage image) {
this.image = image;
}
public String getHelp() {
return help;
}
public String getRaw() {
return raw;
}
public void setRaw(String raw) {
this.raw = raw;
}
@Deprecated
public Map<String, Object> getMap() {
if (null != raw) {
return new Gson().fromJson(raw, new TypeToken<Map<String, Object>>() {
}.getType());
}
return new HashMap<>();
}
public void setHelp(String help) {
this.help = help;
}
public String getFileId() {
return fileId;
}
public void setFileId(String fileId) {
this.fileId = fileId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getThumbnail() {
return thumbnail;
}
public void setThumbnail(String thumbnail) {
this.thumbnail = thumbnail;
}
public int getHeight() {
return height;
}
public void setHeight(int height) {
this.height = height;
}
public int getWidth() {
return width;
}
public void setWidth(int width) {
this.width = width;
}
public long getSize() {
return size;
}
public void setSize(long size) {
this.size = size;
}
public String getFilePath() {
return filePath;
}
public void setFilePath(String filePath) {
this.filePath = filePath;
}
public List<String> getTags() {
return tags;
}
public void setTags(List<String> tags) {
this.tags = tags;
}
public boolean isPrivateFile() {
return isPrivateFile;
}
public void setPrivateFile(boolean privateFile) {
isPrivateFile = privateFile;
}
public String getCustomCoordinates() {
return customCoordinates;
}
public void setCustomCoordinates(String customCoordinates) {
this.customCoordinates = customCoordinates;
}
public String getFileType() {
return fileType;
}
public void setFileType(String fileType) {
this.fileType = fileType;
}
public ResponseMetaData getResponseMetaData() {
return responseMetaData;
}
public void setResponseMetaData(ResponseMetaData responseMetaData) {
this.responseMetaData = responseMetaData;
}
@Override
public String toString() {
return "Result{" + "fileId='" + fileId + '\'' + ", name='" + name + '\'' + ", url='" + url + '\''
+ ", thumbnail='" + thumbnail + '\'' + ", height=" + height + ", width=" + width + ", size=" + size
+ ", filePath='" + filePath + '\'' + ", tags=" + tags + ", isPrivateFile=" + isPrivateFile
+ ", customCoordinates='" + customCoordinates + '\'' + ", fileType='" + fileType + '\'' + ", aiTags="
+ aiTags + ", versionInfo=" + versionInfo + ", customMetadata=" + customMetadata + ", embeddedMetadata="
+ embeddedMetadata + ", extensionStatus=" + extensionStatus + ", type='" + type + '\'' + ", mime='"
+ mime + '\'' + ", hasAlpha=" + hasAlpha + ", createdAt=" + createdAt + ", updatedAt=" + updatedAt
+ ", help='" + help + '\'' + ", raw='" + raw + '\'' + ", responseMetaData=" + responseMetaData + '}';
}
}