Class NormalizedFile

java.lang.Object
java.io.File
jnr.posix.JavaSecuredFile
org.jruby.util.NormalizedFile
All Implemented Interfaces:
Serializable, Comparable<File>

public class NormalizedFile extends jnr.posix.JavaSecuredFile
This class provides a File implementation that normalizes all path separators to forward slashes. This mimics the behavior of C Ruby, where all paths are internally made UNIX-style, even on Windows.
See Also:
  • Constructor Details

    • NormalizedFile

      public NormalizedFile(String pathname)
    • NormalizedFile

      public NormalizedFile(URI uri)
    • NormalizedFile

      public NormalizedFile(File parent, String child)
    • NormalizedFile

      public NormalizedFile(String parent, String child)
  • Method Details

    • getAbsolutePath

      public String getAbsolutePath()
      Overrides:
      getAbsolutePath in class File
    • getCanonicalPath

      public String getCanonicalPath() throws IOException
      Overrides:
      getCanonicalPath in class jnr.posix.JavaSecuredFile
      Throws:
      IOException
    • getPath

      public String getPath()
      Overrides:
      getPath in class File
    • toString

      public String toString()
      Overrides:
      toString in class File
    • getAbsoluteFile

      public File getAbsoluteFile()
      Overrides:
      getAbsoluteFile in class jnr.posix.JavaSecuredFile
    • getCanonicalFile

      public File getCanonicalFile() throws IOException
      Overrides:
      getCanonicalFile in class jnr.posix.JavaSecuredFile
      Throws:
      IOException
    • getParent

      public String getParent()
      Overrides:
      getParent in class File
    • getParentFile

      public File getParentFile()
      Overrides:
      getParentFile in class jnr.posix.JavaSecuredFile
    • listRoots

      public static File[] listRoots()
    • createTempFile

      public static File createTempFile(String prefix, String suffix, File directory) throws IOException
      Throws:
      IOException
    • createTempFile

      public static File createTempFile(String prefix, String suffix) throws IOException
      Throws:
      IOException
    • list

      public String[] list()
      Overrides:
      list in class jnr.posix.JavaSecuredFile
    • list

      public String[] list(FilenameFilter filter)
      Overrides:
      list in class jnr.posix.JavaSecuredFile
    • listFiles

      public File[] listFiles()
      Overrides:
      listFiles in class jnr.posix.JavaSecuredFile
    • listFiles

      public File[] listFiles(FileFilter filter)
      Overrides:
      listFiles in class jnr.posix.JavaSecuredFile
    • listFiles

      public File[] listFiles(FilenameFilter filter)
      Overrides:
      listFiles in class File
    • getFileProperty

      public static String getFileProperty(String property)