-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathCloudApp.java
More file actions
265 lines (242 loc) · 8.87 KB
/
Copy pathCloudApp.java
File metadata and controls
265 lines (242 loc) · 8.87 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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
package com.cloudapp.api;
import java.io.File;
import java.util.List;
import com.cloudapp.api.model.CloudAppAccount;
import com.cloudapp.api.model.CloudAppAccountStats;
import com.cloudapp.api.model.CloudAppItem;
import com.cloudapp.api.model.CloudAppProgressListener;
public interface CloudApp {
/**
* Change the security of newly created items to either private (long links) or public
* (short links). Privacy can be set on a per-item basis after creation.
*
* @see http://developer.getcloudapp.com/change-default-security
* @throws CloudAppException
* Either CloudApp sent an unexpected response back or something went wrong
* locally. If it's an error response from cloudapp, then the HTTP status code
* will be set on the exception.
* @return
*/
public CloudAppAccount setDefaultSecurity(CloudAppAccount.DefaultSecurity security)
throws CloudAppException;
/**
* Change the email address for an account.
*
* @see http://developer.getcloudapp.com/change-email
* @throws CloudAppException
* Either CloudApp sent an unexpected response back or something went wrong
* locally. If it's an error response from cloudapp, then the HTTP status code
* will be set on the exception.
* @param newEmail
* The address you wish to use.
* @param currentPassword
* Your current password (as a confirmation mechanism.)
* @return
*/
public CloudAppAccount setEmail(String newEmail, String currentPassword)
throws CloudAppException;
/**
* Changes the current password.
*
* @see http://developer.getcloudapp.com/change-password
* @throws CloudAppException
* Either CloudApp sent an unexpected response back or something went wrong
* locally. If it's an error response from cloudapp, then the HTTP status code
* will be set on the exception.
* @param newPassword
* The new password you want to use.
* @param currentPassword
* Your old password.
* @return
*/
public CloudAppAccount setPassword(String newPassword, String currentPassword)
throws CloudAppException;
/**
* Dispatch an email containing a link to reset the account's password.
*
* @see http://developer.getcloudapp.com/forgot-password
* @param email
* The email address.
* @throws CloudAppException
* Either CloudApp sent an unexpected response back or something went wrong
* locally. If it's an error response from cloudapp, then the HTTP status code
* will be set on the exception.
* @return
*/
public void resetPassword(String email) throws CloudAppException;
/**
* Create a CloudApp account. Obviously there is no need to provide existing credentials
* in order to this method to succeed.
*
* @see http://developer.getcloudapp.com/register
* @param email
* Your email address you wish to sign up with.
* @param password
* The password you wish to you.
* @param acceptTOS
* Wether or not you accept the Terms Of Services. (Hint: you probably want to
* pass true along here..)
* @throws CloudAppException
* Either CloudApp sent an unexpected response back or something went wrong
* locally. If it's an error response from cloudapp, then the HTTP status code
* will be set on the exception.
* @return
*/
public CloudAppAccount createAccount(String email, String password, boolean acceptTOS)
throws CloudAppException;
/**
* Add or change the domain used for all links. Optionally, a URL may be provided to
* redirect visitors to the custom domain's root. <b>Pro users only</b>
*
* @see http://developer.getcloudapp.com/set-custom-domain
* @param domain
* @param domainHomePage
* @throws CloudAppException
* Either CloudApp sent an unexpected response back or something went wrong
* locally. If it's an error response from cloudapp, then the HTTP status code
* will be set on the exception.
* @return
*/
public CloudAppAccount setCustomDomain(String domain, String domainHomePage)
throws CloudAppException;
/**
* Get the basic details of the authenticated account. This is the same response as
* returned by most account endpoints.
*
* @see http://developer.getcloudapp.com/view-account-details
* @throws CloudAppException
* Either CloudApp sent an unexpected response back or something went wrong
* locally. If it's an error response from cloudapp, then the HTTP status code
* will be set on the exception.
* @return
*/
public CloudAppAccount getAccountDetails() throws CloudAppException;
/**
* Get the total number of items created and total views for all items of the
* authenticated account.
*
* @see http://developer.getcloudapp.com/view-account-stats
* @throws CloudAppException
* Either CloudApp sent an unexpected response back or something went wrong
* locally. If it's an error response from cloudapp, then the HTTP status code
* will be set on the exception.
* @return
*/
public CloudAppAccountStats getAccountStats() throws CloudAppException;
//
// ITEMS //
//
/**
* Create a bookmark to a URL.
*
* @see http://developer.getcloudapp.com/bookmark-link
* @param name
* The name of your bookmark
* @param url
* The url you wish to bookmark.
* @throws CloudAppException
* @return
*/
public CloudAppItem createBookmark(String name, String url) throws CloudAppException;
/**
* Create multiple bookmarks in a single request.
*
* @see http://developer.getcloudapp.com/bookmark-multiple-links
* @param bookmarks
* An array of String arrays. Each String array should contain two Strings, the
* first being the name of the bookmark and the second the url.
* @throws CloudAppException
* @return
*/
public List<CloudAppItem> createBookmarks(String[][] bookmarks)
throws CloudAppException;
/**
* Get metadata about a cl.ly URL.
*
* @see http://developer.getcloudapp.com/view-item
* @param url
* The url
* @return
* @throws CloudAppException
*/
public CloudAppItem getItem(String url) throws CloudAppException;
/**
* Page through your items.
*
* @see http://developer.getcloudapp.com/list-items
* @param page
* The page to requests, starts at 1.
* @param perPage
* Number of items per page (minimum=5)
* @param type
* (Optional) One of the avaiable {@link CloudAppItem.Type types}
* @param showDeleted
* Include the trashed items?
* @param source
* (Optional) Only show items that originate from a certain app.The CloudApp
* Mac app uses the User-Agent Cloud/1.5.1 so all items it creates will have
* that User-Agent as their source. To list only the items created using the
* Mac app, use the parameter source=Cloud. Get fancy and list only the items
* created using a specific version of with source=Cloud/1.5.1.
* @return A list with your items.
* @throws CloudAppException
*/
public List<CloudAppItem> getItems(int page, int perPage, CloudAppItem.Type type,
boolean showDeleted, String source) throws CloudAppException;
/**
*
* @see http://developer.getcloudapp.com/upload-file
* @param file
* The file you wish to upload.
* @throws CloudAppException
* @return
*/
public CloudAppItem upload(File file) throws CloudAppException;
/**
*
* @see http://developer.getcloudapp.com/upload-file
* @param file
* The file you wish to upload.
* @param listener
* To receive progress updates during upload
* @throws CloudAppException
* @return
*/
public CloudAppItem upload(File file, CloudAppProgressListener listener) throws CloudAppException;
/**
* Deletes an item
*
* @param item
* The item to delete
* @throws CloudAppException
*/
public CloudAppItem delete(CloudAppItem item) throws CloudAppException;
/**
* Recover an item in the trash
*
* @param item
* The item to recover
* @throws CloudAppException
*/
public CloudAppItem recover(CloudAppItem item) throws CloudAppException;
/**
* Makes an item either public or private.
*
* @param item
* @param is_private
* true=private, false=public.
* @throws CloudAppException
* @return
*/
public CloudAppItem setSecurity(CloudAppItem item, boolean is_private)
throws CloudAppException;
/**
* Change the name of an item
*
* @param item
* @param name
* @throws CloudAppException
* @return
*/
public CloudAppItem rename(CloudAppItem item, String name) throws CloudAppException;
}