/** * Return the inputstream from from cache, or null if not in the cache. * * @param fileName name of file. * @return stream or null. */ public InputStream getIfStored(String fileName) throws IOException { File file = getFileIfStored(fileName); return file == null ? null : new LazyFileInputStream(file); }
public boolean markSupported() { try { open(); } catch (IOException e) { throw new IllegalStateException(e.toString()); } return super.markSupported(); }
LazyFileInputStream in = new LazyFileInputStream(file.getAbsolutePath() + "XX"); in.close(); fail(); } catch (IOException e) { LazyFileInputStream in = new LazyFileInputStream(file); in.close(); in = new LazyFileInputStream(file); assertEquals(0, in.read()); assertEquals(-1, in.read()); assertEquals(-1, in.read()); assertEquals(-1, in.read()); in.close(); in.close(); in.close(); assertEquals(-1, in.read()); in = new LazyFileInputStream(file.getAbsolutePath()); assertEquals(1, in.available()); assertEquals(0, in.read()); assertEquals(0, in.available()); assertEquals(-1, in.read()); assertEquals(0, in.available()); in.close(); in = new LazyFileInputStream(file); assertFalse(in.markSupported()); in.mark(1);
/** * Return the inputstream from from cache, or null if not in the cache. * * @param fileName name of file. * @return stream or null. */ public InputStream getIfStored(String fileName) throws IOException { File file = getFileIfStored(fileName); return file == null ? null : new LazyFileInputStream(file); }
public int available() throws IOException { open(); return super.available(); }
/** * {@inheritDoc} */ public InputStream getStream() throws DataStoreException { try { return new LazyFileInputStream(file); } catch (IOException e) { throw new DataStoreException("Error opening input stream of " + file.getAbsolutePath(), e); } }
public synchronized void reset() throws IOException { open(); super.reset(); }
public InputStream getStream() throws IllegalStateException, RepositoryException { try { return new LazyFileInputStream(file); } catch (FileNotFoundException fnfe) { throw new RepositoryException("file backing binary value not found", fnfe); } }
public long skip(long n) throws IOException { open(); return super.skip(n); }
public InputStream getStream() throws IllegalStateException, RepositoryException { try { return new LazyFileInputStream(file); } catch (FileNotFoundException fnfe) { throw new RepositoryException("file backing binary value not found", fnfe); } }
public synchronized void mark(int readlimit) { try { open(); } catch (IOException e) { throw new IllegalStateException(e.toString()); } super.mark(readlimit); }
@Override public InputStream getStream() throws DataStoreException { try { return new LazyFileInputStream(file); } catch (FileNotFoundException e) { LOG.error("Error in returning stream", e); throw new DataStoreException(e); } }
public boolean markSupported() { try { open(); } catch (IOException e) { throw new IllegalStateException(e.toString()); } return super.markSupported(); }
@Override public InputStream getStream() throws DataStoreException { try { return new LazyFileInputStream(file); } catch (FileNotFoundException e) { LOG.error("Error in returning stream", e); throw new DataStoreException(e); } }
public int read() throws IOException { open(); return super.read(); }
/** * {@inheritDoc} */ public InputStream getStream() throws DataStoreException { try { return new LazyFileInputStream(file); } catch (IOException e) { throw new DataStoreException("Error opening input stream of " + file.getAbsolutePath(), e); } }
public int read(byte[] b) throws IOException { open(); return super.read(b, 0, b.length); }
/** * {@inheritDoc} */ public InputStream getStream() throws DataStoreException { try { return new LazyFileInputStream(file); } catch (IOException e) { throw new DataStoreException("Error opening input stream of " + file.getAbsolutePath(), e); } }
public int read(byte[] b, int off, int len) throws IOException { open(); return super.read(b, off, len); }
/** * Return the inputstream from from cache, or null if not in the cache. * * @param fileName name of file. * @return stream or null. */ public InputStream getIfStored(String fileName) throws IOException { File file = getFileIfStored(fileName); return file == null ? null : new LazyFileInputStream(file); }