# UriKt

Added in 1.1.0

*** ** * ** ***


```
public final class UriKt
```

<br />

*** ** * ** ***

## Summary

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/File.html` | `https://developer.android.com/reference/androidx/core/net/UriKt#(android.net.Uri).toFile()(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/net/Uri.html receiver)` Creates a `https://developer.android.com/reference/java/io/File.html` from the given `https://developer.android.com/reference/android/net/Uri.html`. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/net/Uri.html` | `https://developer.android.com/reference/androidx/core/net/UriKt#(java.io.File).toUri()(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/File.html receiver)` Creates a Uri from the given file. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/net/Uri.html` | `https://developer.android.com/reference/androidx/core/net/UriKt#(kotlin.String).toUri()(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html receiver)` Creates a Uri from the given encoded URI string. |

## Public methods

### toFile

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/net/Uri.kt+function:toFile) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull File toFile(@NonNull Uri receiver)
```

Creates a `https://developer.android.com/reference/java/io/File.html` from the given `https://developer.android.com/reference/android/net/Uri.html`. Note that this will throw an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` when invoked on a `https://developer.android.com/reference/android/net/Uri.html` that lacks `file` scheme.

### toUri

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/net/Uri.kt+function:toUri) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull Uri toUri(@NonNull File receiver)
```

Creates a Uri from the given file.

| See also |
|---|---|
| `https://developer.android.com/reference/android/net/Uri.html#fromFile(java.io.File)` |   |

### toUri

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/net/Uri.kt+function:toUri) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull Uri toUri(@NonNull String receiver)
```

Creates a Uri from the given encoded URI string.

| See also |
|---|---|
| `https://developer.android.com/reference/android/net/Uri.html#parse(java.lang.String)` |   |