Example #1
0
 @Override
 public InputStream getStream() throws IllegalStateException, RepositoryException {
   checkStream();
   try {
     return m_value.getStream();
   } catch (IOException e) {
     throw new IllegalStateException("Stream read error:" + e.getMessage());
   }
 }
Example #2
0
  @Override
  public String getString() throws ValueFormatException {
    checkStream();

    String res;
    try {
      res = FileUtil.readContents(m_value.getStream(), "UTF-8");
    } catch (IOException e) {
      throw new ValueFormatException("Stream cannot be interpreted in UTF-8");
    }

    return res;
  }