Project Wonder 2.0

er.extensions
Class ERXFile

java.lang.Object
  extended byjava.io.File
      extended byer.extensions.ERXFile
All Implemented Interfaces:
Comparable, Serializable

public class ERXFile
extends File

Author:
david teran This class fixes some inconsistencies with java.io.File on MacOS X HFS+ filesystem The following code does not work as expected: File f = new File("/tmp/FilenameWithSpecialCharacter€…†"); f.createNewFile(); File tmp = new File("/tmp"); File[] contents = tmp.listFiles(); for (int i = 0; i < contents.length; i++) { if (contents[i].getName().equals("FilenameWithSpecialCharacter€…†")) { System.out.println("found it!"); } } One would expect that the comparision contents[i].getName().equals("FilenameWithSpecialCharacter€…†") would result to true. This is not the case, at least not on HFS+ This subclass fixes this and should be used instead of java.io.File.
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.io.File
pathSeparator, pathSeparatorChar, separator, separatorChar
 
Constructor Summary
ERXFile(File arg0, String arg1)
           
ERXFile(String arg0)
           
ERXFile(String arg0, String arg1)
           
ERXFile(URI arg0)
           
 
Method Summary
 File getAbsoluteFile()
           
 String getAbsolutePath()
           
 File getCanonicalFile()
           
 String getName()
           
 File getParentFile()
           
 String[] list()
           
 String[] list(FilenameFilter arg0)
           
 File[] listFiles()
           
 File[] listFiles(FileFilter arg0)
           
 File[] listFiles(FilenameFilter arg0)
           
 String toString()
           
 
Methods inherited from class java.io.File
canRead, canWrite, compareTo, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, exists, getCanonicalPath, getParent, getPath, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, listRoots, mkdir, mkdirs, renameTo, setLastModified, setReadOnly, toURI, toURL
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ERXFile

public ERXFile(File arg0,
               String arg1)
Parameters:
arg0 -
arg1 -

ERXFile

public ERXFile(String arg0)
Parameters:
arg0 -

ERXFile

public ERXFile(String arg0,
               String arg1)
Parameters:
arg0 -
arg1 -

ERXFile

public ERXFile(URI arg0)
Parameters:
arg0 -
Method Detail

getAbsolutePath

public String getAbsolutePath()

getName

public String getName()

list

public String[] list()

list

public String[] list(FilenameFilter arg0)

listFiles

public File[] listFiles()

listFiles

public File[] listFiles(FileFilter arg0)

listFiles

public File[] listFiles(FilenameFilter arg0)

getAbsoluteFile

public File getAbsoluteFile()

getCanonicalFile

public File getCanonicalFile()
                      throws IOException
Throws:
IOException

getParentFile

public File getParentFile()

toString

public String toString()

Last updated: Do, Dez 9, 2004 • 12:46 PM CET

Copyright © 2002 – 2004 Project Wonder.