core/src/test/java/org/apache/commons/vfs2/test/ContentTests.java
/**
     * Tests that unknown files have no content.
     */
Tests that unknown files have no content.
Tests that unknown files have no content .
public void testUnknownContent() throws Exception
    {
        FileObject unknownFile = getReadFolder().resolveFile("unknown-file");
        FileContent content = unknownFile.getContent();
        try
        {
            content.getInputStream();
            fail();
        }
        catch (FileSystemException e)
        {
            assertSameMessage("vfs.provider/read-not-file.error", unknownFile, e);
        }
        try
        {
            content.getSize();
            fail();
        }
        catch (final FileSystemException e)
        {
            assertSameMessage("vfs.provider/get-size-not-file.error", unknownFile, e);
        }
    }
public void testUnknownContent ( ) throws Exception { FileObject unknownFile = getReadFolder ( ) . resolveFile ( "unknown-file" ) ; FileContent content = unknownFile . getContent ( ) ; try { content . getInputStream ( ) ; fail ( ) ; } catch ( FileSystemException e ) { assertSameMessage ( "vfs.provider/read-not-file.error" , unknownFile , e ) ; } try { content . getSize ( ) ; fail ( ) ; } catch ( final FileSystemException e ) { assertSameMessage ( "vfs.provider/get-size-not-file.error" , unknownFile , e ) ; } }
Tests that unknown files have no content.
Tests that unknown files have no content .
// Try getting the content of an unknown file