Guest User

Untitled

a guest
Feb 14th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. package com.pampushko.confluence.rest;
  2.  
  3. import com.pampushko.confluence.models.user_watch.WatchObject;
  4. import com.pampushko.confluence.settings.SettingsManager;
  5. import lombok.extern.slf4j.Slf4j;
  6.  
  7. import java.io.IOException;
  8. import java.util.Properties;
  9.  
  10. @Slf4j
  11. public class Main
  12. {
  13. public static final String url = "";
  14. private static final String username = "";
  15. private static final String password = "";
  16.  
  17. public static void main(String[] args) throws IOException
  18. {
  19. //читаем настройки приложения
  20. Properties settings = SettingsManager.getValues();
  21.  
  22. //вызываем билдер и создаем клиент
  23. Confluence confluence = Confluence.newBuilder()
  24. .baseUrl(settings.getProperty("baseUrl"))
  25. .username(settings.getProperty("username"))
  26. .password(settings.getProperty("password"))
  27. .build();
  28.  
  29. final String contentId = "75563009";
  30. final String userkey = "8a7f80835e12863a015e14c6d9910023";
  31. final String username = "admin";
  32.  
  33. WatchObject watchObjectContent = confluence.watch(contentId);
  34. WatchObject watchObjectUsername = confluence.watchByUsername(contentId, username);
  35. WatchObject watchObjectUserkey = confluence.watchByKey(contentId, userkey);
  36.  
  37.  
  38. System.out.println("--content by current user--");
  39. System.out.println(watchObjectContent);
  40. System.out.println("--contetn by userkey--");
  41. System.out.println(watchObjectUserkey);
  42. System.out.println("--content by username--");
  43. System.out.println(watchObjectUsername);
  44.  
  45.  
  46. }
  47. }
Add Comment
Please, Sign In to add comment