core/src/test/java/org/apache/commons/vfs2/test/ContentTests.java
/**
     * Asserts every file in a folder exists and has the expected content.
     */
Asserts every file in a folder exists and has the expected content.
Asserts every file in a folder exists and has the expected content .
private void assertSameContent(final FileInfo expected,
                                   final FileObject folder) throws Exception
    {
        for (Iterator<FileInfo> iterator = expected.children.values().iterator(); iterator.hasNext();)
        {
            final FileInfo fileInfo = iterator.next();
            final FileObject child = folder.resolveFile(fileInfo.baseName, NameScope.CHILD);
            assertTrue(child.getName().toString(), child.exists());
            if (fileInfo.type == FileType.FILE)
            {
                assertSameContent(fileInfo.content, child);
            }
            else
            {
                assertSameContent(fileInfo, child);
            }
        }
    }
private void assertSameContent ( final FileInfo expected , final FileObject folder ) throws Exception { for ( Iterator < FileInfo > iterator = expected . children . values ( ) . iterator ( ) ; iterator . hasNext ( ) ; ) { final FileInfo fileInfo = iterator . next ( ) ; final FileObject child = folder . resolveFile ( fileInfo . baseName , NameScope . CHILD ) ; assertTrue ( child . getName ( ) . toString ( ) , child . exists ( ) ) ; if ( fileInfo . type == FileType . FILE ) { assertSameContent ( fileInfo . content , child ) ; } else { assertSameContent ( fileInfo , child ) ; } } }
Asserts every file in a folder exists and has the expected content.
Asserts every file in a folder exists and has the expected content .