core/src/test/java/org/apache/commons/vfs2/test/ContentTests.java
/**
     * Tests concurrent reads on different files works.
     */
Tests concurrent reads on different files works.
Tests concurrent reads on different files works .
public void testConcurrentReadFiles() throws Exception
    {
        final FileObject file = getReadFolder().resolveFile("file1.txt");
        assertTrue(file.exists());
        final FileObject emptyFile = getReadFolder().resolveFile("empty.txt");
        assertTrue(emptyFile.exists());
        final InputStream instr = file.getContent().getInputStream();
        try
        {
            assertSameContent("", emptyFile);
        }
        finally
        {
            instr.close();
        }
    }
public void testConcurrentReadFiles ( ) throws Exception { final FileObject file = getReadFolder ( ) . resolveFile ( "file1.txt" ) ; assertTrue ( file . exists ( ) ) ; final FileObject emptyFile = getReadFolder ( ) . resolveFile ( "empty.txt" ) ; assertTrue ( emptyFile . exists ( ) ) ; final InputStream instr = file . getContent ( ) . getInputStream ( ) ; try { assertSameContent ( "" , emptyFile ) ; } finally { instr . close ( ) ; } }
Tests concurrent reads on different files works.
Tests concurrent reads on different files works .
// Start reading from the file // Try to read from other file