aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsinofp2021-06-05 00:39:15 +0800
committersinofp2021-06-05 13:50:42 +0800
commit58c6479f9d26a7ca80f33e5d57ce489ce8c899f8 (patch)
tree5cb435d5a665992678675dca2598a0957a1e6a3e /src
parentf0b381eb5bb545455aeb295ec9d71bbb59c955a9 (diff)
Add deprecation annotation in FileUtils
Diffstat (limited to 'src')
-rw-r--r--src/main/scala/firrtl/FileUtils.scala9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main/scala/firrtl/FileUtils.scala b/src/main/scala/firrtl/FileUtils.scala
index 3668b374..5f825a38 100644
--- a/src/main/scala/firrtl/FileUtils.scala
+++ b/src/main/scala/firrtl/FileUtils.scala
@@ -46,9 +46,10 @@ object FileUtils {
/**
* recursively delete all directories in a relative path
* DO NOT DELETE absolute paths
- * @todo deprecate java.io.File
+ *
* @param file: a directory hierarchy to delete
*/
+ @deprecated("Use os-lib instead, this function will be removed in FIRRTL 1.6", "FIRRTL 1.5")
def deleteDirectoryHierarchy(file: java.io.File, atTop: Boolean = true): Boolean = {
if (
file.getPath.split("/").last.isEmpty ||
@@ -118,9 +119,10 @@ object FileUtils {
/** Read a text file and return it as a Seq of strings
* Closes the file after read to avoid dangling file handles
- * @todo deprecate java.io.File
+ *
* @param file a java File to be read
*/
+ @deprecated("Use os-lib instead, this function will be removed in FIRRTL 1.6", "FIRRTL 1.5")
def getLines(file: java.io.File): Seq[String] = {
val source = scala.io.Source.fromFile(file)
val lines = source.getLines().toList
@@ -144,9 +146,10 @@ object FileUtils {
/** Read a text file and return it as a single string
* Closes the file after read to avoid dangling file handles
- * @todo deprecate java.io.File
+ *
* @param file a java File to be read
*/
+ @deprecated("Use os-lib instead, this function will be removed in FIRRTL 1.6", "FIRRTL 1.5")
def getText(file: java.io.File): String = {
val source = scala.io.Source.fromFile(file)
val text = source.mkString