Successfully Submitted!
') 21 | }, 22 | error: function (data) { 23 | $("#submit_message").remove(); 24 | console.log(data.responseText); 25 | var json = $.parseJSON(data.responseText); 26 | var message = json["message"]; 27 | 28 | if (json["statusCode"] / 100 == 5) 29 | message = (message == null) ? "There is some problem at server side. Please contact developers." : message; 30 | 31 | frm.append('Error: ' + message + '
') 32 | console.log(json); 33 | } 34 | }); 35 | } 36 | return false; 37 | }); 38 | -------------------------------------------------------------------------------- /src/main/java/com/github/dhaval_mehta/savetogoogledrive/model/UploadInformation.java: -------------------------------------------------------------------------------- 1 | package com.github.dhaval_mehta.savetogoogledrive.model; 2 | 3 | public class UploadInformation { 4 | 5 | private String url; 6 | private String fileName; 7 | private long totalSize; 8 | private long uploadedSize; 9 | private String errorMessage; 10 | private UploadStatus uploadStatus; 11 | private double speed; 12 | 13 | public String getUrl() { 14 | return url; 15 | } 16 | 17 | public void setUrl(String url) { 18 | this.url = url; 19 | } 20 | 21 | public String getFileName() { 22 | return fileName; 23 | } 24 | 25 | public void setFileName(String fileName) { 26 | this.fileName = fileName; 27 | } 28 | 29 | public long getUploadedSize() { 30 | return uploadedSize; 31 | } 32 | 33 | public void setUploadedSize(long uploadedSize) { 34 | this.uploadedSize = uploadedSize; 35 | } 36 | 37 | public long getTotalSize() { 38 | return totalSize; 39 | } 40 | 41 | public void setTotalSize(long totalSize) { 42 | this.totalSize = totalSize; 43 | } 44 | 45 | public UploadStatus getUploadStatus() { 46 | return uploadStatus; 47 | } 48 | 49 | public void setUploadStatus(UploadStatus uploadStatus) { 50 | this.uploadStatus = uploadStatus; 51 | } 52 | 53 | public double getSpeed() { 54 | return speed; 55 | } 56 | 57 | public void setSpeed(double speed) { 58 | this.speed = speed; 59 | } 60 | 61 | public String getErrorMessage() { 62 | return errorMessage; 63 | } 64 | 65 | public void setErrorMessage(String errorMessage) { 66 | this.errorMessage = errorMessage; 67 | } 68 | 69 | } -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Contributing 2 | ---------------------------------- 3 | 4 | 1. File an issue to notify the maintainers about what you're working on. 5 | 2. Fork the repo, develop and test your code changes, add docs. 6 | 3. Make sure that your commit messages clearly describe the changes. 7 | 4. Send a pull request. 8 | 9 | File an Issue 10 | ---------------------------------- 11 | 12 | Use the issue tracker to start the discussion. It is possible that someone 13 | else is already working on your idea, your approach is not quite right, or that 14 | the functionality exists already. The ticket you file in the issue tracker will 15 | be used to hash that all out. 16 | 17 | Style Guides 18 | ------------------- 19 | 1. Write in UTF-8. 20 | 2. User modular architecture to group similar functions, classes, etc. 21 | 3. Always use 4 spaces for indentation (don't use tabs) 22 | 4. Try to limit line length to 80 characters 23 | 5. Class names should always be capitalized 24 | 6. Function names should always be lowercase 25 | 7. Look at the existing style and adhere accordingly 26 | 27 | Fork the Repository 28 | ------------------- 29 | 30 | Be sure to add the relevant tests before making the pull request. 31 | You should also build the proper docs. 32 | 33 | Make the Pull Request 34 | --------------------- 35 | 36 | Once you have made all your changes, tests, and updated the documentation, 37 | make a pull request to move everything back into the main branch of the 38 | `repository`. Be sure to reference the original issue in the pull request. 39 | Expect some back-and-forth with regards to style and compliance of these 40 | rules. 41 | -------------------------------------------------------------------------------- /src/main/java/com/github/dhaval_mehta/savetogoogledrive/advice/WebRestControllerAdvice.java: -------------------------------------------------------------------------------- 1 | package com.github.dhaval_mehta.savetogoogledrive.advice; 2 | 3 | import java.util.logging.Level; 4 | import java.util.logging.Logger; 5 | 6 | import com.github.dhaval_mehta.savetogoogledrive.exception.ApiException; 7 | import com.github.dhaval_mehta.savetogoogledrive.model.ApiError; 8 | import org.springframework.http.HttpStatus; 9 | import org.springframework.http.ResponseEntity; 10 | import org.springframework.web.HttpRequestMethodNotSupportedException; 11 | import org.springframework.web.bind.annotation.ControllerAdvice; 12 | import org.springframework.web.bind.annotation.ExceptionHandler; 13 | 14 | @ControllerAdvice 15 | public class WebRestControllerAdvice { 16 | 17 | @ExceptionHandler(ApiException.class) 18 | public ResponseEntityYou are not authenticated. Please authenticate with Google.
21 | 24 |Hi,
Congratulations! You are successfully authenticated with Google
28 | using your Google account: