Class SrcOptions
-
- All Implemented Interfaces:
public final class SrcOptionsOptions for generating ImageKit URLs with transformations. See the Transformations guide.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classSrcOptions.BuilderA builder for SrcOptions.
public final classSrcOptions.QueryParametersThese are additional query parameters that you want to add to the final URL. They can be any query parameters and not necessarily related to ImageKit. This is especially useful if you want to add a versioning parameter to your URLs.
-
Method Summary
Modifier and Type Method Description final Stringsrc()Accepts a relative or absolute path of the resource. final StringurlEndpoint()Get your urlEndpoint from the ImageKit dashboard. final Optional<Double>expiresIn()When you want the signed URL to expire, specified in seconds. final Optional<SrcOptions.QueryParameters>queryParameters()These are additional query parameters that you want to add to the final URL. final Optional<Boolean>signed()Whether to sign the URL or not. final Optional<List<Transformation>>transformation()An array of objects specifying the transformations to be applied in the URL. final Optional<TransformationPosition>transformationPosition()By default, the transformation string is added as a query parameter in the URL, e.g. final JsonField<String>_src()Returns the raw JSON value of src. final JsonField<String>_urlEndpoint()Returns the raw JSON value of urlEndpoint. final JsonField<Double>_expiresIn()Returns the raw JSON value of expiresIn. final JsonField<SrcOptions.QueryParameters>_queryParameters()Returns the raw JSON value of queryParameters. final JsonField<Boolean>_signed()Returns the raw JSON value of signed. final JsonField<List<Transformation>>_transformation()Returns the raw JSON value of transformation. final JsonField<TransformationPosition>_transformationPosition()Returns the raw JSON value of transformationPosition. final Map<String, JsonValue>_additionalProperties()final SrcOptions.BuildertoBuilder()final SrcOptionsvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static SrcOptions.Builderbuilder()Returns a mutable builder for constructing an instance of SrcOptions. -
-
Method Detail
-
src
final String src()
Accepts a relative or absolute path of the resource. If a relative path is provided, it is appended to the
urlEndpoint. If an absolute path is provided,urlEndpointis ignored.
-
urlEndpoint
final String urlEndpoint()
Get your urlEndpoint from the ImageKit dashboard.
-
expiresIn
final Optional<Double> expiresIn()
When you want the signed URL to expire, specified in seconds. If
expiresInis anything above 0, the URL will always be signed even ifsignedis set to false. If not specified andsignedistrue, the signed URL will not expire (valid indefinitely).Example: Setting
expiresIn: 3600will make the URL expire 1 hour from generation time. After the expiry time, the signed URL will no longer be valid and ImageKit will return a 401 Unauthorized status code.
-
queryParameters
final Optional<SrcOptions.QueryParameters> queryParameters()
These are additional query parameters that you want to add to the final URL. They can be any query parameters and not necessarily related to ImageKit. This is especially useful if you want to add a versioning parameter to your URLs.
-
signed
final Optional<Boolean> signed()
Whether to sign the URL or not. Set this to
trueif you want to generate a signed URL. IfsignedistrueandexpiresInis not specified, the signed URL will not expire (valid indefinitely). Note: IfexpiresInis set to any value above 0, the URL will always be signed regardless of this setting. Learn more.
-
transformation
final Optional<List<Transformation>> transformation()
An array of objects specifying the transformations to be applied in the URL. If more than one transformation is specified, they are applied in the order they are specified as chained transformations. See Chained transformations.
-
transformationPosition
final Optional<TransformationPosition> transformationPosition()
By default, the transformation string is added as a query parameter in the URL, e.g.,
?tr=w-100,h-100. If you want to add the transformation string in the path of the URL, set this topath. Learn more in the Transformations guide.
-
_src
final JsonField<String> _src()
Returns the raw JSON value of src.
Unlike src, this method doesn't throw if the JSON field has an unexpected type.
-
_urlEndpoint
final JsonField<String> _urlEndpoint()
Returns the raw JSON value of urlEndpoint.
Unlike urlEndpoint, this method doesn't throw if the JSON field has an unexpected type.
-
_expiresIn
final JsonField<Double> _expiresIn()
Returns the raw JSON value of expiresIn.
Unlike expiresIn, this method doesn't throw if the JSON field has an unexpected type.
-
_queryParameters
final JsonField<SrcOptions.QueryParameters> _queryParameters()
Returns the raw JSON value of queryParameters.
Unlike queryParameters, this method doesn't throw if the JSON field has an unexpected type.
-
_signed
final JsonField<Boolean> _signed()
Returns the raw JSON value of signed.
Unlike signed, this method doesn't throw if the JSON field has an unexpected type.
-
_transformation
final JsonField<List<Transformation>> _transformation()
Returns the raw JSON value of transformation.
Unlike transformation, this method doesn't throw if the JSON field has an unexpected type.
-
_transformationPosition
final JsonField<TransformationPosition> _transformationPosition()
Returns the raw JSON value of transformationPosition.
Unlike transformationPosition, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final SrcOptions.Builder toBuilder()
-
validate
final SrcOptions validate()
Validates that the types of all values in this object match their expected types recursively.
This method is not forwards compatible with new types from the API for existing fields.
-
builder
final static SrcOptions.Builder builder()
Returns a mutable builder for constructing an instance of SrcOptions.
The following fields are required:
.src() .urlEndpoint()
-
-
-
-