Class FileRenameParams
-
- All Implemented Interfaces:
-
io.imagekit.core.Params
public final class FileRenameParams implements Params
You can rename an already existing file in the media library using rename file API. This operation would rename all file versions of the file.
Note: The old URLs will stop working. The file/file version URLs cached on CDN will continue to work unless a purge is requested.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classFileRenameParams.BuilderA builder for FileRenameParams.
public final classFileRenameParams.Body
-
Method Summary
Modifier and Type Method Description final StringfilePath()The full path of the file you want to rename. final StringnewFileName()The new name of the file. final Optional<Boolean>purgeCache()Option to purge cache for the old file and its versions' URLs. final JsonField<String>_filePath()Returns the raw JSON value of filePath. final JsonField<String>_newFileName()Returns the raw JSON value of newFileName. final JsonField<Boolean>_purgeCache()Returns the raw JSON value of purgeCache. final Map<String, JsonValue>_additionalBodyProperties()final Headers_additionalHeaders()Additional headers to send with the request. final QueryParams_additionalQueryParams()Additional query param to send with the request. final FileRenameParams.BuildertoBuilder()final FileRenameParams.Body_body()Headers_headers()The full set of headers in the parameters, including both fixed and additional headers. QueryParams_queryParams()The full set of query params in the parameters, including both fixed and additional query params. Booleanequals(Object other)IntegerhashCode()StringtoString()final static FileRenameParams.Builderbuilder()Returns a mutable builder for constructing an instance of FileRenameParams. -
-
Method Detail
-
newFileName
final String newFileName()
The new name of the file. A filename can contain:
Alphanumeric Characters:
a-z,A-Z,0-9(including Unicode letters, marks, and numerals in other languages). Special Characters:.,_, and-.Any other character, including space, will be replaced by
_.
-
purgeCache
final Optional<Boolean> purgeCache()
Option to purge cache for the old file and its versions' URLs.
When set to true, it will internally issue a purge cache request on CDN to remove cached content of old file and its versions. This purge request is counted against your monthly purge quota.
Note: If the old file were accessible at
https://ik.imagekit.io/demo/old-filename.jpg, a purge cache request would be issued againsthttps://ik.imagekit.io/demo/old-filename.jpg*(with a wildcard at the end). It will remove the file and its versions' URLs and any transformations made using query parameters on this file or its versions. However, the cache for file transformations made using path parameters will persist. You can purge them using the purge API. For more details, refer to the purge API documentation.Default value -
false
-
_filePath
final JsonField<String> _filePath()
Returns the raw JSON value of filePath.
Unlike filePath, this method doesn't throw if the JSON field has an unexpected type.
-
_newFileName
final JsonField<String> _newFileName()
Returns the raw JSON value of newFileName.
Unlike newFileName, this method doesn't throw if the JSON field has an unexpected type.
-
_purgeCache
final JsonField<Boolean> _purgeCache()
Returns the raw JSON value of purgeCache.
Unlike purgeCache, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalBodyProperties
final Map<String, JsonValue> _additionalBodyProperties()
-
_additionalHeaders
final Headers _additionalHeaders()
Additional headers to send with the request.
-
_additionalQueryParams
final QueryParams _additionalQueryParams()
Additional query param to send with the request.
-
toBuilder
final FileRenameParams.Builder toBuilder()
-
_body
final FileRenameParams.Body _body()
-
_headers
Headers _headers()
The full set of headers in the parameters, including both fixed and additional headers.
-
_queryParams
QueryParams _queryParams()
The full set of query params in the parameters, including both fixed and additional query params.
-
builder
final static FileRenameParams.Builder builder()
Returns a mutable builder for constructing an instance of FileRenameParams.
The following fields are required:
.filePath() .newFileName()
-
-
-
-