How to move directories using jdk7
Using **jdk7**, I am trying to use the `java.nio.file.Files` class to [move][1] an empty directory, let's say `Bar`, into another empty directory, let's say `Foo`

    Path source = Paths.get("Bar");
    Path target = Paths.get("Foo");
    try {
        Files.move(
            source,
    	    target,  
    	    StandardCopyOption.REPLACE_EXISTING);
    } catch (IOException e) {
    	e.printStackTrace();
    }

After executing that code snippet, I expected that the `Bar` directory would be in the `Foo` directory (`...\Foo\Bar`). Instead it is not. And here's the kicker, it's been deleted as well.

Am I doing this wrong?


  [1]: http://download.java.net/jdk7/docs/api/java/nio/file/Files.html#move%28java.nio.file.Path,%20java.nio.file.Path,%20java.nio.file.CopyOption...%29
How to move directories using jdk7
===

Using **jdk7**, I am trying to use the `java.nio.file.Files` class to [move][1] an empty directory, let's say `Bar`, into another empty directory, let's say `Foo`

    Path source = Paths.get("Bar");
    Path target = Paths.get("Foo");
    try {
        Files.move(
            source,
    	    target,  
    	    StandardCopyOption.REPLACE_EXISTING);
    } catch (IOException e) {
    	e.printStackTrace();
    }

After executing that code snippet, I expected that the `Bar` directory would be in the `Foo` directory (`...\Foo\Bar`). Instead it is not. And here's the kicker, it's been deleted as well.

Am I doing this wrong?


  [1]: http://download.java.net/jdk7/docs/api/java/nio/file/Files.html#move%28java.nio.file.Path,%20java.nio.file.Path,%20java.nio.file.CopyOption...%29