@@ -0,0 +1,2073 @@
+package org.purl.wf4ever.robundle.fs;%0A%0Aimport static org.junit.Assert.assertFalse;%0Aimport static org.junit.Assert.assertTrue;%0Aimport static org.junit.Assert.fail;%0A%0Aimport java.io.IOException;%0Aimport java.nio.file.FileAlreadyExistsException;%0Aimport java.nio.file.Files;%0Aimport java.nio.file.NotDirectoryException;%0Aimport java.nio.file.Path;%0A%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Apublic class TestBundleFileSystem %7B%0A%0A    private BundleFileSystem fs;%0A%0A    @Before%0A    public void newFS() throws Exception %7B%0A        fs = BundleFileSystemProvider.newFileSystemFromTemporary();%0A        // System.out.println(fs.getSource());%0A    %7D%0A%0A    @After%0A    public void closeFS() throws IOException %7B%0A        fs.close();%0A        Files.deleteIfExists(fs.getSource());%0A    %7D%0A%0A    /**%0A     * Test that BundleFileSystem does not allow a ZIP file to also be a folder.%0A     * See http://stackoverflow.com/questions/16588321/%0A     * %0A     * @throws Exception%0A     */%0A    @Test%0A    public void directoryAndFile() throws Exception %7B%0A        Path folder = fs.getPath(%22folder%22);%0A        assertFalse(Files.exists(folder));%0A        Files.createFile(folder);%0A        assertTrue(Files.exists(folder));%0A        assertTrue(Files.isRegularFile(folder));%0A        assertFalse(Files.isDirectory(folder));%0A%0A        try %7B%0A            Files.createDirectory(folder);%0A            // Disable for now, just to see where this leads%0A            fail(%22Should have thrown FileAlreadyExistsException%22);%0A        %7D catch (FileAlreadyExistsException ex) %7B%0A        %7D%0A%0A        try %7B%0A            Files.createDirectories(folder);%0A            fail(%22Should have thrown FileAlreadyExistsException%22);%0A        %7D catch (FileAlreadyExistsException ex) %7B%0A        %7D%0A%0A        Path child = folder.resolve(%22child%22);%0A%0A        try %7B%0A            Files.createFile(child);%0A            fail(%22Should have thrown NotDirectoryException%22);%0A        %7D catch (NotDirectoryException ex) %7B%0A        %7D%0A%0A        assertTrue(Files.isRegularFile(folder));%0A        assertFalse(Files.isDirectory(fs.getPath(%22folder/%22)));%0A    %7D%0A%7D%0A

Test that bundle does not allow file to be folder