-
Notifications
You must be signed in to change notification settings - Fork 2
added servlets for IMG pt2 #80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget to run the java formatter!
for (BlobKey blobK : blobKeys) { | ||
ServingUrlOptions options = ServingUrlOptions.Builder.withBlobKey(blobK); | ||
try { | ||
// getting the image URL to the uploaded file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Capitalize the first letter of your comments.
// Getting the image URL to the uploaded file
System.out.printf("[%s] seems to be an image, url is %s%n", blobK, imageUrl); | ||
imageBlobUrls.add(imageUrl); | ||
} catch (java.lang.IllegalArgumentException exception) { | ||
// not image file -> do not add to list, remove from Blobstore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto here
// not image file -> do not add to list, remove from Blobstore | ||
System.out.printf("[%s] IllegalArgumentException: %s%n", blobK, exception.getMessage()); | ||
try { | ||
System.out.printf("I am deleting this thing I don't believe is an image: [%s]%n", blobK); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logs should use Logger and not System.out.printf. See https://cloud.google.com/appengine/docs/standard/java/logs/
imageBlobUrls.add(imageUrl); | ||
} catch (java.lang.IllegalArgumentException exception) { | ||
// not image file -> do not add to list, remove from Blobstore | ||
System.out.printf("[%s] IllegalArgumentException: %s%n", blobK, exception.getMessage()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logs should use Logger and not System.out.printf. See https://cloud.google.com/appengine/docs/standard/java/logs/
try { | ||
// getting the image URL to the uploaded file | ||
String imageUrl = imagesService.getServingUrl(options); | ||
System.out.printf("[%s] seems to be an image, url is %s%n", blobK, imageUrl); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logs should use Logger and not System.out.printf. See https://cloud.google.com/appengine/docs/standard/java/logs/
System.out.printf("[%s] seems to be an image, url is %s%n", blobK, imageUrl); | ||
imageBlobUrls.add(imageUrl); | ||
} catch (java.lang.IllegalArgumentException exception) { | ||
// not image file -> do not add to list, remove from Blobstore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
capitalize first letter of comment.
// User submitted form without selecting a file, so we can't get a URL. | ||
// (devserver) | ||
if (blobKeys == null || blobKeys.isEmpty()) { | ||
System.out.printf( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logs should use Logger and not System.out.printf. See https://cloud.google.com/appengine/docs/standard/java/logs/
// not image file -> do not add to list, remove from Blobstore | ||
System.out.printf("[%s] IllegalArgumentException: %s%n", blobK, exception.getMessage()); | ||
try { | ||
System.out.printf("I am deleting this thing I don't believe is an image: [%s]%n", blobK); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logs should use Logger and not System.out.printf. See https://cloud.google.com/appengine/docs/standard/java/logs/
System.out.printf("I am deleting this thing I don't believe is an image: [%s]%n", blobK); | ||
blobstoreService.delete(blobK); | ||
} catch (Exception e) { | ||
System.out.printf("exception when deleting: %s%n", e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logs should use Logger and not System.out.printf. See https://cloud.google.com/appengine/docs/standard/java/logs/
response.sendRedirect("/user-page.html?user=" + user); | ||
} | ||
|
||
/** should send a get request to display img in url. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change comment to:
/** Sends a get request to display image in URL. */
Added the preliminary steps to complete images Part 2
Issue:#34
PR:#80