Skip to content

Commit 325529e

Browse files
committed
Merge branch 's3-integration' of https://github.com/creatubbles/api.git into s3-integration
2 parents de8f799 + f6a0c52 commit 325529e

1 file changed

Lines changed: 0 additions & 23 deletions

File tree

src/main/java/com/creatubbles/api/CreatubblesAPI.java

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -52,27 +52,4 @@ public static void setStagingMode(boolean staging) {
5252
CreatubblesAPI.staging = staging;
5353
}
5454

55-
public static void main(String[] args) throws IOException {
56-
//login
57-
SignInResponse response = new SignInRequest("jevgeni.koltsin@gmail.com", "ccttbb").execute().getResponse();
58-
System.out.println(response.access_token);
59-
//create creation
60-
UploadCreationResponse uploadResponse = new UploadCreationRequest(response.access_token).execute().getResponse();
61-
//get required info for s3
62-
GetAmazonTokenResponse amazonTokenResponse = new GetAmazonTokenRequest(response.access_token).execute().getResponse();
63-
Credentials credentials = amazonTokenResponse.credentials;
64-
//TODO: last screenshot
65-
File file = new File("C:/dev/1.png");
66-
byte[] data = Files.readAllBytes(file.toPath());
67-
String fileName = System.currentTimeMillis() + "creation.png";
68-
Creation creation = uploadResponse.creation;
69-
String relativePath = creation.store_dir + "/" + fileName;
70-
//upload image
71-
new UploadS3ImageRequest(data, relativePath, credentials.access_key_id, credentials.secret_access_key, credentials.session_token)
72-
.execute().getResponse();
73-
creation.url = relativePath;
74-
//update creation(url)
75-
new UpdateCreationRequest(response.access_token, creation).execute().getResponse();
76-
System.exit(0);
77-
}
7855
}

0 commit comments

Comments
 (0)