harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r492652 [4/13] - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/
Date Thu, 04 Jan 2007 17:47:05 GMT
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/File.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/File.java?view=diff&rev=492652&r1=492651&r2=492652
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/File.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/File.java Thu Jan  4 09:47:01 2007
@@ -17,7 +17,6 @@
 
 package java.io;
 
-
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
@@ -44,133 +43,129 @@
  * @see java.io.Serializable
  * @see java.lang.Comparable
  */
-
 public class File implements Serializable, Comparable<File> {
-	private static final long serialVersionUID = 301077366599181567L;
+    private static final long serialVersionUID = 301077366599181567L;
+
+    private String path;
+
+    transient byte[] properPath;
+
+    /**
+     * System dependent file separator character.
+     */
+    public static final char separatorChar;
 
-	private String path;
+    /**
+     * System dependent file separator String. The initial value of this field
+     * is the System property "file.separator".
+     */
+    public static final String separator;
 
-	transient byte[] properPath;
+    /**
+     * System dependent path separator character.
+     */
+    public static final char pathSeparatorChar;
+
+    /**
+     * System dependent path separator String. The initial value of this field
+     * is the System property "path.separator".
+     */
+    public static final String pathSeparator;
 
-	/**
-	 * System dependent file separator character.
-	 */
-	public static final char separatorChar;
-
-	/**
-	 * System dependent file separator String. The initial value of this field
-	 * is the System property "file.separator".
-	 */
-	public static final String separator;
-
-	/**
-	 * System dependent path separator character.
-	 */
-	public static final char pathSeparatorChar;
-
-	/**
-	 * System dependent path separator String. The initial value of this field
-	 * is the System property "path.separator".
-	 */
-	public static final String pathSeparator;
-
-	/* Temp file counter needs java.util.Random from mJava */
-	private static int counter;
-
-	private static boolean caseSensitive;
-
-	private static native void oneTimeInitialization();
-
-	static {
-		oneTimeInitialization();
-
-		// The default protection domain grants access to these properties
-		separatorChar = System.getProperty("file.separator", "\\").charAt(0); //$NON-NLS-1$ //$NON-NLS-2$
-		pathSeparatorChar = System.getProperty("path.separator", ";").charAt(0);  //$NON-NLS-1$//$NON-NLS-2$
-		separator = new String(new char[] { separatorChar }, 0, 1);
-		pathSeparator = new String(new char[] { pathSeparatorChar }, 0, 1);
-		caseSensitive = isCaseSensitiveImpl();
-	}
-
-	/**
-	 * Constructs a new File using the specified directory and name.
-	 * 
-	 * @param dir
-	 *            the directory for the file name
-	 * @param name
-	 *            the file name to be contained in the dir
-	 */
-
-	public File(File dir, String name) {
-		if (name != null) {
-			if (dir == null) {
-				this.path = fixSlashes(name);
-			} else {
-				this.path = calculatePath(dir.getPath(),name);
-			}
-		} else {
+    /* Temp file counter */
+    private static int counter;
+
+    private static boolean caseSensitive;
+
+    private static native void oneTimeInitialization();
+
+    static {
+        oneTimeInitialization();
+
+        // The default protection domain grants access to these properties
+        separatorChar = System.getProperty("file.separator", "\\").charAt(0); //$NON-NLS-1$ //$NON-NLS-2$
+        pathSeparatorChar = System.getProperty("path.separator", ";").charAt(0); //$NON-NLS-1$//$NON-NLS-2$
+        separator = new String(new char[] { separatorChar }, 0, 1);
+        pathSeparator = new String(new char[] { pathSeparatorChar }, 0, 1);
+        caseSensitive = isCaseSensitiveImpl();
+    }
+
+    /**
+     * Constructs a new File using the specified directory and name.
+     * 
+     * @param dir
+     *            the directory for the file name
+     * @param name
+     *            the file name to be contained in the dir
+     */
+    public File(File dir, String name) {
+        if (name == null) {
             throw new NullPointerException();
         }
-	}
+        if (dir == null) {
+            this.path = fixSlashes(name);
+        } else {
+            this.path = calculatePath(dir.getPath(), name);
+        }
+    }
+
+    /**
+     * Constructs a new File using the specified path.
+     * 
+     * @param path
+     *            the path to be used for the file
+     */
+    public File(String path) {
+        // path == null check & NullPointerException thrown by fixSlashes
+        this.path = fixSlashes(path);
+    }
 
-	/**
-	 * Constructs a new File using the specified path.
-	 * 
-	 * @param path
-	 *            the path to be used for the file
-	 */
-	public File(String path) {
-		// NullPointerException thrown by fixSlashes
-		this.path = fixSlashes(path);
-	}
-
-	/**
-	 * Constructs a new File using the specified directory and name placing a
-	 * path separator between the two.
-	 * 
-	 * @param dirPath
-	 *            the directory for the file name
-	 * @param name
-	 *            the file name to be contained in the dir
-	 */
-	public File(String dirPath, String name) {
-		if (name != null) {
-			if (dirPath == null) {
-				this.path = fixSlashes(name);
-			} else {
-				this.path = calculatePath(dirPath, name);
-			}
-		} else {
+    /**
+     * Constructs a new File using the specified directory and name placing a
+     * path separator between the two.
+     * 
+     * @param dirPath
+     *            the directory for the file name
+     * @param name
+     *            the file name to be contained in the dir
+     */
+    public File(String dirPath, String name) {
+        if (name == null) {
             throw new NullPointerException();
         }
-	}
+        if (dirPath == null) {
+            this.path = fixSlashes(name);
+        } else {
+            this.path = calculatePath(dirPath, name);
+        }
+    }
 
-	/**
-	 * Constructs a new File using the path of the specified URI
-	 * 
-	 * <code>uri</code> needs to be an absolute and hierarchical
-	 * <code>URI </code> with file scheme, and non-empty path component, but
-	 * with undefined authority, query or fragment components.
-	 * 
-	 * @param uri
-	 *            the URI instance which will be used to construct this file
-	 * 
-	 * @throws IllegalArgumentException
-	 *             if <code>uri</code> does not comply with the conditions
-	 *             above.
-	 * 
-	 * @see #toURI
-	 * @see java.net.URI
-	 */
-	public File(URI uri) {
-		// check pre-conditions
-		checkURI(uri);
-		this.path = fixSlashes(uri.getPath());
-	}
+    /**
+     * Constructs a new File using the path of the specified URI
+     * 
+     * <code>uri</code> needs to be an absolute and hierarchical
+     * <code>URI </code> with file scheme, and non-empty path component, but
+     * with undefined authority, query or fragment components.
+     * 
+     * @param uri
+     *            the URI instance which will be used to construct this file
+     * 
+     * @throws IllegalArgumentException
+     *             if <code>uri</code> does not comply with the conditions
+     *             above.
+     * 
+     * @see #toURI
+     * @see java.net.URI
+     */
+    public File(URI uri) {
+        // check pre-conditions
+        checkURI(uri);
+        this.path = fixSlashes(uri.getPath());
+    }
 
-	private String calculatePath(String dirPath, String name) {
+    private String calculatePath(String dirPath, String name) {
         dirPath = fixSlashes(dirPath);
-        if (!name.equals("")){ //$NON-NLS-1$
+        if (!name.equals("")) { //$NON-NLS-1$
             // Remove all the proceeding separator chars from name
             name = fixSlashes(name);
             while (name.length() > 0 && (name.charAt(0) == separatorChar)) {
@@ -178,170 +173,167 @@
             }
 
             // Ensure there is a separator char between dirPath and name
-            if (dirPath.length() > 0 && (dirPath.charAt(dirPath.length() - 1) == separatorChar)) {
+            if (dirPath.length() > 0
+                    && (dirPath.charAt(dirPath.length() - 1) == separatorChar)) {
                 return dirPath + name;
             }
             return dirPath + separatorChar + name;
         }
-        
+
         return dirPath;
-	}
+    }
 
-	private void checkURI(URI uri) {
-		if (!uri.isAbsolute()) {
-			throw new IllegalArgumentException(Msg.getString(
-					"K031a", uri)); //$NON-NLS-1$
-		} else if (!uri.getRawSchemeSpecificPart().startsWith("/")) { //$NON-NLS-1$
-			throw new IllegalArgumentException(Msg.getString(
-					"K031b", uri)); //$NON-NLS-1$
-		}
-
-		String temp = uri.getScheme();
-		if (temp == null || !temp.equals("file")) { //$NON-NLS-1$
-			throw new IllegalArgumentException(Msg.getString(
-					"K031c", uri)); //$NON-NLS-1$
-		}
-
-		temp = uri.getRawPath();
-		if (temp == null || temp.length() == 0) {
-			throw new IllegalArgumentException(Msg.getString(
-					"K031d", uri)); //$NON-NLS-1$
-		}
-
-		if (uri.getRawAuthority() != null) {
-			throw new IllegalArgumentException(Msg.getString(
-					"K031e", new String[] { "authority", uri.toString() })); //$NON-NLS-1$ //$NON-NLS-2$
-		}
+    private void checkURI(URI uri) {
+        if (!uri.isAbsolute()) {
+            throw new IllegalArgumentException(Msg.getString("K031a", uri)); //$NON-NLS-1$
+        } else if (!uri.getRawSchemeSpecificPart().startsWith("/")) { //$NON-NLS-1$
+            throw new IllegalArgumentException(Msg.getString("K031b", uri)); //$NON-NLS-1$
+        }
 
-		if (uri.getRawQuery() != null) {
+        String temp = uri.getScheme();
+        if (temp == null || !temp.equals("file")) { //$NON-NLS-1$
+            throw new IllegalArgumentException(Msg.getString("K031c", uri)); //$NON-NLS-1$
+        }
+
+        temp = uri.getRawPath();
+        if (temp == null || temp.length() == 0) {
+            throw new IllegalArgumentException(Msg.getString("K031d", uri)); //$NON-NLS-1$
+        }
+
+        if (uri.getRawAuthority() != null) {
+            throw new IllegalArgumentException(Msg.getString(
+                    "K031e", new String[] { "authority", uri.toString() })); //$NON-NLS-1$ //$NON-NLS-2$
+        }
+
+        if (uri.getRawQuery() != null) {
             throw new IllegalArgumentException(Msg.getString(
-					"K031e", new String[] { "query", uri.toString() }));  //$NON-NLS-1$//$NON-NLS-2$
+                    "K031e", new String[] { "query", uri.toString() })); //$NON-NLS-1$//$NON-NLS-2$
         }
 
-		if (uri.getRawFragment() != null) {
+        if (uri.getRawFragment() != null) {
             throw new IllegalArgumentException(Msg.getString(
-					"K031e", new String[] { "fragment", uri.toString() })); //$NON-NLS-1$ //$NON-NLS-2$
+                    "K031e", new String[] { "fragment", uri.toString() })); //$NON-NLS-1$ //$NON-NLS-2$
         }
-	}
+    }
 
-	private static native byte[][] rootsImpl();
+    private static native byte[][] rootsImpl();
 
-	private static native boolean isCaseSensitiveImpl();
+    private static native boolean isCaseSensitiveImpl();
 
-	/**
-	 * Lists the filesystem roots.
-	 * 
-	 * The Java platform may support zero or more filesystems, each with its own
-	 * platform-dependent root. Further, the canonical pathname of any file on
-	 * the system will always begin with one of the returned filesystem roots.
-	 * 
-	 * @return the array of filesystem roots
-	 */
-	public static File[] listRoots() {
-		byte[][] rootsList = rootsImpl();
-		if (rootsList == null) {
+    /**
+     * Lists the filesystem roots.
+     * 
+     * The Java platform may support zero or more filesystems, each with its own
+     * platform-dependent root. Further, the canonical pathname of any file on
+     * the system will always begin with one of the returned filesystem roots.
+     * 
+     * @return the array of filesystem roots
+     */
+    public static File[] listRoots() {
+        byte[][] rootsList = rootsImpl();
+        if (rootsList == null) {
             return new File[0];
         }
-		File result[] = new File[rootsList.length];
-		for (int i = 0; i < rootsList.length; i++) {
+        File result[] = new File[rootsList.length];
+        for (int i = 0; i < rootsList.length; i++) {
             result[i] = new File(Util.toString(rootsList[i]));
         }
-		return result;
-	}
+        return result;
+    }
 
-	/**
-	 * The purpose of this method is to take a path and fix the slashes up. This
-	 * includes changing them all to the current platforms fileSeparator and
-	 * removing duplicates.
-	 */
-	private String fixSlashes(String origPath) {
-		int uncIndex = 1;
-		int length = origPath.length(), newLength = 0;
-		if (separatorChar == '/') {
+    /**
+     * The purpose of this method is to take a path and fix the slashes up. This
+     * includes changing them all to the current platforms fileSeparator and
+     * removing duplicates.
+     */
+    private String fixSlashes(String origPath) {
+        int uncIndex = 1;
+        int length = origPath.length(), newLength = 0;
+        if (separatorChar == '/') {
             uncIndex = 0;
         } else if (length > 2 && origPath.charAt(1) == ':') {
             uncIndex = 2;
         }
 
-		boolean foundSlash = false;
-		char newPath[] = origPath.toCharArray();
-		for (int i = 0; i < length; i++) {
-			char pathChar = newPath[i];
-			if (pathChar == '\\' || pathChar == '/') {
-				/* UNC Name requires 2 leading slashes */
-				if ((foundSlash && i == uncIndex) || !foundSlash) {
-					newPath[newLength++] = separatorChar;
-					foundSlash = true;
-				}
-			} else {
-				// check for leading slashes before a drive
-				if (pathChar == ':'
-						&& uncIndex > 0
-						&& (newLength == 2 || (newLength == 3 && newPath[1] == separatorChar))
-						&& newPath[0] == separatorChar) {
-					newPath[0] = newPath[newLength - 1];
-					newLength = 1;
-					// allow trailing slash after drive letter
-					uncIndex = 2;
-				}
-				newPath[newLength++] = pathChar;
-				foundSlash = false;
-			}
-		}
-		// remove trailing slash
-		if (foundSlash
-				&& (newLength > (uncIndex + 1) || (newLength == 2 && newPath[0] != separatorChar))) {
-			newLength--;
-		}
-		String tempPath = new String(newPath, 0, newLength);
-		// If it's the same keep it identical for SecurityManager purposes
-		if (!tempPath.equals(origPath)) {
-			return tempPath;
-		}
-		return origPath;
-	}
-
-	/**
-	 * Answers a boolean indicating whether or not the current context is allowed
-	 * to read this File.
-	 * 
-	 * @return <code>true</code> if this File can be read, <code>false</code>
-	 *         otherwise.
-	 * 
-	 * @see java.lang.SecurityManager#checkRead(FileDescriptor)
-	 */
-	public boolean canRead() {
-		SecurityManager security = System.getSecurityManager();
-		if (security != null) {
+        boolean foundSlash = false;
+        char newPath[] = origPath.toCharArray();
+        for (int i = 0; i < length; i++) {
+            char pathChar = newPath[i];
+            if (pathChar == '\\' || pathChar == '/') {
+                /* UNC Name requires 2 leading slashes */
+                if ((foundSlash && i == uncIndex) || !foundSlash) {
+                    newPath[newLength++] = separatorChar;
+                    foundSlash = true;
+                }
+            } else {
+                // check for leading slashes before a drive
+                if (pathChar == ':'
+                        && uncIndex > 0
+                        && (newLength == 2 || (newLength == 3 && newPath[1] == separatorChar))
+                        && newPath[0] == separatorChar) {
+                    newPath[0] = newPath[newLength - 1];
+                    newLength = 1;
+                    // allow trailing slash after drive letter
+                    uncIndex = 2;
+                }
+                newPath[newLength++] = pathChar;
+                foundSlash = false;
+            }
+        }
+        // remove trailing slash
+        if (foundSlash
+                && (newLength > (uncIndex + 1) || (newLength == 2 && newPath[0] != separatorChar))) {
+            newLength--;
+        }
+        String tempPath = new String(newPath, 0, newLength);
+        // If it's the same keep it identical for SecurityManager purposes
+        if (!tempPath.equals(origPath)) {
+            return tempPath;
+        }
+        return origPath;
+    }
+
+    /**
+     * Answers a boolean indicating whether or not the current context is
+     * allowed to read this File.
+     * 
+     * @return <code>true</code> if this File can be read, <code>false</code>
+     *         otherwise.
+     * 
+     * @see java.lang.SecurityManager#checkRead(FileDescriptor)
+     */
+    public boolean canRead() {
+        SecurityManager security = System.getSecurityManager();
+        if (security != null) {
             security.checkRead(path);
         }
-		return exists() && !isWriteOnlyImpl(properPath(true));
-	}
+        return exists() && !isWriteOnlyImpl(properPath(true));
+    }
 
-	/**
-	 * Answers a boolean indicating whether or not the current context is
-	 * allowed to write to this File.
-	 * 
-	 * @return <code>true</code> if this File can be written,
-	 *         <code>false</code> otherwise.
-	 * 
-	 * @see java.lang.SecurityManager#checkWrite(FileDescriptor)
-	 */
-	public boolean canWrite() {
-		SecurityManager security = System.getSecurityManager();
-		if (security != null) {
+    /**
+     * Answers a boolean indicating whether or not the current context is
+     * allowed to write to this File.
+     * 
+     * @return <code>true</code> if this File can be written,
+     *         <code>false</code> otherwise.
+     * 
+     * @see java.lang.SecurityManager#checkWrite(FileDescriptor)
+     */
+    public boolean canWrite() {
+        SecurityManager security = System.getSecurityManager();
+        if (security != null) {
             security.checkWrite(path);
         }
-		
-		// Cannot use exists() since that does an unwanted read-check.
-		boolean exists = false;
-		if (path.length() > 0) {
-			exists = existsImpl(properPath(true));
-		}
-		return exists && !isReadOnlyImpl(properPath(true));
-	}
 
-	/**
+        // Cannot use exists() since that does an unwanted read-check.
+        boolean exists = false;
+        if (path.length() > 0) {
+            exists = existsImpl(properPath(true));
+        }
+        return exists && !isReadOnlyImpl(properPath(true));
+    }
+
+    /**
      * Answers the relative sort ordering of paths for the receiver and given
      * argument. The ordering is platform dependent.
      * 
@@ -358,16 +350,16 @@
         return this.getPath().compareToIgnoreCase(another.getPath());
     }
 
-	/**
-	 * Deletes the file specified by this File. Directories must be empty before
-	 * they will be deleted.
-	 * 
-	 * @return <code>true</code> if this File was deleted, <code>false</code>
-	 *         otherwise.
-	 * 
-	 * @see java.lang.SecurityManager#checkDelete
-	 */
-	public boolean delete() {
+    /**
+     * Deletes the file specified by this File. Directories must be empty before
+     * they will be deleted.
+     * 
+     * @return <code>true</code> if this File was deleted, <code>false</code>
+     *         otherwise.
+     * 
+     * @see java.lang.SecurityManager#checkDelete
+     */
+    public boolean delete() {
         SecurityManager security = System.getSecurityManager();
         if (security != null) {
             security.checkDelete(path);
@@ -379,930 +371,924 @@
         return deleteFileImpl(propPath);
     }
 
-	private native boolean deleteDirImpl(byte[] filePath);
+    private native boolean deleteDirImpl(byte[] filePath);
 
-	private native boolean deleteFileImpl(byte[] filePath);
+    private native boolean deleteFileImpl(byte[] filePath);
 
-	/**
-	 * When the virtual machine terminates, any abstract files which have been
-	 * sent <code>deleteOnExit()</code> will be deleted. This will only happen
-	 * when the virtual machine terminates normally as described by the Java
-	 * Language Specification section 12.9.
-	 * 
-	 */
-	public void deleteOnExit() {
-		SecurityManager security = System.getSecurityManager();
-		if (security != null) {
+    /**
+     * When the virtual machine terminates, any abstract files which have been
+     * sent <code>deleteOnExit()</code> will be deleted. This will only happen
+     * when the virtual machine terminates normally as described by the Java
+     * Language Specification section 12.9.
+     * 
+     */
+    public void deleteOnExit() {
+        SecurityManager security = System.getSecurityManager();
+        if (security != null) {
             security.checkDelete(path);
         }
 
-		DeleteOnExit.addFile(Util
-				.toString(properPath(true)));
-	}
-
-	/**
-	 * Compares the argument <code>obj</code> to the receiver, and answers
-	 * <code>true</code> if they represent the <em>same</em> object using a
-	 * path specific comparison.
-	 * 
-	 * @param obj
-	 *            the Object to compare with this Object
-	 * @return <code>true</code> if the object is the same as this object,
-	 *         <code>false</code> otherwise.
-	 */
-	@Override
+        DeleteOnExit.addFile(Util.toString(properPath(true)));
+    }
+
+    /**
+     * Compares the argument <code>obj</code> to the receiver, and answers
+     * <code>true</code> if they represent the <em>same</em> object using a
+     * path specific comparison.
+     * 
+     * @param obj
+     *            the Object to compare with this Object
+     * @return <code>true</code> if the object is the same as this object,
+     *         <code>false</code> otherwise.
+     */
+    @Override
     public boolean equals(Object obj) {
-		if (!(obj instanceof File)) {
+        if (!(obj instanceof File)) {
             return false;
         }
-		if (!caseSensitive) {
-			return path.equalsIgnoreCase(((File) obj).getPath());
-		}
-		return path.equals(((File) obj).getPath());
-	}
-
-	/**
-	 * Answers a boolean indicating whether or not this File can be found on the
-	 * underlying file system.
-	 * 
-	 * @return <code>true</code> if this File exists, <code>false</code>
-	 *         otherwise.
-	 * 
-	 * @see #getPath
-	 * @see java.lang.SecurityManager#checkRead(FileDescriptor)
-	 */
-	public boolean exists() {
-		if (path.length() == 0) {
+        if (!caseSensitive) {
+            return path.equalsIgnoreCase(((File) obj).getPath());
+        }
+        return path.equals(((File) obj).getPath());
+    }
+
+    /**
+     * Answers a boolean indicating whether or not this File can be found on the
+     * underlying file system.
+     * 
+     * @return <code>true</code> if this File exists, <code>false</code>
+     *         otherwise.
+     * 
+     * @see #getPath
+     * @see java.lang.SecurityManager#checkRead(FileDescriptor)
+     */
+    public boolean exists() {
+        if (path.length() == 0) {
             return false;
         }
-		SecurityManager security = System.getSecurityManager();
-		if (security != null) {
+        SecurityManager security = System.getSecurityManager();
+        if (security != null) {
             security.checkRead(path);
         }
-		return existsImpl(properPath(true));
-	}
+        return existsImpl(properPath(true));
+    }
 
-	private native boolean existsImpl(byte[] filePath);
+    private native boolean existsImpl(byte[] filePath);
 
-	/**
-	 * Answers the absolute file path of this File.
-	 * 
-	 * @return the absolute file path
-	 * 
-	 * @see java.lang.SecurityManager#checkPropertyAccess
-	 */
-	public String getAbsolutePath() {
-		byte[] absolute = properPath(false);
-		return Util.toString(absolute);
-	}
-
-	/**
-	 * Answers a new File constructed using the absolute file path of this File.
-	 * 
-	 * @return a new File from this absolute file path
-	 * 
-	 * @see java.lang.SecurityManager#checkPropertyAccess
-	 */
-	public File getAbsoluteFile() {
-		return new File(this.getAbsolutePath());
-	}
-
-	/**
-	 * Answers the absolute file path of this File with all references resolved.
-	 * An <em>absolute</em> file path is one which begins at the root of the
-	 * file system. The canonical path is one in which all references have been
-	 * resolved. For the cases of '..' and '.' where the file system supports
-	 * parent and working directory respectively, these should be removed and
-	 * replaced with a direct directory reference. If the File does not exist,
-	 * getCanonicalPath() may not resolve any references and simply return an
-	 * absolute path name or throw an IOException.
-	 * 
-	 * @return the canonical file path
-	 * 
-	 * @throws IOException
-	 *             if an IO error occurs
-	 * 
-	 * @see java.lang.SecurityManager#checkPropertyAccess
-	 */
-	public String getCanonicalPath() throws IOException {
-		byte[] result = properPath(false);
-
-		boolean exists = false;
-		byte[] pathBytes = result;
-		do {
-			byte[] linkBytes = getLinkImpl(pathBytes);
-			if (linkBytes == pathBytes) {
+    /**
+     * Answers the absolute file path of this File.
+     * 
+     * @return the absolute file path
+     * 
+     * @see java.lang.SecurityManager#checkPropertyAccess
+     */
+    public String getAbsolutePath() {
+        byte[] absolute = properPath(false);
+        return Util.toString(absolute);
+    }
+
+    /**
+     * Answers a new File constructed using the absolute file path of this File.
+     * 
+     * @return a new File from this absolute file path
+     * 
+     * @see java.lang.SecurityManager#checkPropertyAccess
+     */
+    public File getAbsoluteFile() {
+        return new File(this.getAbsolutePath());
+    }
+
+    /**
+     * Answers the absolute file path of this File with all references resolved.
+     * An <em>absolute</em> file path is one which begins at the root of the
+     * file system. The canonical path is one in which all references have been
+     * resolved. For the cases of '..' and '.' where the file system supports
+     * parent and working directory respectively, these should be removed and
+     * replaced with a direct directory reference. If the File does not exist,
+     * getCanonicalPath() may not resolve any references and simply return an
+     * absolute path name or throw an IOException.
+     * 
+     * @return the canonical file path
+     * 
+     * @throws IOException
+     *             if an IO error occurs
+     * 
+     * @see java.lang.SecurityManager#checkPropertyAccess
+     */
+    public String getCanonicalPath() throws IOException {
+        byte[] result = properPath(false);
+
+        boolean exists = false;
+        byte[] pathBytes = result;
+        do {
+            byte[] linkBytes = getLinkImpl(pathBytes);
+            if (linkBytes == pathBytes) {
                 break;
             }
-			if (linkBytes[0] == separatorChar) {
-				pathBytes = linkBytes;
-			} else {
-				int index = pathBytes.length - 1;
-				while (pathBytes[index] != separatorChar) {
+            if (linkBytes[0] == separatorChar) {
+                pathBytes = linkBytes;
+            } else {
+                int index = pathBytes.length - 1;
+                while (pathBytes[index] != separatorChar) {
                     index--;
                 }
-				byte[] temp = new byte[index + 1 + linkBytes.length];
-				System.arraycopy(pathBytes, 0, temp, 0, index + 1);
-				System.arraycopy(linkBytes, 0, temp, index + 1,
-						linkBytes.length);
-				pathBytes = temp;
-			}
-			exists = existsImpl(pathBytes);
-		} while (exists);
-		if (exists) {
+                byte[] temp = new byte[index + 1 + linkBytes.length];
+                System.arraycopy(pathBytes, 0, temp, 0, index + 1);
+                System.arraycopy(linkBytes, 0, temp, index + 1,
+                        linkBytes.length);
+                pathBytes = temp;
+            }
+            exists = existsImpl(pathBytes);
+        } while (exists);
+        if (exists) {
             result = pathBytes;
         }
 
-		int numSeparators = 1;
-		for (int i = 0; i < result.length; i++) {
+        int numSeparators = 1;
+        for (int i = 0; i < result.length; i++) {
             if (result[i] == separatorChar) {
                 numSeparators++;
             }
         }
-		int sepLocations[] = new int[numSeparators];
-		int rootLoc = 0;
-		if (separatorChar != '/') {
+        int sepLocations[] = new int[numSeparators];
+        int rootLoc = 0;
+        if (separatorChar != '/') {
             if (result[0] == '\\') {
                 rootLoc = (result.length > 1 && result[1] == '\\') ? 1 : 0;
             } else {
                 rootLoc = 2; // skip drive i.e. c:
             }
         }
-		byte newResult[] = new byte[result.length + 1];
-		int newLength = 0, lastSlash = 0, foundDots = 0;
-		sepLocations[lastSlash] = rootLoc;
-		for (int i = 0; i <= result.length; i++) {
-			if (i < rootLoc) {
+        byte newResult[] = new byte[result.length + 1];
+        int newLength = 0, lastSlash = 0, foundDots = 0;
+        sepLocations[lastSlash] = rootLoc;
+        for (int i = 0; i <= result.length; i++) {
+            if (i < rootLoc) {
                 newResult[newLength++] = result[i];
             } else {
-				if (i == result.length || result[i] == separatorChar) {
-					if (i == result.length && foundDots == 0) {
+                if (i == result.length || result[i] == separatorChar) {
+                    if (i == result.length && foundDots == 0) {
                         break;
                     }
-					if (foundDots == 1) {
-						/* Don't write anything, just reset and continue */
-						foundDots = 0;
-						continue;
-					}
-					if (foundDots > 1) {
-						/* Go back N levels */
-						lastSlash = lastSlash > (foundDots - 1) ? lastSlash
-								- (foundDots - 1) : 0;
-						newLength = sepLocations[lastSlash] + 1;
-						foundDots = 0;
-						continue;
-					}
-					sepLocations[++lastSlash] = newLength;
-					newResult[newLength++] = (byte) separatorChar;
-					continue;
-				}
-				if (result[i] == '.') {
-					foundDots++;
-					continue;
-				}
-				/* Found some dots within text, write them out */
-				if (foundDots > 0) {
+                    if (foundDots == 1) {
+                        /* Don't write anything, just reset and continue */
+                        foundDots = 0;
+                        continue;
+                    }
+                    if (foundDots > 1) {
+                        /* Go back N levels */
+                        lastSlash = lastSlash > (foundDots - 1) ? lastSlash
+                                - (foundDots - 1) : 0;
+                        newLength = sepLocations[lastSlash] + 1;
+                        foundDots = 0;
+                        continue;
+                    }
+                    sepLocations[++lastSlash] = newLength;
+                    newResult[newLength++] = (byte) separatorChar;
+                    continue;
+                }
+                if (result[i] == '.') {
+                    foundDots++;
+                    continue;
+                }
+                /* Found some dots within text, write them out */
+                if (foundDots > 0) {
                     for (int j = 0; j < foundDots; j++) {
                         newResult[newLength++] = (byte) '.';
                     }
                 }
-				newResult[newLength++] = result[i];
-				foundDots = 0;
-			}
-		}
-		// remove trailing slash
-		if (newLength > (rootLoc + 1)
-				&& newResult[newLength - 1] == separatorChar) {
+                newResult[newLength++] = result[i];
+                foundDots = 0;
+            }
+        }
+        // remove trailing slash
+        if (newLength > (rootLoc + 1)
+                && newResult[newLength - 1] == separatorChar) {
             newLength--;
         }
-		newResult[newLength] = 0;
-		newResult = getCanonImpl(newResult);
-		newLength = newResult.length;
-		return Util.toString(newResult, 0, newLength);
-	}
-
-	/**
-	 * Answers a new File created using the canonical file path of this File.
-	 * Equivalent to <code>new File(this.getCanonicalPath())</code>.
-	 * 
-	 * @return the canonical file path
-	 * 
-	 * @throws IOException
-	 *             If an IO error occurs
-	 * 
-	 * @see java.lang.SecurityManager#checkPropertyAccess
-	 */
-	public File getCanonicalFile() throws IOException {
-		return new File(getCanonicalPath());
-	}
-
-	private native byte[] getCanonImpl(byte[] filePath);
-
-	/**
-	 * Answers the filename (not directory) of this File.
-	 * 
-	 * @return the filename or empty string
-	 */
-	public String getName() {
-		int separatorIndex = path.lastIndexOf(separator);
-		return (separatorIndex < 0) ? path : path.substring(separatorIndex + 1,
-				path.length());
-	}
-
-	/**
-	 * Answers the pathname of the parent of this File. This is the path up to
-	 * but not including the last name. <code>null</code> is returned when
-	 * there is no parent.
-	 * 
-	 * @return the parent name or <code>null</code>
-	 */
-	public String getParent() {
-		int length = path.length(), firstInPath = 0;
-		if (separatorChar == '\\' && length > 2 && path.charAt(1) == ':') {
+        newResult[newLength] = 0;
+        newResult = getCanonImpl(newResult);
+        newLength = newResult.length;
+        return Util.toString(newResult, 0, newLength);
+    }
+
+    /**
+     * Answers a new File created using the canonical file path of this File.
+     * Equivalent to <code>new File(this.getCanonicalPath())</code>.
+     * 
+     * @return the canonical file path
+     * 
+     * @throws IOException
+     *             If an IO error occurs
+     * 
+     * @see java.lang.SecurityManager#checkPropertyAccess
+     */
+    public File getCanonicalFile() throws IOException {
+        return new File(getCanonicalPath());
+    }
+
+    private native byte[] getCanonImpl(byte[] filePath);
+
+    /**
+     * Answers the filename (not directory) of this File.
+     * 
+     * @return the filename or empty string
+     */
+    public String getName() {
+        int separatorIndex = path.lastIndexOf(separator);
+        return (separatorIndex < 0) ? path : path.substring(separatorIndex + 1,
+                path.length());
+    }
+
+    /**
+     * Answers the pathname of the parent of this File. This is the path up to
+     * but not including the last name. <code>null</code> is returned when
+     * there is no parent.
+     * 
+     * @return the parent name or <code>null</code>
+     */
+    public String getParent() {
+        int length = path.length(), firstInPath = 0;
+        if (separatorChar == '\\' && length > 2 && path.charAt(1) == ':') {
             firstInPath = 2;
         }
-		int index = path.lastIndexOf(separatorChar);
-		if (index == -1 && firstInPath > 0) {
+        int index = path.lastIndexOf(separatorChar);
+        if (index == -1 && firstInPath > 0) {
             index = 2;
         }
-		if (index == -1 || path.charAt(length - 1) == separatorChar) {
+        if (index == -1 || path.charAt(length - 1) == separatorChar) {
             return null;
         }
-		if (path.indexOf(separatorChar) == index
-				&& path.charAt(firstInPath) == separatorChar) {
+        if (path.indexOf(separatorChar) == index
+                && path.charAt(firstInPath) == separatorChar) {
             return path.substring(0, index + 1);
         }
-		return path.substring(0, index);
-	}
+        return path.substring(0, index);
+    }
 
-	/**
-	 * Answers a new File made from the pathname of the parent of this File.
-	 * This is the path up to but not including the last name. <code>null</code>
-	 * is returned when there is no parent.
-	 * 
-	 * @return a new File representing parent or <code>null</code>
-	 */
-	public File getParentFile() {
-		String tempParent = getParent();
-		if (tempParent == null) {
+    /**
+     * Answers a new File made from the pathname of the parent of this File.
+     * This is the path up to but not including the last name. <code>null</code>
+     * is returned when there is no parent.
+     * 
+     * @return a new File representing parent or <code>null</code>
+     */
+    public File getParentFile() {
+        String tempParent = getParent();
+        if (tempParent == null) {
             return null;
         }
-		return new File(tempParent);
-	}
+        return new File(tempParent);
+    }
+
+    /**
+     * Answers the file path of this File.
+     * 
+     * @return the file path
+     */
+    public String getPath() {
+        return path;
+    }
 
-	/**
-	 * Answers the file path of this File.
-	 * 
-	 * @return the file path
-	 */
-	public String getPath() {
-		return path;
-	}
-
-	/**
-	 * Answers an integer hash code for the receiver. Any two objects which
-	 * answer <code>true</code> when passed to <code>equals</code> must
-	 * answer the same value for this method.
-	 * 
-	 * @return the receiver's hash
-	 * 
-	 * @see #equals
-	 */
-	@Override
+    /**
+     * Answers an integer hash code for the receiver. Any two objects which
+     * answer <code>true</code> when passed to <code>equals</code> must
+     * answer the same value for this method.
+     * 
+     * @return the receiver's hash
+     * 
+     * @see #equals
+     */
+    @Override
     public int hashCode() {
-		if (caseSensitive) {
+        if (caseSensitive) {
             return path.hashCode() ^ 1234321;
         }
         return path.toLowerCase().hashCode() ^ 1234321;
-	}
+    }
 
-	/**
-	 * Answers if this File is an absolute pathname. Whether a pathname is
-	 * absolute is platform specific. On UNIX it is if the path starts with the
-	 * character '/', on Windows it is absolute if either it starts with '\',
-	 * '/', '\\' (to represent a file server), or a letter followed by a colon.
-	 * 
-	 * @return <code>true</code> if this File is absolute, <code>false</code>
-	 *         otherwise.
-	 * 
-	 * @see #getPath
-	 */
-	public boolean isAbsolute() {
-		return isAbsoluteImpl(Util.getBytes(path));
-	}
-
-	private native boolean isAbsoluteImpl(byte[] filePath);
-
-	/**
-	 * Answers if this File represents a <em>directory</em> on the underlying
-	 * file system.
-	 * 
-	 * @return <code>true</code> if this File is a directory,
-	 *         <code>false</code> otherwise.
-	 * 
-	 * @see #getPath
-	 * @see java.lang.SecurityManager#checkRead(FileDescriptor)
-	 */
-	public boolean isDirectory() {
-		if (path.length() == 0) {
+    /**
+     * Answers if this File is an absolute pathname. Whether a pathname is
+     * absolute is platform specific. On UNIX it is if the path starts with the
+     * character '/', on Windows it is absolute if either it starts with '\',
+     * '/', '\\' (to represent a file server), or a letter followed by a colon.
+     * 
+     * @return <code>true</code> if this File is absolute, <code>false</code>
+     *         otherwise.
+     * 
+     * @see #getPath
+     */
+    public boolean isAbsolute() {
+        return isAbsoluteImpl(Util.getBytes(path));
+    }
+
+    private native boolean isAbsoluteImpl(byte[] filePath);
+
+    /**
+     * Answers if this File represents a <em>directory</em> on the underlying
+     * file system.
+     * 
+     * @return <code>true</code> if this File is a directory,
+     *         <code>false</code> otherwise.
+     * 
+     * @see #getPath
+     * @see java.lang.SecurityManager#checkRead(FileDescriptor)
+     */
+    public boolean isDirectory() {
+        if (path.length() == 0) {
             return false;
         }
-		SecurityManager security = System.getSecurityManager();
-		if (security != null) {
+        SecurityManager security = System.getSecurityManager();
+        if (security != null) {
             security.checkRead(path);
         }
-		return isDirectoryImpl(properPath(true));
-	}
+        return isDirectoryImpl(properPath(true));
+    }
 
-	private native boolean isDirectoryImpl(byte[] filePath);
+    private native boolean isDirectoryImpl(byte[] filePath);
 
-	/**
-	 * Answers if this File represents a <em>file</em> on the underlying file
-	 * system.
-	 * 
-	 * @return <code>true</code> if this File is a file, <code>false</code>
-	 *         otherwise.
-	 * 
-	 * @see #getPath
-	 * @see java.lang.SecurityManager#checkRead(FileDescriptor)
-	 */
-	public boolean isFile() {
-		if (path.length() == 0) {
+    /**
+     * Answers if this File represents a <em>file</em> on the underlying file
+     * system.
+     * 
+     * @return <code>true</code> if this File is a file, <code>false</code>
+     *         otherwise.
+     * 
+     * @see #getPath
+     * @see java.lang.SecurityManager#checkRead(FileDescriptor)
+     */
+    public boolean isFile() {
+        if (path.length() == 0) {
             return false;
         }
-		SecurityManager security = System.getSecurityManager();
-		if (security != null) {
+        SecurityManager security = System.getSecurityManager();
+        if (security != null) {
             security.checkRead(path);
         }
-		return isFileImpl(properPath(true));
-	}
+        return isFileImpl(properPath(true));
+    }
 
-	private native boolean isFileImpl(byte[] filePath);
+    private native boolean isFileImpl(byte[] filePath);
 
-	/**
-	 * Returns whether or not this file is a hidden file as defined by the
-	 * operating system.
-	 * 
-	 * @return <code>true</code> if the file is hidden, <code>false</code>
-	 *         otherwise.
-	 */
-	public boolean isHidden() {
-		if (path.length() == 0) {
+    /**
+     * Returns whether or not this file is a hidden file as defined by the
+     * operating system.
+     * 
+     * @return <code>true</code> if the file is hidden, <code>false</code>
+     *         otherwise.
+     */
+    public boolean isHidden() {
+        if (path.length() == 0) {
             return false;
         }
-		SecurityManager security = System.getSecurityManager();
-		if (security != null) {
+        SecurityManager security = System.getSecurityManager();
+        if (security != null) {
             security.checkRead(path);
         }
-		return isHiddenImpl(properPath(true));
-	}
+        return isHiddenImpl(properPath(true));
+    }
 
-	private native boolean isHiddenImpl(byte[] filePath);
+    private native boolean isHiddenImpl(byte[] filePath);
 
-	private native boolean isReadOnlyImpl(byte[] filePath);
+    private native boolean isReadOnlyImpl(byte[] filePath);
 
-	private native boolean isWriteOnlyImpl(byte[] filePath);
+    private native boolean isWriteOnlyImpl(byte[] filePath);
 
-	private native byte[] getLinkImpl(byte[] filePath);
-
-	/**
-	 * Answers the time this File was last modified.
-	 * 
-	 * @return the time this File was last modified.
-	 * 
-	 * @see #getPath
-	 * @see java.lang.SecurityManager#checkRead(FileDescriptor)
-	 */
-	public long lastModified() {
-		SecurityManager security = System.getSecurityManager();
-		if (security != null) {
+    private native byte[] getLinkImpl(byte[] filePath);
+
+    /**
+     * Answers the time this File was last modified.
+     * 
+     * @return the time this File was last modified.
+     * 
+     * @see #getPath
+     * @see java.lang.SecurityManager#checkRead(FileDescriptor)
+     */
+    public long lastModified() {
+        SecurityManager security = System.getSecurityManager();
+        if (security != null) {
             security.checkRead(path);
         }
-		long result = lastModifiedImpl(properPath(true));
-		/* Temporary code to handle both return cases until natives fixed */
-		if (result == -1 || result == 0) {
+        long result = lastModifiedImpl(properPath(true));
+        /* Temporary code to handle both return cases until natives fixed */
+        if (result == -1 || result == 0) {
             return 0;
         }
-		return (result * 1000);
-	}
+        return (result * 1000);
+    }
 
-	private native long lastModifiedImpl(byte[] filePath);
+    private native long lastModifiedImpl(byte[] filePath);
 
-	/**
-	 * Sets the time this File was last modified.
-	 * 
-	 * @param time
-	 *            The time to set the file as last modified.
-	 * @return the time this File was last modified.
-	 * 
-	 * @see java.lang.SecurityManager#checkWrite(FileDescriptor)
-	 */
-	public boolean setLastModified(long time) {
-		if (time >= 0) {
-			SecurityManager security = System.getSecurityManager();
-			if (security != null) {
-                security.checkWrite(path);
-            }
-			return (setLastModifiedImpl(properPath(true), time));
-		}
-		throw new IllegalArgumentException(Msg
-				.getString("K006a")); //$NON-NLS-1$
-	}
-
-	private native boolean setLastModifiedImpl(byte[] path, long time);
-
-	/**
-	 * Marks this file or directory to be read-only as defined by the operating
-	 * system.
-	 * 
-	 * @return <code>true</code> if the operation was a success,
-	 *         <code>false</code> otherwise
-	 */
-	public boolean setReadOnly() {
-		SecurityManager security = System.getSecurityManager();
-		if (security != null) {
+    /**
+     * Sets the time this File was last modified.
+     * 
+     * @param time
+     *            The time to set the file as last modified.
+     * @return the time this File was last modified.
+     * 
+     * @see java.lang.SecurityManager#checkWrite(FileDescriptor)
+     */
+    public boolean setLastModified(long time) {
+        if (time < 0) {
+            throw new IllegalArgumentException(Msg.getString("K006a")); //$NON-NLS-1$
+        }
+        SecurityManager security = System.getSecurityManager();
+        if (security != null) {
             security.checkWrite(path);
         }
-		return (setReadOnlyImpl(properPath(true)));
-	}
+        return (setLastModifiedImpl(properPath(true), time));
+    }
 
-	private native boolean setReadOnlyImpl(byte[] path);
+    private native boolean setLastModifiedImpl(byte[] path, long time);
 
-	/**
-	 * Answers the length of this File in bytes.
-	 * 
-	 * @return the number of bytes in the file.
-	 * 
-	 * @see #getPath
-	 * @see java.lang.SecurityManager#checkRead(FileDescriptor)
-	 */
-	public long length() {
-		SecurityManager security = System.getSecurityManager();
-		if (security != null) {
+    /**
+     * Marks this file or directory to be read-only as defined by the operating
+     * system.
+     * 
+     * @return <code>true</code> if the operation was a success,
+     *         <code>false</code> otherwise
+     */
+    public boolean setReadOnly() {
+        SecurityManager security = System.getSecurityManager();
+        if (security != null) {
+            security.checkWrite(path);
+        }
+        return (setReadOnlyImpl(properPath(true)));
+    }
+
+    private native boolean setReadOnlyImpl(byte[] path);
+
+    /**
+     * Answers the length of this File in bytes.
+     * 
+     * @return the number of bytes in the file.
+     * 
+     * @see #getPath
+     * @see java.lang.SecurityManager#checkRead(FileDescriptor)
+     */
+    public long length() {
+        SecurityManager security = System.getSecurityManager();
+        if (security != null) {
             security.checkRead(path);
         }
-		return lengthImpl(properPath(true));
-	}
+        return lengthImpl(properPath(true));
+    }
 
-	private native long lengthImpl(byte[] filePath);
+    private native long lengthImpl(byte[] filePath);
 
-	/**
-	 * Answers an array of Strings representing the file names in the directory
-	 * represented by this File. If this File is not a directory the result is
-	 * <code>null</code>.
-	 * <p>
-	 * The entries <code>.</code> and <code>..</code> representing current
-	 * directory and parent directory are not returned as part of the list.
-	 * 
-	 * @return an array of Strings or <code>null</code>.
-	 * 
-	 * @see #getPath
-	 * @see #isDirectory
-	 * @see java.lang.SecurityManager#checkRead(FileDescriptor)
-	 */
-	public java.lang.String[] list() {
-		SecurityManager security = System.getSecurityManager();
-		if (security != null) {
+    /**
+     * Answers an array of Strings representing the file names in the directory
+     * represented by this File. If this File is not a directory the result is
+     * <code>null</code>.
+     * <p>
+     * The entries <code>.</code> and <code>..</code> representing current
+     * directory and parent directory are not returned as part of the list.
+     * 
+     * @return an array of Strings or <code>null</code>.
+     * 
+     * @see #getPath
+     * @see #isDirectory
+     * @see java.lang.SecurityManager#checkRead(FileDescriptor)
+     */
+    public java.lang.String[] list() {
+        SecurityManager security = System.getSecurityManager();
+        if (security != null) {
             security.checkRead(path);
         }
-		if (!isDirectory()) {
+        if (!isDirectory()) {
             return null;
         }
-		byte[][] implList = listImpl(properPath(true));
-		if (implList == null) {
+        byte[][] implList = listImpl(properPath(true));
+        if (implList == null) {
             return new String[0];
         }
-		String result[] = new String[implList.length];
-		for (int index = 0; index < implList.length; index++) {
+        String result[] = new String[implList.length];
+        for (int index = 0; index < implList.length; index++) {
             result[index] = Util.toString(implList[index]);
         }
-		return result;
-	}
+        return result;
+    }
 
-	/**
-	 * Answers an array of Files representing the file names in the directory
-	 * represented by this File. If this File is not a directory the result is
-	 * <code>null</code>. The Files returned will be absolute if this File is
-	 * absolute, relative otherwise.
-	 * 
-	 * @return an array of Files or <code>null</code>.
-	 * 
-	 * @see #getPath
-	 * @see #list()
-	 * @see #isDirectory
-	 */
-	public File[] listFiles() {
-		String[] tempNames = list();
-		if (tempNames == null) {
+    /**
+     * Answers an array of Files representing the file names in the directory
+     * represented by this File. If this File is not a directory the result is
+     * <code>null</code>. The Files returned will be absolute if this File is
+     * absolute, relative otherwise.
+     * 
+     * @return an array of Files or <code>null</code>.
+     * 
+     * @see #getPath
+     * @see #list()
+     * @see #isDirectory
+     */
+    public File[] listFiles() {
+        String[] tempNames = list();
+        if (tempNames == null) {
             return null;
         }
-		int resultLength = tempNames.length;
-		File results[] = new File[resultLength];
-		for (int i = 0; i < resultLength; i++) {
+        int resultLength = tempNames.length;
+        File results[] = new File[resultLength];
+        for (int i = 0; i < resultLength; i++) {
             results[i] = new File(this, tempNames[i]);
         }
-		return results;
-	}
+        return results;
+    }
 
-	/**
-	 * Answers an array of Files representing the file names in the directory
-	 * represented by this File that match a specific filter. If this File is
-	 * not a directory the result is <code>null</code>. If the filter is
-	 * <code>null</code> then all filenames match.
-	 * <p>
-	 * The entries <code>.</code> and <code>..</code> representing current
-	 * directory and parent directory are not returned as part of the list.
-	 * 
-	 * @param filter
-	 *            the filter to match names to or <code>null</code>.
-	 * @return an array of Files or <code>null</code>.
-	 * 
-	 * @see #list(FilenameFilter filter)
-	 * @see #getPath
-	 * @see #isDirectory
-	 * @see java.lang.SecurityManager#checkRead(FileDescriptor)
-	 */
-	public File[] listFiles(FilenameFilter filter) {
-		String[] tempNames = list(filter);
-		if (tempNames == null) {
+    /**
+     * Answers an array of Files representing the file names in the directory
+     * represented by this File that match a specific filter. If this File is
+     * not a directory the result is <code>null</code>. If the filter is
+     * <code>null</code> then all filenames match.
+     * <p>
+     * The entries <code>.</code> and <code>..</code> representing current
+     * directory and parent directory are not returned as part of the list.
+     * 
+     * @param filter
+     *            the filter to match names to or <code>null</code>.
+     * @return an array of Files or <code>null</code>.
+     * 
+     * @see #list(FilenameFilter filter)
+     * @see #getPath
+     * @see #isDirectory
+     * @see java.lang.SecurityManager#checkRead(FileDescriptor)
+     */
+    public File[] listFiles(FilenameFilter filter) {
+        String[] tempNames = list(filter);
+        if (tempNames == null) {
             return null;
         }
-		int resultLength = tempNames.length;
-		File results[] = new File[resultLength];
-		for (int i = 0; i < resultLength; i++) {
+        int resultLength = tempNames.length;
+        File results[] = new File[resultLength];
+        for (int i = 0; i < resultLength; i++) {
             results[i] = new File(this, tempNames[i]);
         }
-		return results;
-	}
+        return results;
+    }
 
-	/**
-	 * Answers an array of Files representing the file names in the directory
-	 * represented by this File that match a specific filter. If this File is
-	 * not a directory the result is <code>null</code>. If the filter is
-	 * <code>null</code> then all filenames match.
-	 * <p>
-	 * The entries <code>.</code> and <code>..</code> representing current
-	 * directory and parent directory are not returned as part of the list.
-	 * 
-	 * @param filter
-	 *            the filter to match names to or <code>null</code>.
-	 * @return an array of Files or <code>null</code>.
-	 * 
-	 * @see #getPath
-	 * @see #isDirectory
-	 * @see java.lang.SecurityManager#checkRead(FileDescriptor)
-	 */
-	public File[] listFiles(FileFilter filter) {
-		SecurityManager security = System.getSecurityManager();
-		if (security != null) {
+    /**
+     * Answers an array of Files representing the file names in the directory
+     * represented by this File that match a specific filter. If this File is
+     * not a directory the result is <code>null</code>. If the filter is
+     * <code>null</code> then all filenames match.
+     * <p>
+     * The entries <code>.</code> and <code>..</code> representing current
+     * directory and parent directory are not returned as part of the list.
+     * 
+     * @param filter
+     *            the filter to match names to or <code>null</code>.
+     * @return an array of Files or <code>null</code>.
+     * 
+     * @see #getPath
+     * @see #isDirectory
+     * @see java.lang.SecurityManager#checkRead(FileDescriptor)
+     */
+    public File[] listFiles(FileFilter filter) {
+        SecurityManager security = System.getSecurityManager();
+        if (security != null) {
             security.checkRead(path);
         }
-		if (!isDirectory()) {
+        if (!isDirectory()) {
             return null;
         }
-		byte[][] implList = listImpl(properPath(true));
-		if (implList == null) {
+        byte[][] implList = listImpl(properPath(true));
+        if (implList == null) {
             return new File[0];
         }
-		List<File> tempResult = new ArrayList<File>();
-		for (int index = 0; index < implList.length; index++) {
-			String aName = Util.toString(implList[index]);
-			File aFile = new File(this, aName);
-			if (filter == null || filter.accept(aFile)) {
+        List<File> tempResult = new ArrayList<File>();
+        for (int index = 0; index < implList.length; index++) {
+            String aName = Util.toString(implList[index]);
+            File aFile = new File(this, aName);
+            if (filter == null || filter.accept(aFile)) {
                 tempResult.add(aFile);
             }
-		}
-		return tempResult.toArray(new File[tempResult.size()]);
-	}
-
-	/**
-	 * Answers an array of Strings representing the file names in the directory
-	 * represented by this File that match a specific filter. If this File is
-	 * not a directory the result is <code>null</code>. If the filter is
-	 * <code>null</code> then all filenames match.
-	 * <p>
-	 * The entries <code>.</code> and <code>..</code> representing current
-	 * directory and parent directory are not returned as part of the list.
-	 * 
-	 * @param filter
-	 *            the filter to match names to or <code>null</code>.
-	 * @return an array of Strings or <code>null</code>.
-	 * 
-	 * @see #getPath
-	 * @see #isDirectory
-	 * @see java.lang.SecurityManager#checkRead(FileDescriptor)
-	 */
-	public java.lang.String[] list(FilenameFilter filter) {
-		SecurityManager security = System.getSecurityManager();
-		if (security != null) {
+        }
+        return tempResult.toArray(new File[tempResult.size()]);
+    }
+
+    /**
+     * Answers an array of Strings representing the file names in the directory
+     * represented by this File that match a specific filter. If this File is
+     * not a directory the result is <code>null</code>. If the filter is
+     * <code>null</code> then all filenames match.
+     * <p>
+     * The entries <code>.</code> and <code>..</code> representing current
+     * directory and parent directory are not returned as part of the list.
+     * 
+     * @param filter
+     *            the filter to match names to or <code>null</code>.
+     * @return an array of Strings or <code>null</code>.
+     * 
+     * @see #getPath
+     * @see #isDirectory
+     * @see java.lang.SecurityManager#checkRead(FileDescriptor)
+     */
+    public java.lang.String[] list(FilenameFilter filter) {
+        SecurityManager security = System.getSecurityManager();
+        if (security != null) {
             security.checkRead(path);
         }
-		if (!isDirectory()) {
+        if (!isDirectory()) {
             return null;
         }
-		byte[][] implList = listImpl(properPath(true));
-		if (implList == null) {
+        byte[][] implList = listImpl(properPath(true));
+        if (implList == null) {
             return new String[0];
         }
-		java.util.Vector<String> tempResult = new java.util.Vector<String>();
-		for (int index = 0; index < implList.length; index++) {
-			String aName = Util.toString(implList[index]);
-			if (filter == null || filter.accept(this, aName)) {
+        java.util.Vector<String> tempResult = new java.util.Vector<String>();
+        for (int index = 0; index < implList.length; index++) {
+            String aName = Util.toString(implList[index]);
+            if (filter == null || filter.accept(this, aName)) {
                 tempResult.addElement(aName);
             }
-		}
-		String[] result = new String[tempResult.size()];
-		tempResult.copyInto(result);
-		return result;
-	}
-
-	private synchronized static native byte[][] listImpl(byte[] path);
-
-	/**
-	 * Creates the directory named by the trailing filename of this File. Not
-	 * all directories required to create this File are created.
-	 * 
-	 * @return <code>true</code> if the directory was created,
-	 *         <code>false</code> otherwise.
-	 * 
-	 * @see #getPath
-	 * @see java.lang.SecurityManager#checkWrite(FileDescriptor)
-	 */
-	public boolean mkdir() {
-		SecurityManager security = System.getSecurityManager();
-		if (security != null) {
+        }
+        String[] result = new String[tempResult.size()];
+        tempResult.copyInto(result);
+        return result;
+    }
+
+    private synchronized static native byte[][] listImpl(byte[] path);
+
+    /**
+     * Creates the directory named by the trailing filename of this File. Not
+     * all directories required to create this File are created.
+     * 
+     * @return <code>true</code> if the directory was created,
+     *         <code>false</code> otherwise.
+     * 
+     * @see #getPath
+     * @see java.lang.SecurityManager#checkWrite(FileDescriptor)
+     */
+    public boolean mkdir() {
+        SecurityManager security = System.getSecurityManager();
+        if (security != null) {
             security.checkWrite(path);
         }
-		return mkdirImpl(properPath(true));
-	}
+        return mkdirImpl(properPath(true));
+    }
 
-	private native boolean mkdirImpl(byte[] filePath);
+    private native boolean mkdirImpl(byte[] filePath);
 
-	/**
-	 * Create all the directories needed for this File. If the terminal
-	 * directory already exists, answer false. If the directories were created
-	 * successfully, answer <code>true</code>.
-	 * 
-	 * @return <code>true</code> if the necessary directories were created,
-	 *         <code>false</code> otherwise.
-	 * 
-	 */
-	public boolean mkdirs() {
-		/* If the terminal directory already exists, answer false */
-		if (exists()) {
+    /**
+     * Create all the directories needed for this File. If the terminal
+     * directory already exists, answer false. If the directories were created
+     * successfully, answer <code>true</code>.
+     * 
+     * @return <code>true</code> if the necessary directories were created,
+     *         <code>false</code> otherwise.
+     * 
+     */
+    public boolean mkdirs() {
+        /* If the terminal directory already exists, answer false */
+        if (exists()) {
             return false;
         }
 
-		/* If the receiver can be created, answer true */
-		if (mkdir()) {
+        /* If the receiver can be created, answer true */
+        if (mkdir()) {
             return true;
         }
 
-		String parentDir = getParent();
-		/* If there is no parent and we were not created, answer false */
-		if (parentDir == null) {
+        String parentDir = getParent();
+        /* If there is no parent and we were not created, answer false */
+        if (parentDir == null) {
             return false;
         }
 
-		/* Otherwise, try to create a parent directory and then this directory */
-		return (new File(parentDir).mkdirs() && mkdir());
-	}
-
-	/**
-	 * Creates the file specified by this File. If the file already exists this
-	 * method returns <code>false</code>. Otherwise, if the file is created
-	 * successfully, the result is <code>true</code>. An IOException will be
-	 * thrown if the directory to contain this file does not exist.
-	 * 
-	 * @return <code>true</code> if this File was created, <code>false</code>
-	 *         otherwise.
-	 * 
-	 * @throws IOException
-	 *             if an I/O error occurs or the directory does not exist.
-	 * 
-	 * @see java.lang.SecurityManager#checkWrite(FileDescriptor)
-	 */
-	public boolean createNewFile() throws IOException {
-		SecurityManager security = System.getSecurityManager();
-		if (security != null) {
+        /* Otherwise, try to create a parent directory and then this directory */
+        return (new File(parentDir).mkdirs() && mkdir());
+    }
+
+    /**
+     * Creates the file specified by this File. If the file already exists this
+     * method returns <code>false</code>. Otherwise, if the file is created
+     * successfully, the result is <code>true</code>. An IOException will be
+     * thrown if the directory to contain this file does not exist.
+     * 
+     * @return <code>true</code> if this File was created, <code>false</code>
+     *         otherwise.
+     * 
+     * @throws IOException
+     *             if an I/O error occurs or the directory does not exist.
+     * 
+     * @see java.lang.SecurityManager#checkWrite(FileDescriptor)
+     */
+    public boolean createNewFile() throws IOException {
+        SecurityManager security = System.getSecurityManager();
+        if (security != null) {
             security.checkWrite(path);
         }
-        if(0 == path.length()) {
+        if (0 == path.length()) {
             throw new IOException(Msg.getString("KA012")); //$NON-NLS-1$
         }
-		int result = newFileImpl(properPath(true));
-		switch (result) {
-		case 0:
-			return true;
-		case 1:
-            return false;
-		default:
-			throw new IOException(Msg.getString("K01c2", path)); //$NON-NLS-1$
-		}
-	}
-
-	private native int newFileImpl(byte[] filePath);
-
-	/**
-	 * Creates an empty temporary file using the given prefix and suffix as part
-	 * of the file name. If suffix is null, <code>.tmp</code> is used.
-	 * 
-	 * @param prefix
-	 *            the prefix to the temp file name
-	 * @param suffix
-	 *            the suffix to the temp file name
-	 * @return the temporary file
-	 * 
-	 * @throws IOException
-	 *             If an error occurs when writing the file
-	 */
-	public static File createTempFile(String prefix, String suffix)
-			throws IOException {
-		return createTempFile(prefix, suffix, null);
-	}
-
-	/**
-	 * Creates an empty temporary file in the given directory using the given
-	 * prefix and suffix as part of the file name.
-	 * 
-	 * @param prefix
-	 *            the prefix to the temp file name
-	 * @param suffix
-	 *            the suffix to the temp file name
-	 * @param directory
-	 *            the location to which the temp file is to be written, or null
-	 *            for the default temp location
-	 * @return the temporary file
-	 * 
-	 * @throws IOException
-	 *             If an error occurs when writing the file
-	 */
-	public static File createTempFile(String prefix, String suffix,
-			File directory) throws IOException {
-		if (prefix != null) {
-			if (prefix.length() >= 3) {
-				String newSuffix = suffix == null ? ".tmp" : suffix; //$NON-NLS-1$
-				String tmpDir = "."; //$NON-NLS-1$
-				tmpDir = AccessController.doPrivileged(new PriviAction<String>("java.io.tmpdir", "."));   //$NON-NLS-1$//$NON-NLS-2$
-				File result, tmpDirFile = directory == null ? new File(tmpDir)
-						: directory;
-				do {
-					result = genTempFile(prefix, newSuffix, tmpDirFile);
-				} while (!result.createNewFile());
-				return result;
-			}
-			throw new IllegalArgumentException(Msg
-					.getString("K006b")); //$NON-NLS-1$
-		}
-		throw new NullPointerException();
-	}
-
-	private static File genTempFile(String prefix, String suffix, File directory) {
-		if (counter == 0) {
-			int newInt = new java.util.Random().nextInt();
-			counter = ((newInt / 65535) & 0xFFFF) + 0x2710;
-		}
-		StringBuilder newName = new StringBuilder();
-		newName.append(prefix);
-		newName.append(counter++);
-		newName.append(suffix);
-		return new File(directory, newName.toString());
-	}
-
-	/**
-	 * Answer a String representing the proper path for the receiver. If the
-	 * receiver is absolute do not prepend the user.dir property, otherwise do.
-	 * 
-	 * @param internal
-	 *            is user.dir internal
-	 * @return the proper path
-	 */
-	byte[] properPath(boolean internal) {
-		if (properPath != null) {
+        int result = newFileImpl(properPath(true));
+        switch (result) {
+            case 0:
+                return true;
+            case 1:
+                return false;
+            default:
+                throw new IOException(Msg.getString("K01c2", path)); //$NON-NLS-1$
+        }
+    }
+
+    private native int newFileImpl(byte[] filePath);
+
+    /**
+     * Creates an empty temporary file using the given prefix and suffix as part
+     * of the file name. If suffix is null, <code>.tmp</code> is used.
+     * 
+     * @param prefix
+     *            the prefix to the temp file name
+     * @param suffix
+     *            the suffix to the temp file name
+     * @return the temporary file
+     * 
+     * @throws IOException
+     *             If an error occurs when writing the file
+     */
+    public static File createTempFile(String prefix, String suffix)
+            throws IOException {
+        return createTempFile(prefix, suffix, null);
+    }
+
+    /**
+     * Creates an empty temporary file in the given directory using the given
+     * prefix and suffix as part of the file name.
+     * 
+     * @param prefix
+     *            the prefix to the temp file name
+     * @param suffix
+     *            the suffix to the temp file name
+     * @param directory
+     *            the location to which the temp file is to be written, or null
+     *            for the default temp location
+     * @return the temporary file
+     * 
+     * @throws IOException
+     *             If an error occurs when writing the file
+     */
+    public static File createTempFile(String prefix, String suffix,
+            File directory) throws IOException {
+        // Force a prefix null check first
+        if (prefix.length() < 3) {
+            throw new IllegalArgumentException(Msg.getString("K006b")); //$NON-NLS-1$
+        }
+        String newSuffix = suffix == null ? ".tmp" : suffix; //$NON-NLS-1$
+        String tmpDir = "."; //$NON-NLS-1$
+        tmpDir = AccessController.doPrivileged(new PriviAction<String>(
+                "java.io.tmpdir", ".")); //$NON-NLS-1$//$NON-NLS-2$
+        File result, tmpDirFile = directory == null ? new File(tmpDir)
+                : directory;
+        do {
+            result = genTempFile(prefix, newSuffix, tmpDirFile);
+        } while (!result.createNewFile());
+        return result;
+    }
+
+    private static File genTempFile(String prefix, String suffix, File directory) {
+        if (counter == 0) {
+            int newInt = new java.util.Random().nextInt();
+            counter = ((newInt / 65535) & 0xFFFF) + 0x2710;
+        }
+        StringBuilder newName = new StringBuilder();
+        newName.append(prefix);
+        newName.append(counter++);
+        newName.append(suffix);
+        return new File(directory, newName.toString());
+    }
+
+    /**
+     * Answer a String representing the proper path for the receiver. If the
+     * receiver is absolute do not prepend the user.dir property, otherwise do.
+     * 
+     * @param internal
+     *            is user.dir internal
+     * @return the proper path
+     */
+    byte[] properPath(boolean internal) {
+        if (properPath != null) {
             return properPath;
         }
-		byte[] pathBytes = Util.getBytes(path);
-		if (isAbsoluteImpl(pathBytes)) {
+        byte[] pathBytes = Util.getBytes(path);
+        if (isAbsoluteImpl(pathBytes)) {
             return properPath = pathBytes;
         }
-		// Check security by getting user.dir when the path is not absolute
-		String userdir;
-		if (internal) {
-			userdir = AccessController.doPrivileged(new PriviAction<String>("user.dir")); //$NON-NLS-1$
-		} else {
+        // Check security by getting user.dir when the path is not absolute
+        String userdir;
+        if (internal) {
+            userdir = AccessController.doPrivileged(new PriviAction<String>(
+                    "user.dir")); //$NON-NLS-1$
+        } else {
             userdir = System.getProperty("user.dir"); //$NON-NLS-1$
         }
-		if ((properPath = properPathImpl(pathBytes)) != null) {
+        if ((properPath = properPathImpl(pathBytes)) != null) {
             return properPath;
         }
-		if (path.length() == 0) {
+        if (path.length() == 0) {
             return properPath = Util.getBytes(userdir);
         }
-		int length = userdir.length();
-		if (path.charAt(0) == '\\') {
-			if (length > 1 && userdir.charAt(1) == ':') {
-				return properPath = Util.getBytes(userdir
-						.substring(0, 2)
-						+ path);
-			}
-			if (length > 0 && userdir.charAt(length - 1) == separatorChar) {
-				return properPath = Util.getBytes(userdir
-						+ path.substring(1));
-			}
-			return properPath = Util.getBytes(userdir + path);
-		}
-		if (length > 0 && userdir.charAt(length - 1) == separatorChar) {
-			return properPath = Util.getBytes(userdir + path);
-		}
-		return properPath = Util.getBytes(userdir + separator
-				+ path);
-	}
-
-	private static native byte[] properPathImpl(byte[] path);
-
-	/**
-	 * Renames this File to the name represented by the File <code>dest</code>.
-	 * This works for both normal files and directories.
-	 * 
-	 * @param dest
-	 *            the File containing the new name.
-	 * @return <code>true</code> if the File was renamed, <code>false</code>
-	 *         otherwise.
-	 * 
-	 * @see #getPath
-	 * @see java.lang.SecurityManager#checkRead(FileDescriptor)
-	 * @see java.lang.SecurityManager#checkWrite(FileDescriptor)
-	 */
-	public boolean renameTo(java.io.File dest) {
-		SecurityManager security = System.getSecurityManager();
-		if (security != null) {
-			security.checkWrite(path);
-			security.checkWrite(dest.path);
-		}
-		return renameToImpl(properPath(true), dest.properPath(true));
-	}
-
-	private native boolean renameToImpl(byte[] pathExist, byte[] pathNew);
-
-	/**
-	 * Answers a string containing a concise, human-readable description of the
-	 * receiver.
-	 * 
-	 * @return a printable representation for the receiver.
-	 */
-	@Override
+        int length = userdir.length();
+        if (path.charAt(0) == '\\') {
+            if (length > 1 && userdir.charAt(1) == ':') {
+                return properPath = Util.getBytes(userdir.substring(0, 2)
+                        + path);
+            }
+            if (length > 0 && userdir.charAt(length - 1) == separatorChar) {
+                return properPath = Util.getBytes(userdir + path.substring(1));
+            }
+            return properPath = Util.getBytes(userdir + path);
+        }
+        if (length > 0 && userdir.charAt(length - 1) == separatorChar) {
+            return properPath = Util.getBytes(userdir + path);
+        }
+        return properPath = Util.getBytes(userdir + separator + path);
+    }
+
+    private static native byte[] properPathImpl(byte[] path);
+
+    /**
+     * Renames this File to the name represented by the File <code>dest</code>.
+     * This works for both normal files and directories.
+     * 
+     * @param dest
+     *            the File containing the new name.
+     * @return <code>true</code> if the File was renamed, <code>false</code>
+     *         otherwise.
+     * 
+     * @see #getPath
+     * @see java.lang.SecurityManager#checkRead(FileDescriptor)
+     * @see java.lang.SecurityManager#checkWrite(FileDescriptor)
+     */
+    public boolean renameTo(java.io.File dest) {
+        SecurityManager security = System.getSecurityManager();
+        if (security != null) {
+            security.checkWrite(path);
+            security.checkWrite(dest.path);
+        }
+        return renameToImpl(properPath(true), dest.properPath(true));
+    }
+
+    private native boolean renameToImpl(byte[] pathExist, byte[] pathNew);
+
+    /**
+     * Answers a string containing a concise, human-readable description of the
+     * receiver.
+     * 
+     * @return a printable representation for the receiver.
+     */
+    @Override
     public String toString() {
-		return path;
-	}
+        return path;
+    }
 
-	/**
-	 * Answers a <code>file</code> URI for this File. The URI is System
-	 * dependent and may not be transferable between different operating/file
-	 * systems.
-	 * 
-	 * @return a <code>file</code> URI for this File.
-	 */
-	public URI toURI() {
-		String name = getAbsoluteName();
-		try {
-			if (!name.startsWith("/")) { //$NON-NLS-1$
+    /**
+     * Answers a <code>file</code> URI for this File. The URI is System
+     * dependent and may not be transferable between different operating/file
+     * systems.
+     * 
+     * @return a <code>file</code> URI for this File.
+     */
+    public URI toURI() {
+        String name = getAbsoluteName();
+        try {
+            if (!name.startsWith("/")) { //$NON-NLS-1$
                 // start with sep.
-				return new URI("file", null, //$NON-NLS-1$
-						new StringBuilder(name.length() + 1).append('/').append(
-								name).toString(), null, null);
+                return new URI("file", null, //$NON-NLS-1$
+                        new StringBuilder(name.length() + 1).append('/')
+                                .append(name).toString(), null, null);
             } else if (name.startsWith("//")) { //$NON-NLS-1$
                 return new URI("file", name, null); // UNC path //$NON-NLS-1$
             }
-			return new URI("file", null, name, null, null); //$NON-NLS-1$
-		} catch (URISyntaxException e) {
-			// this should never happen
-			return null;
-		}
-	}
-
-	/**
-	 * Answers a <code>file</code> URL for this File. The URL is System
-	 * dependent and may not be transferable between different operating/file
-	 * systems.
-	 * 
-	 * @return a <code>file</code> URL for this File.
-	 * 
-	 * @throws java.net.MalformedURLException
-	 *             if the path cannot be transformed into an URL
-	 */
-	public URL toURL() throws java.net.MalformedURLException {
-		String name = getAbsoluteName();
-		if (!name.startsWith("/")) { //$NON-NLS-1$
+            return new URI("file", null, name, null, null); //$NON-NLS-1$
+        } catch (URISyntaxException e) {
+            // this should never happen
+            return null;
+        }
+    }
+
+    /**
+     * Answers a <code>file</code> URL for this File. The URL is System
+     * dependent and may not be transferable between different operating/file
+     * systems.
+     * 
+     * @return a <code>file</code> URL for this File.
+     * 
+     * @throws java.net.MalformedURLException
+     *             if the path cannot be transformed into an URL
+     */
+    public URL toURL() throws java.net.MalformedURLException {
+        String name = getAbsoluteName();
+        if (!name.startsWith("/")) { //$NON-NLS-1$
             // start with sep.
-			return new URL("file", "", -1, new StringBuilder(name.length() + 1) //$NON-NLS-1$ //$NON-NLS-2$
-					.append('/').append(name).toString(), null);
+            return new URL("file", "", -1, new StringBuilder(name.length() + 1) //$NON-NLS-1$ //$NON-NLS-2$
+                    .append('/').append(name).toString(), null);
         } else if (name.startsWith("//")) { //$NON-NLS-1$
             return new URL("file:" + name); // UNC path //$NON-NLS-1$
         }
-		return new URL("file", "", -1, name, null); //$NON-NLS-1$ //$NON-NLS-2$
-	}
+        return new URL("file", "", -1, name, null); //$NON-NLS-1$ //$NON-NLS-2$
+    }
 
-	private String getAbsoluteName() {
+    private String getAbsoluteName() {
         String name = getAbsolutePath();
         if (isDirectory() && name.charAt(name.length() - 1) != separatorChar) {
             // Directories must end with a slash
@@ -1315,17 +1301,16 @@
         return name;
     }
 
-	private void writeObject(ObjectOutputStream stream) throws IOException {
-		stream.defaultWriteObject();
-		stream.writeChar(separatorChar);
-
-	}
-
-	private void readObject(ObjectInputStream stream) throws IOException,
-			ClassNotFoundException {
-		stream.defaultReadObject();
-		char inSeparator = stream.readChar();
-		path = path.replace(inSeparator, separatorChar);
-	}
+    private void writeObject(ObjectOutputStream stream) throws IOException {
+        stream.defaultWriteObject();
+        stream.writeChar(separatorChar);
+
+    }
 
+    private void readObject(ObjectInputStream stream) throws IOException,
+            ClassNotFoundException {
+        stream.defaultReadObject();
+        char inSeparator = stream.readChar();
+        path = path.replace(inSeparator, separatorChar);
+    }
 }

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FileDescriptor.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FileDescriptor.java?view=diff&rev=492652&r1=492651&r2=492652
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FileDescriptor.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FileDescriptor.java Thu Jan  4 09:47:01 2007
@@ -15,8 +15,7 @@
  *  limitations under the License.
  */
 
-package java.io; 
-
+package java.io;
 
 /**
  * FileDescriptor is the lowest level representation of a File, Device, or
@@ -35,56 +34,55 @@
  * @see RandomAccessFile#getFD()
  */
 public final class FileDescriptor {
-	/** FileDescriptor representing Standard In */
-	public static final FileDescriptor in = new FileDescriptor();
 
-	/** FileDescriptor representing Standard Out */
-	public static final FileDescriptor out = new FileDescriptor();
+    /** FileDescriptor representing Standard In */
+    public static final FileDescriptor in = new FileDescriptor();
 
-	/** FileDescriptor representing Standard Error */
-	public static final FileDescriptor err = new FileDescriptor();
+    /** FileDescriptor representing Standard Out */
+    public static final FileDescriptor out = new FileDescriptor();
 
-	/**
-	 * Represents a link to any underlying OS resources for this FileDescriptor.
-	 * A value of -1 indicates that this FileDescriptor is invalid.
-	 */
-	long descriptor = -1;
-
-	private static native void oneTimeInitialization();
-
-	static {
-		in.descriptor = 0;
-		out.descriptor = 1;
-		err.descriptor = 2;
-
-		oneTimeInitialization();
-	}
-
-	/**
-	 * Constructs a new FileDescriptor containing an invalid handle. This
-	 * constructor does nothing interesting. Provided for signature
-	 * compatibility.
-	 * 
-	 */
-	public FileDescriptor() {
-		super();
-	}
-
-	/**
-	 * Ensures that data which is buffered within the underlying implementation
-	 * is written out to the appropriate device before returning.
-	 * 
-	 * @throws SyncFailedException
-	 *             when the operation fails
-	 */
-	public native void sync() throws SyncFailedException;
-
-	/**
-	 * Answers a boolean indicating whether or not this FileDescriptor is valid.
-	 * 
-	 * @return <code>true</code> if this FileDescriptor is valid,
-	 *         <code>false</code> otherwise
-	 */
-	public native boolean valid();
+    /** FileDescriptor representing Standard Error */
+    public static final FileDescriptor err = new FileDescriptor();
 
+    /**
+     * Represents a link to any underlying OS resources for this FileDescriptor.
+     * A value of -1 indicates that this FileDescriptor is invalid.
+     */
+    long descriptor = -1;
+
+    private static native void oneTimeInitialization();
+
+    static {
+        in.descriptor = 0;
+        out.descriptor = 1;
+        err.descriptor = 2;
+
+        oneTimeInitialization();
+    }
+
+    /**
+     * Constructs a new FileDescriptor containing an invalid handle. This
+     * constructor does nothing interesting. Provided for signature
+     * compatibility.
+     */
+    public FileDescriptor() {
+        super();
+    }
+
+    /**
+     * Ensures that data which is buffered within the underlying implementation
+     * is written out to the appropriate device before returning.
+     * 
+     * @throws SyncFailedException
+     *             when the operation fails
+     */
+    public native void sync() throws SyncFailedException;
+
+    /**
+     * Answers a boolean indicating whether or not this FileDescriptor is valid.
+     * 
+     * @return <code>true</code> if this FileDescriptor is valid,
+     *         <code>false</code> otherwise
+     */
+    public native boolean valid();
 }

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FileInputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FileInputStream.java?view=diff&rev=492652&r1=492651&r2=492652
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FileInputStream.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FileInputStream.java Thu Jan  4 09:47:01 2007
@@ -45,7 +45,9 @@
 
     private IFileSystem fileSystem = Platform.getFileSystem();
 
-    private static class RepositioningLock {}
+    private static class RepositioningLock {
+    }
+
     private Object repositioningLock = new RepositioningLock();
 
     /**
@@ -72,7 +74,7 @@
         fd = new FileDescriptor();
         fd.descriptor = fileSystem.open(file.properPath(true),
                 IFileSystem.O_RDONLY);
-		innerFD = true;
+        innerFD = true;
         channel = FileChannelFactory.getFileChannel(this, fd.descriptor,
                 IFileSystem.O_RDONLY);
     }
@@ -169,7 +171,7 @@
                 }
             }
         }
-	synchronized (this) {
+        synchronized (this) {
             if (fd.descriptor >= 0 && innerFD) {
                 fileSystem.close(fd.descriptor);
                 fd.descriptor = -1;

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FileNotFoundException.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FileNotFoundException.java?view=diff&rev=492652&r1=492651&r2=492652
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FileNotFoundException.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FileNotFoundException.java Thu Jan  4 09:47:01 2007
@@ -15,34 +15,31 @@
  *  limitations under the License.
  */
 
-package java.io; 
-
+package java.io;
 
 /**
  * This IO exception is thrown when a file specified by a program cannot be
  * found.
- * 
  */
 public class FileNotFoundException extends IOException {
 
     private static final long serialVersionUID = -897856973823710492L;
-    
-	/**
-	 * Constructs a new instance of this class with its walkback filled in.
-	 */
-	public FileNotFoundException() {
-		super();
-	}
 
-	/**
-	 * Constructs a new instance of this class with its walkback and message
-	 * filled in.
-	 * 
-	 * @param detailMessage
-	 *            The detail message for the exception.
-	 */
-	public FileNotFoundException(String detailMessage) {
-		super(detailMessage);
-	}
+    /**
+     * Constructs a new instance of this class with its walkback filled in.
+     */
+    public FileNotFoundException() {
+        super();
+    }
 
+    /**
+     * Constructs a new instance of this class with its walkback and message
+     * filled in.
+     * 
+     * @param detailMessage
+     *            The detail message for the exception.
+     */
+    public FileNotFoundException(String detailMessage) {
+        super(detailMessage);
+    }
 }



Mime
View raw message