Skip to content

Commit

Permalink
update README.md and FileX_methods.tgn
Browse files Browse the repository at this point in the history
  • Loading branch information
sayantan-kgp committed Mar 8, 2021
1 parent 5991c88 commit 0c6b73d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ This creates a `FileXT` object i.e. with `isTraditional` = true even though the
| deleteOnExit() | - | FileXT<br>(`isTraditional`<br>=true) | Requests that the file or directory denoted by this abstract pathname be deleted when the virtual machine terminates.<br>Same as `java.io.File.deleteOnExit()` |
| createNewFile() | Boolean | - | Creates document referred to by the FileX object. Throws error if the whole directory path is not present.<br>A safer alternative is a new variant of the method described below. |
| createNewFile(<br> makeDirectories:Boolean=false, <br> overwriteIfExists:Boolean=false, <br> optionalMimeType:String<br>) | Boolean | - | Create a document.<br>If `makeDirectories` = true (Default: false) -> Creates the whole directory tree before the document if not present.<br>If `overwriteIfExist` = true (Default: false) -> Deletes the document if already present and creates a blank document.<br>For `FileX11`:<br>`optionalMimeType` as string can be specified. Ignored for `FileXT`<br><br>Returns true, if document creation is successful. |
| createFileUsingPicker(<br> optionalMimeType: String,<br> afterJob:<br> ((resultCode: Int, data: Intent?)<br>) | - | FileX11<br>(`isTraditional`<br>=false) | Invoke the System file picker to create the file. Only applicable on `FileX11`<br><br>mime type can be spcified in `optionalMimeType`<br>`afterJob()` - custom function can be passed to execute after document is created.<br> `resultCode` = `Activity.RESULT_OK` if document is successfully created.<br> `data` = Intent data returned by System after document creation. |
| createFileUsingPicker(<br> optionalMimeType: String,<br> afterJob:<br> (resultCode: Int, data: Intent?)<br>) | - | FileX11<br>(`isTraditional`<br>=false) | Invoke the System file picker to create the file. Only applicable on `FileX11`<br><br>mime type can be spcified in `optionalMimeType`<br>`afterJob()` - custom function can be passed to execute after document is created.<br> `resultCode` = `Activity.RESULT_OK` if document is successfully created.<br> `data` = Intent data returned by System after document creation. |
| mkdirs() | Boolean | - | Make all directories specified by the path of the FileX object (including the last element of the path and other non-existing parent directories.). |
| mkdir() | Boolean | - | Creates only the last element of the path as a directory. Parent directories must be already present. |
| renameTo(dest: FileX) | Boolean | - | Move the current document to the path mentioned by the FileX parameter `dest`<br>For `FileX11` this only works for Android 7+ (API 24) due to Android limitations. |
Expand All @@ -167,3 +167,5 @@ This creates a `FileXT` object i.e. with `isTraditional` = true even though the
| listFiles() | Array-FileX? | - | Returns an array of FileX pointing to all the contents of a directory. |
| listFiles(filter: FileXFilter) | Array-FileX? | - | Returns FileX elements array filtering with a `FileXFilter`. |
| listFiles(filter: FileXNameFilter) | Array-FileX? | - | Returns FileX elements array filtering with a `FileXNameFilter`. |
| copyTo(<br> target:FileX,<br> overwrite:Boolean=false,<br> bufferSize:Int<br>) | FileX | - | Copies a file and returns the target. Logic is completely copied from File.copyTo() of kotlin.io. |
| copyRecursively(<br> target:FileX,<br> overwrite:Boolean=false,<br> onError:<br> (FileX, Exception)<br>) | Boolean | - | Directory copy recursively, return true if success else false.<br>Logic is completely copied from File.copyRecursively() of kotlin.io. |
Loading

0 comments on commit 0c6b73d

Please sign in to comment.