stacycurl / pimpathon

Adds useful methods to scala & java classes.
Apache License 2.0
35 stars 9 forks source link

File.parents #182

Closed fommil closed 9 years ago

fommil commented 9 years ago
  def parents(f: File): List[File] = {
    val parent = f.getParentFile()
    if (parent == null) Nil
    else parent :: parents(parent)
  }
fommil commented 9 years ago

oh, actually you have this as ancestors but it is private. Consider making public?

fommil commented 9 years ago

isAncestorOf would also be quite handy.

I'm also trying to convince if contains should return false for a contains a