/** * @see FileSystem#getInputStream */ public InputStream getInputStream() throws FileSystemException { return fs.getInputStream(path); }
/** * @see FileSystem#getInputStream */ public InputStream getInputStream() throws FileSystemException { return fs.getInputStream(path); }
/** * @see FileSystem#getInputStream */ public InputStream getInputStream() throws FileSystemException { return fs.getInputStream(path); }
/** * Spools this resource to the given output stream. * * @param out output stream where to spool the resource * @throws FileSystemException if the input stream for this resource could * not be obtained * @throws IOException if an error occurs while while spooling * @see FileSystem#getInputStream */ public void spool(OutputStream out) throws FileSystemException, IOException { InputStream in = fs.getInputStream(path); try { IOUtils.copy(in, out); } finally { IOUtils.closeQuietly(in); } }
/** * Spools this resource to the given output stream. * * @param out output stream where to spool the resource * @throws FileSystemException if the input stream for this resource could * not be obtained * @throws IOException if an error occurs while while spooling * @see FileSystem#getInputStream */ public void spool(OutputStream out) throws FileSystemException, IOException { InputStream in = fs.getInputStream(path); try { IOUtils.copy(in, out); } finally { IOUtils.closeQuietly(in); } }
/** * Spools this resource to the given output stream. * * @param out output stream where to spool the resource * @throws FileSystemException if the input stream for this resource could * not be obtained * @throws IOException if an error occurs while while spooling * @see FileSystem#getInputStream */ public void spool(OutputStream out) throws FileSystemException, IOException { InputStream in = fs.getInputStream(path); try { IOUtils.copy(in, out); } finally { IOUtils.closeQuietly(in); } }
/** * {@inheritDoc} */ public InputStream getInputStream(String filePath) throws FileSystemException { return fsBase.getInputStream(buildBasePath(filePath)); }
/** * {@inheritDoc} */ public InputStream getInputStream(String filePath) throws FileSystemException { return fsBase.getInputStream(buildBasePath(filePath)); }
/** * {@inheritDoc} */ public InputStream getInputStream(String filePath) throws FileSystemException { return fsBase.getInputStream(buildBasePath(filePath)); }
private Properties loadProperties(String path) throws RepositoryException { Properties properties = new Properties(); FileSystem filesystem = source.getFileSystem(); try { if (filesystem.exists(path)) { InputStream stream = filesystem.getInputStream(path); try { properties.load(stream); } finally { stream.close(); } } } catch (FileSystemException e) { throw new RepositoryException(e); } catch (IOException e) { throw new RepositoryException(e); } return properties; }
/** * {@inheritDoc} */ protected NodePropBundle loadBundle(NodeId id) throws ItemStateException { try { String path = buildNodeFilePath(null, id).toString(); if (!itemFs.exists(path)) { return null; } InputStream in = itemFs.getInputStream(path); try { return binding.readBundle(in, id); } finally { IOUtils.closeQuietly(in); } } catch (Exception e) { String msg = "failed to read bundle: " + id + ": " + e; log.error(msg); throw new ItemStateException(msg, e); } }
private Properties loadProperties(String path) throws RepositoryException { Properties properties = new Properties(); FileSystem filesystem = source.getFileSystem(); try { if (filesystem.exists(path)) { InputStream stream = filesystem.getInputStream(path); try { properties.load(stream); } finally { stream.close(); } } } catch (FileSystemException e) { throw new RepositoryException(e); } catch (IOException e) { throw new RepositoryException(e); } return properties; }
configReader = new InputStreamReader(fs.getInputStream(configPath)); InputSource xml = new InputSource(configReader); xml.setSystemId(configPath);
/** * {@inheritDoc} */ protected NodePropBundle loadBundle(NodeId id) throws ItemStateException { try { String path = buildNodeFilePath(null, id).toString(); if (!itemFs.exists(path)) { return null; } InputStream in = itemFs.getInputStream(path); try { return binding.readBundle(in, id); } finally { IOUtils.closeQuietly(in); } } catch (Exception e) { String msg = "failed to read bundle: " + id + ": " + e; log.error(msg); throw new ItemStateException(msg, e); } }
new BufferedInputStream(itemStateFS.getInputStream(propFilePath)); try { PropertyState state = createNew(id);
/** * {@inheritDoc} */ public synchronized NodeReferences loadReferencesTo(NodeId targetId) throws NoSuchItemStateException, ItemStateException { if (!initialized) { throw new IllegalStateException("not initialized"); } InputStream in = null; try { String path = buildNodeReferencesFilePath(null, targetId).toString(); if (!itemFs.exists(path)) { // special case throw new NoSuchItemStateException(targetId.toString()); } in = itemFs.getInputStream(path); NodeReferences refs = new NodeReferences(targetId); Serializer.deserialize(refs, in); return refs; } catch (NoSuchItemStateException e) { throw e; } catch (Exception e) { String msg = "failed to read references: " + targetId; BundleFsPersistenceManager.log.error(msg, e); throw new ItemStateException(msg, e); } finally { IOUtils.closeQuietly(in); } }
/** * {@inheritDoc} */ public synchronized NodeReferences loadReferencesTo(NodeId targetId) throws NoSuchItemStateException, ItemStateException { if (!initialized) { throw new IllegalStateException("not initialized"); } InputStream in = null; try { String path = buildNodeReferencesFilePath(null, targetId).toString(); if (!itemFs.exists(path)) { // special case throw new NoSuchItemStateException(targetId.toString()); } in = itemFs.getInputStream(path); NodeReferences refs = new NodeReferences(targetId); Serializer.deserialize(refs, in); return refs; } catch (NoSuchItemStateException e) { throw e; } catch (Exception e) { String msg = "failed to read references: " + targetId; BundleFsPersistenceManager.log.error(msg, e); throw new ItemStateException(msg, e); } finally { IOUtils.closeQuietly(in); } }
new BufferedInputStream(itemStateFS.getInputStream(refsFilePath)); try { NodeReferences refs = new NodeReferences(id);
InputStream in = itemStateFS.getInputStream(refsFilePath);
throw new NoSuchItemStateException(id.toString()); InputStream in = itemStateFS.getInputStream(propFilePath); try { DOMWalker walker = new DOMWalker(in);