[android-components](../../index.md) / [mozilla.components.support.utils](../index.md) / [DownloadUtils](index.md) / [uniqueFileName](./unique-file-name.md)

# uniqueFileName

`fun uniqueFileName(directory: `[`File`](https://developer.android.com/reference/java/io/File.html)`, fileName: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) [(source)](https://github.com/mozilla-mobile/android-components/blob/master/components/support/utils/src/main/java/mozilla/components/support/utils/DownloadUtils.kt#L72)

Checks if the file exists so as not to overwrite one already in the destination directory

