Skip to content

Commit

Permalink
FileOps: remove unused methods
Browse files Browse the repository at this point in the history
  • Loading branch information
kitbellew committed Feb 3, 2025
1 parent d3b3e67 commit 2d1d281
Showing 1 changed file with 0 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,9 @@ object FileOps {

val defaultConfigFileName = ".scalafmt.conf"

def getLastModifiedMsec(file: Path): Long = {
val attributes = getAttributesNoLinks(file)
val mtime = attributes.lastModifiedTime().toMillis
if (attributes.isSymbolicLink) math
.max(mtime, Files.getLastModifiedTime(file).toMillis)
else mtime
}

@inline
def getLastModifiedMsecNoLinks(file: Path): Long = Files
.getLastModifiedTime(file, LinkOption.NOFOLLOW_LINKS).toMillis

@inline
def isDirectory(file: Path): Boolean = Files.isDirectory(file)

@inline
def isDirectoryNoLinks(file: Path): Boolean = Files
.isDirectory(file, LinkOption.NOFOLLOW_LINKS)

@inline
def isRegularFile(file: Path): Boolean = Files.isRegularFile(file)

Expand All @@ -49,14 +33,6 @@ object FileOps {
def getAttributes(file: Path): BasicFileAttributes = Files
.readAttributes(file, classOf[BasicFileAttributes])

@inline
def getAttributesNoLinks(file: Path): BasicFileAttributes = Files
.readAttributes(
file,
classOf[BasicFileAttributes],
LinkOption.NOFOLLOW_LINKS,
)

def listFiles(path: String): Seq[Path] = listFiles(getFile(path))

def listFiles(file: Path): Seq[Path] =
Expand Down

0 comments on commit 2d1d281

Please sign in to comment.