@Override
  public InputStream getInputStream() throws IOException, UnsupportedFileOperationException {
    VsphereConnHandler connHandler = null;
    try {
      connHandler = getConnHandler();
      ManagedObjectReference fileManager = getFileManager(connHandler);

      FileTransferInformation fileDlInfo =
          connHandler
              .getClient()
              .getVimPort()
              .initiateFileTransferFromGuest(fileManager, vm, credentials, getPathInVm());
      String fileDlUrl = fileDlInfo.getUrl().replace("*", connHandler.getClient().getServer());

      // http://stackoverflow.com/questions/921262/how-to-download-and-save-a-file-from-internet-using-java
      URL website = new URL(fileDlUrl);
      return website.openStream();

    } catch (InvalidPropertyFaultMsg e) {
      translateandLogException(e);
    } catch (RuntimeFaultFaultMsg e) {
      translateandLogException(e);
    } catch (FileFaultFaultMsg e) {
      translateandLogException(e);
    } catch (GuestOperationsFaultFaultMsg e) {
      translateandLogException(e);
    } catch (InvalidStateFaultMsg e) {
      translateandLogException(e);
    } catch (TaskInProgressFaultMsg e) {
      translateandLogException(e);
    } finally {
      releaseConnHandler(connHandler);
    }
    return null;
  }