Index: apichanges.xml =================================================================== RCS file: /cvs/openide/fs/apichanges.xml,v retrieving revision 1.4 diff -u -u -r1.4 apichanges.xml --- apichanges.xml 6 Oct 2005 08:57:52 -0000 1.4 +++ apichanges.xml 25 Oct 2005 15:02:47 -0000 @@ -17,6 +17,22 @@ Filesystems API + + + IllegalArgumentException isn't thrown anymore. + + + + + +

Because of performance reasons from method + FileUtil.toFileObject was removed piece of code + checking whether file was properly normalized and thus + IllegalArgumentException can't be thrown. +

+
+ +
Removed most static MIME type mappings Index: src/org/openide/filesystems/FileUtil.java =================================================================== RCS file: /cvs/openide/fs/src/org/openide/filesystems/FileUtil.java,v retrieving revision 1.10 diff -u -u -r1.10 FileUtil.java --- src/org/openide/filesystems/FileUtil.java 7 Oct 2005 13:49:14 -0000 1.10 +++ src/org/openide/filesystems/FileUtil.java 25 Oct 2005 15:02:47 -0000 @@ -393,22 +393,24 @@ * If you are running with the MasterFS module enabled, that will guarantee * that this method never returns null for a file which exists on disk. *

- * @param file a disk file (may or may not exist) + * @param file a disk file (may or may not exist). This file + * must be normalized {@link #normalizeFile normalized}. * @return a corresponding file object, or null if the file does not exist * or there is no {@link URLMapper} available to convert it - * @throws IllegalArgumentException if the file is not {@link #normalizeFile normalized} * @since 4.29 */ - public static FileObject toFileObject(File file) throws IllegalArgumentException { - FileObject retVal = null; - - if (!file.equals(normalizeFile(file))) { + public static FileObject toFileObject(File file) { + boolean asserts = false; + assert asserts = true; + if (asserts && !file.equals(normalizeFile(file))) { throw new IllegalArgumentException( "Parameter file was not " + // NOI18N "normalized. Was " + file + " instead of " + normalizeFile(file) ); // NOI18N } + FileObject retVal = null; + try { URL url = fileToURL(file); @@ -428,7 +430,7 @@ return retVal; } - + static URL fileToURL(File file) throws MalformedURLException { URL retVal = null;