core/src/test/java/org/apache/commons/vfs2/test/ContentTests.java
/**
     * Tests that content and file objects are usable after being closed.
     */
Tests that content and file objects are usable after being closed.
Tests that content and file objects are usable after being closed .
public void testReuse() throws Exception
    {
        FileObject file = getReadFolder().resolveFile("file1.txt");
        assertEquals(FileType.FILE, file.getType());
        assertSameContent(FILE1_CONTENT, file);
        assertSameContent(FILE1_CONTENT, file);
        file.getContent().close();
        file.close();
        assertSameContent(FILE1_CONTENT, file);
    }
public void testReuse ( ) throws Exception { FileObject file = getReadFolder ( ) . resolveFile ( "file1.txt" ) ; assertEquals ( FileType . FILE , file . getType ( ) ) ; assertSameContent ( FILE1_CONTENT , file ) ; assertSameContent ( FILE1_CONTENT , file ) ; file . getContent ( ) . close ( ) ; file . close ( ) ; assertSameContent ( FILE1_CONTENT , file ) ; }
Tests that content and file objects are usable after being closed.
Tests that content and file objects are usable after being closed .
// Get the test file // Get the file content // Read the content again // Close the content + file // Read the content again