public static void viewImage(RepositoryService repositoryService, String deploymentId)
      throws Exception {
    // 从仓库中找需要展示的文件
    List<String> names = repositoryService.getDeploymentResourceNames(deploymentId);
    String imageName = null;
    for (String name : names) {
      if (name.indexOf(".png") >= 0) {
        imageName = name;
      }
    }
    if (imageName != null) {
      InputStream in = repositoryService.getResourceAsStream(deploymentId, imageName);
      FileOutputStream out = new FileOutputStream("e:\\image.png");
      byte[] bytes = new byte[4096];
      while (in.read(bytes) > 0) {
        out.write(bytes);
      }
      out.close();
    }
  }