コード例 #1
0
ファイル: MdsExtractor.java プロジェクト: stetro/MDS-Viewer
 public String readFile(DocumentName documentName) {
   try {
     PDocument pdocument = getPDocument(documentName, (long) 0);
     InputSource source = pdocument.read();
     Reader reader = source.getCharacterStream();
     if (reader != null) {
       return read(reader);
     } else {
       InputStream inputStream = source.getByteStream();
       return stream(inputStream);
     }
   } catch (MDSIOException e) {
     throw new IllegalArgumentException("Could not connect to MDS, check login data", e);
   } catch (IOException e) {
     throw new IllegalArgumentException("Could not read ", e);
   }
 }