org.jruby.util
Class NormalizedFile

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

public class NormalizedFile
extends org.jruby.ext.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:
Serialized Form

Field Summary
 
Fields inherited from class java.io.File
pathSeparator, pathSeparatorChar, separator, separatorChar
 
Constructor Summary
NormalizedFile(java.io.File parent, java.lang.String child)
           
NormalizedFile(java.lang.String pathname)
           
NormalizedFile(java.lang.String parent, java.lang.String child)
           
NormalizedFile(java.net.URI uri)
           
 
Method Summary
static java.io.File createTempFile(java.lang.String prefix, java.lang.String suffix)
           
static java.io.File createTempFile(java.lang.String prefix, java.lang.String suffix, java.io.File directory)
           
 java.io.File getAbsoluteFile()
           
 java.lang.String getAbsolutePath()
           
 java.io.File getCanonicalFile()
           
 java.lang.String getCanonicalPath()
           
static java.lang.String getFileProperty(java.lang.String property)
           
 java.lang.String getParent()
           
 java.io.File getParentFile()
           
 java.lang.String getPath()
           
 java.lang.String[] list()
           
 java.lang.String[] list(java.io.FilenameFilter filter)
           
 java.io.File[] listFiles()
           
 java.io.File[] listFiles(java.io.FileFilter filter)
           
 java.io.File[] listFiles(java.io.FilenameFilter filter)
           
static java.io.File[] listRoots()
           
 java.lang.String toString()
           
 
Methods inherited from class org.jruby.ext.posix.JavaSecuredFile
canRead, canWrite, createNewFile, delete, exists, isDirectory, isFile, isHidden, lastModified, length, mkdir, mkdirs, renameTo, setLastModified, setReadOnly
 
Methods inherited from class java.io.File
canExecute, compareTo, deleteOnExit, equals, getFreeSpace, getName, getTotalSpace, getUsableSpace, hashCode, isAbsolute, setExecutable, setExecutable, setReadable, setReadable, setWritable, setWritable, toURI, toURL
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NormalizedFile

public NormalizedFile(java.lang.String pathname)

NormalizedFile

public NormalizedFile(java.net.URI uri)

NormalizedFile

public NormalizedFile(java.io.File parent,
                      java.lang.String child)

NormalizedFile

public NormalizedFile(java.lang.String parent,
                      java.lang.String child)
Method Detail

getAbsolutePath

public java.lang.String getAbsolutePath()
Overrides:
getAbsolutePath in class java.io.File

getCanonicalPath

public java.lang.String getCanonicalPath()
                                  throws java.io.IOException
Overrides:
getCanonicalPath in class org.jruby.ext.posix.JavaSecuredFile
Throws:
java.io.IOException

getPath

public java.lang.String getPath()
Overrides:
getPath in class java.io.File

toString

public java.lang.String toString()
Overrides:
toString in class java.io.File

getAbsoluteFile

public java.io.File getAbsoluteFile()
Overrides:
getAbsoluteFile in class org.jruby.ext.posix.JavaSecuredFile

getCanonicalFile

public java.io.File getCanonicalFile()
                              throws java.io.IOException
Overrides:
getCanonicalFile in class org.jruby.ext.posix.JavaSecuredFile
Throws:
java.io.IOException

getParent

public java.lang.String getParent()
Overrides:
getParent in class java.io.File

getParentFile

public java.io.File getParentFile()
Overrides:
getParentFile in class org.jruby.ext.posix.JavaSecuredFile

listRoots

public static java.io.File[] listRoots()

createTempFile

public static java.io.File createTempFile(java.lang.String prefix,
                                          java.lang.String suffix,
                                          java.io.File directory)
                                   throws java.io.IOException
Throws:
java.io.IOException

createTempFile

public static java.io.File createTempFile(java.lang.String prefix,
                                          java.lang.String suffix)
                                   throws java.io.IOException
Throws:
java.io.IOException

list

public java.lang.String[] list()
Overrides:
list in class org.jruby.ext.posix.JavaSecuredFile

list

public java.lang.String[] list(java.io.FilenameFilter filter)
Overrides:
list in class org.jruby.ext.posix.JavaSecuredFile

listFiles

public java.io.File[] listFiles()
Overrides:
listFiles in class org.jruby.ext.posix.JavaSecuredFile

listFiles

public java.io.File[] listFiles(java.io.FileFilter filter)
Overrides:
listFiles in class org.jruby.ext.posix.JavaSecuredFile

listFiles

public java.io.File[] listFiles(java.io.FilenameFilter filter)
Overrides:
listFiles in class org.jruby.ext.posix.JavaSecuredFile

getFileProperty

public static java.lang.String getFileProperty(java.lang.String property)


Copyright © 2002-2009 JRuby Team. All Rights Reserved.