Skip to content

Commit

Permalink
Merge pull request #154 from dwestheide/remove-use-of-deprecated-modi…
Browse files Browse the repository at this point in the history
…fied-time-methods

Remove use of deprecated *ModifiedTime methods
  • Loading branch information
dwijnand authored May 23, 2018
2 parents a461a51 + aa1b48e commit 0b1c1b0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions io/src/main/scala/sbt/io/IO.scala
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ object IO {
val created = translate("Could not create file " + absFile) { absFile.createNewFile() }
if (created || absFile.isDirectory)
()
else if (setModified)
setModifiedTime(absFile, System.currentTimeMillis) // will throw exception if it cannot set the timestamp
else if (setModified && !setModifiedTimeOrFalse(absFile, System.currentTimeMillis))
sys.error("Could not update last modified time for file " + absFile)
}

/** Creates directories `dirs` and all parent directories. It tries to work around a race condition in `File.mkdirs()` by retrying up to a limit.*/
Expand Down Expand Up @@ -1209,7 +1209,7 @@ object IO {
*/
def getModifiedTimeOrZero(file: File): Long =
try {
getModifiedTime(file)
Milli.getModifiedTime(file)
} catch {
case _: FileNotFoundException => 0L
}
Expand Down

0 comments on commit 0b1c1b0

Please sign in to comment.