-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
201 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
@file:Isolated | ||
|
||
package taboolib.common.io | ||
|
||
import taboolib.common.Isolated | ||
import java.io.File | ||
import java.util.concurrent.Executors | ||
import java.util.concurrent.Future | ||
|
||
/** | ||
* 删除特定文件夹下的所有子文件 | ||
*/ | ||
fun File.deepDelete() { | ||
if (exists()) { | ||
if (isDirectory) { | ||
listFiles()?.forEach { it.deepDelete() } | ||
} | ||
delete() | ||
} | ||
} | ||
|
||
/** | ||
* 复制文件或文件夹 | ||
* 若目标为文件夹则复制其所有子文件 | ||
*/ | ||
fun File.deepCopyTo(target: File) { | ||
if (isDirectory) { | ||
listFiles()?.forEach { it.deepCopyTo(File(target, it.name)) } | ||
} else { | ||
copyTo(target) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 5 additions & 1 deletion
6
common/src/main/kotlin/taboolib/common/platform/function/Event.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
@file:Isolated | ||
@file:Suppress("NOTHING_TO_INLINE") | ||
|
||
package taboolib.common.platform.function | ||
|
||
import taboolib.common.Isolated | ||
import taboolib.common.platform.PlatformFactory | ||
import taboolib.common.platform.event.ProxyEvent | ||
import taboolib.common.platform.service.PlatformEvent | ||
|
||
fun callEvent(proxyEvent: ProxyEvent) { | ||
inline fun callEvent(proxyEvent: ProxyEvent) { | ||
PlatformFactory.getService<PlatformEvent>().callEvent(proxyEvent) | ||
} |
Oops, something went wrong.