@Test public void testWritingMultipleFiles() throws Exception { FileStorageManager sm = getStorageManager(null, null); String tsID = "0"; FileStore store = sm.createFileStore(tsID); String contentOrig = new String("some file content this will stored in same tmp file with another"); OutputStream out = store.createOutputStream(); out.write(contentOrig.getBytes(), 0, contentOrig.getBytes().length); out.close(); out = store.createOutputStream(); long start = store.getLength(); byte[] bytesOrig = new byte[2048]; r.nextBytes(bytesOrig); out.write(bytesOrig, 0, 2048); byte[] readContent = new byte[2048]; InputStream in = store.createInputStream(0, contentOrig.getBytes().length); int c = in.read(readContent, 0, 3000); assertEquals(contentOrig, new String(readContent, 0, c)); c = in.read(readContent, 0, 3000); assertEquals(-1, c); in.close(); in = store.createInputStream(start, 2048); c = in.read(readContent, 0, 3000); assertTrue(Arrays.equals(bytesOrig, readContent)); c = in.read(readContent, 0, 3000); assertEquals(-1, c); in.close(); }
public FileStore createFileStore(String name) { return new DiskStore(name); }
FileStorageManager implements StorageManager { public FileStore createFileStore(String name) { return new DiskStore(name); } }
FileStorageManager implements StorageManager { public FileStore createFileStore(String name) { return new DiskStore(name); }  }
FileStorageManager implements StorageManager { public FileStore createFileStore(String name) { return new DiskStore(name); }  void initialize(); void setMaxOpenFiles(int maxOpenFiles); void setStorageDirectory(String directory); FileStore createFileStore(String name); String getDirectory(); int getOpenFiles(); long getUsedBufferSpace(); int getOutOfDiskErrorCount(); void setMaxBufferSpace(long maxBufferSpace); @Override long getMaxStorageSpace(); }
FileStorageManager implements StorageManager { public FileStore createFileStore(String name) { return new DiskStore(name); }  void initialize(); void setMaxOpenFiles(int maxOpenFiles); void setStorageDirectory(String directory); FileStore createFileStore(String name); String getDirectory(); int getOpenFiles(); long getUsedBufferSpace(); int getOutOfDiskErrorCount(); void setMaxBufferSpace(long maxBufferSpace); @Override long getMaxStorageSpace(); static final int DEFAULT_MAX_OPEN_FILES; static final long DEFAULT_MAX_BUFFERSPACE; }