Stay organized with collections
Save and categorize content based on your preferences.
AccessDeniedException
open class AccessDeniedException : FileSystemException
Checked exception thrown when a file system operation is denied, typically due to a file permission or other access check.
This exception is not related to the or SecurityException
thrown by access controllers or security managers when access to a file is denied.
Summary
Public constructors |
Constructs an instance of this class.
|
Constructs an instance of this class.
|
Public constructors
AccessDeniedException
AccessDeniedException(file: String!)
Constructs an instance of this class.
Parameters |
file |
String!: a string identifying the file or null if not known |
AccessDeniedException
AccessDeniedException(
file: String!,
other: String!,
reason: String!)
Constructs an instance of this class.
Parameters |
file |
String!: a string identifying the file or null if not known |
other |
String!: a string identifying the other file or null if not known |
reason |
String!: a reason message with additional information or null |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# AccessDeniedException\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nAccessDeniedException\n=====================\n\n```\nopen class AccessDeniedException : FileSystemException\n```\n\n|---|---|---|---|---|------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||||||\n| ↳ | [kotlin.Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html) |||||\n| | ↳ | [java.lang.Exception](../../lang/Exception.html#) ||||\n| | | ↳ | [java.io.IOException](../../io/IOException.html#) |||\n| | | | ↳ | [java.nio.file.FileSystemException](/reference/kotlin/java/nio/file/FileSystemException) ||\n| | | | | ↳ | [java.nio.file.AccessDeniedException](#) |\n\nChecked exception thrown when a file system operation is denied, typically due to a file permission or other access check.\n\nThis exception is not related to the or [SecurityException](../../lang/SecurityException.html#) thrown by access controllers or security managers when access to a file is denied.\n\nSummary\n-------\n\n| Public constructors ||\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [AccessDeniedException](#AccessDeniedException(kotlin.String))`(`file:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Constructs an instance of this class. |\n| [AccessDeniedException](#AccessDeniedException(kotlin.String,%20kotlin.String,%20kotlin.String))`(`file:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `other:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `reason:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Constructs an instance of this class. |\n\n| Inherited functions ||\n|---|---|\n| From class [FileSystemException](/reference/kotlin/java/nio/file/FileSystemException) |-----------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------| | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | [getFile](/reference/kotlin/java/nio/file/FileSystemException#getFile())`()` Returns the file used to create this exception. \u003cbr /\u003e | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | [getOtherFile](/reference/kotlin/java/nio/file/FileSystemException#getOtherFile())`()` Returns the other file used to create this exception. \u003cbr /\u003e | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | [getReason](/reference/kotlin/java/nio/file/FileSystemException#getReason())`()` Returns the string explaining why the file system operation failed. \u003cbr /\u003e | ||\n\n| Inherited properties ||\n|---|---|\n| From class [FileSystemException](/reference/kotlin/java/nio/file/FileSystemException) |-----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------| | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)? | [message](/reference/kotlin/java/nio/file/FileSystemException#message:kotlin.String) Returns the detail message string. \u003cbr /\u003e | ||\n\nPublic constructors\n-------------------\n\n### AccessDeniedException\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nAccessDeniedException(file: String!)\n```\n\nConstructs an instance of this class.\n\n| Parameters ||\n|--------|-----------------------------------------------------------------------------------------------------------------------------------------|\n| `file` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!: a string identifying the file or `null` if not known |\n\n### AccessDeniedException\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nAccessDeniedException(\n file: String!, \n other: String!, \n reason: String!)\n```\n\nConstructs an instance of this class.\n\n| Parameters ||\n|----------|-----------------------------------------------------------------------------------------------------------------------------------------------|\n| `file` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!: a string identifying the file or `null` if not known |\n| `other` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!: a string identifying the other file or `null` if not known |\n| `reason` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!: a reason message with additional information or `null` |"]]