@Override public InputStream openStream() throws DSSException { final InputStream inputStream = DSSUtils.toInputStream(file); return inputStream; }
/** * This method returns an {@code InputStream} which needs to be closed, based on {@code FileInputStream}. * * @param filePath The path to the file to read * @return an {@code InputStream} materialized by a {@code FileInputStream} representing the contents of the file * @throws DSSException */ public static InputStream toInputStream(final String filePath) throws DSSException { final File file = getFile(filePath); final InputStream inputStream = toInputStream(file); return inputStream; }
/** * @param propertiesFileName * @return */ public Properties loadProperties(final String propertiesFileName) { final Properties properties = new Properties(); final File file = new File(tslPropertyCacheFolder, propertiesFileName); if (file.exists()) { try { final InputStream inputStream = DSSUtils.toInputStream(file); properties.load(inputStream); } catch (Exception e) { LOG.error("Impossible to load: '{}'", file.getAbsolutePath(), e); } } return properties; }
final InputStream inputStream = DSSUtils.toInputStream(policyFile); wsPolicyDocument = new WsDocument(); wsPolicyDocument.setBytes(DSSUtils.toByteArray(inputStream));