List of usage examples for org.apache.commons.vfs FileContent getRandomAccessContent
public RandomAccessContent getRandomAccessContent(final RandomAccessMode mode) throws FileSystemException;
From source file:unitTests.dataspaces.AbstractLimitingFileObjectTest.java
@Test public void testReadOnlyGetContentRandomInputStream() throws IOException { createRealFile();//www . j av a 2 s . c o m final FileContent content = readOnlyFile.getContent(); try { content.getRandomAccessContent(RandomAccessMode.READ).close(); } finally { content.close(); } }
From source file:unitTests.dataspaces.AbstractLimitingFileObjectTest.java
@Test public void testReadOnlyGetContentRandomOutputStream() throws IOException { createRealFile();/* ww w. j a v a 2 s. co m*/ final FileContent content = readOnlyFile.getContent(); try { content.getRandomAccessContent(RandomAccessMode.READWRITE).close(); fail("Expected exception"); } catch (FileSystemException x) { } finally { content.close(); } }
From source file:unitTests.dataspaces.AbstractLimitingFileObjectTest.java
@Test public void testReadWriteGetContentRandomInputStream() throws IOException { createRealFile();//w w w .ja va 2 s. co m final FileContent content = readWriteFile.getContent(); try { content.getRandomAccessContent(RandomAccessMode.READ).close(); } finally { content.close(); } }
From source file:unitTests.dataspaces.AbstractLimitingFileObjectTest.java
@Test public void testReadWriteGetContentRandomOutputStream() throws IOException { createRealFile();// w ww. jav a 2 s .c o m final FileContent content = readWriteFile.getContent(); try { content.getRandomAccessContent(RandomAccessMode.READWRITE).close(); } finally { content.close(); } }