Last active
October 16, 2018 20:36
-
-
Save sauceaaron/03c035e3f996920d42d653acc311a704 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import com.saucelabs.saucerest.SauceREST; | |
| import java.io.File; | |
| import java.io.IOException; | |
| public class UploadFileToSauceStorage | |
| { | |
| static String SAUCE_USERNAME = System.getenv("SAUCE_USERNAME"); | |
| static String SAUCE_ACCESS_KEY = System.getenv("SAUCE_ACCESS_KEY"); | |
| static String appName = "Calculator_android.apk"; | |
| public static void main(String[] args) throws IOException | |
| { | |
| File file = new File(UploadFileToSauceStorage.class.getResource("Calculator_android.apk").getFile()); | |
| SauceREST api = new SauceREST(SAUCE_USERNAME, SAUCE_ACCESS_KEY); | |
| String md5sum = api.uploadFile(file); | |
| System.out.println(md5sum); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import com.saucelabs.saucerest.SauceREST; | |
| import java.io.IOException; | |
| import java.io.InputStream; | |
| public class UploadStreamToSauceStorage | |
| { | |
| static String SAUCE_USERNAME = System.getenv("SAUCE_USERNAME"); | |
| static String SAUCE_ACCESS_KEY = System.getenv("SAUCE_ACCESS_KEY"); | |
| static String appName = "Calculator_android.apk"; | |
| public static void main(String[] args) throws IOException | |
| { | |
| InputStream stream = UploadStreamToSauceStorage.class.getResourceAsStream(appName); | |
| SauceREST api = new SauceREST(SAUCE_USERNAME, SAUCE_ACCESS_KEY); | |
| String md5sum = api.uploadFile(stream, appName, true); | |
| System.out.println(md5sum); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment