com.google.appengine.api.images.dev
Class LocalBlobImageServlet.ParsedUrl
- java.lang.Object
-
- com.google.appengine.api.images.dev.LocalBlobImageServlet.ParsedUrl
-
- Enclosing class:
- LocalBlobImageServlet
protected static class LocalBlobImageServlet.ParsedUrl extends java.lang.ObjectUtility class to parse a Local URL into its component parts. The Local url format is as follows: /_ah/img/SomeValidBlobKey[=options] where options is either "sX" where X is from ParsedUrl.uncroppedSizes or "sX-c" where X is from ParsedUrl.croppedSizes.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description protected static LocalBlobImageServlet.ParsedUrlcreateParsedUrl(java.lang.String requestUri)Creates aParsedUrlinstance from the given URL.java.lang.StringgetBlobKey()Returns the parsed BlobKey.booleangetCrop()Returns the crop option.intgetResize()Returns the resize option.booleanhasOptions()Checks if the parsed url has options.protected voidparse(java.lang.String requestUri)Parses a Local URL to its component parts.protected voidparseOptions()Parses URL options to its component parts.
-
-
-
Method Detail
-
hasOptions
public boolean hasOptions()
Checks if the parsed url has options.
-
getBlobKey
public java.lang.String getBlobKey()
Returns the parsed BlobKey.
-
getResize
public int getResize()
Returns the resize option. Only valid if hasOption() istrue.
-
getCrop
public boolean getCrop()
Returns the crop option. Only valid if hasOption() istrue.
-
createParsedUrl
protected static LocalBlobImageServlet.ParsedUrl createParsedUrl(java.lang.String requestUri)
Creates aParsedUrlinstance from the given URL.- Parameters:
requestUri- the requested URL- Returns:
- an instance
-
parse
protected void parse(java.lang.String requestUri)
Parses a Local URL to its component parts.- Parameters:
requestUri- the Local request URL- Throws:
java.lang.IllegalArgumentException- for malformed URLs
-
parseOptions
protected void parseOptions()
Parses URL options to its component parts.- Throws:
java.lang.IllegalArgumentException- for malformed options
-
-