Created
January 29, 2018 10:24
-
-
Save nickname55/411c5eb59ac7e7c673816bdf0fa83798 to your computer and use it in GitHub Desktop.
Confluence REST : get content by id
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.pampushko.confluence.rest; | |
import com.pampushko.confluence.models.PageResultItem; | |
import com.pampushko.confluence.models.Space; | |
import com.pampushko.confluence.models.SpaceResultList; | |
import com.pampushko.confluence.settings.SettingsManager; | |
import lombok.extern.slf4j.Slf4j; | |
import java.io.IOException; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.Properties; | |
@Slf4j | |
public class Main | |
{ | |
public static final String url = ""; | |
private static final String username = ""; | |
private static final String password = ""; | |
public static void main(String[] args) throws IOException | |
{ | |
//читаем настройки приложения | |
Properties settings = SettingsManager.getValues(); | |
//вызываем билдер и создаем клиент | |
ConfluenceClient confluence = ConfluenceClient.newBuilder() | |
.baseUrl(settings.getProperty("baseUrl")) | |
.username(settings.getProperty("username")) | |
.password(settings.getProperty("password")) | |
.build(); | |
Space resultSpace = null; | |
SpaceResultList spaces = confluence.getSpaces(); | |
for (Space space : spaces.getSpaces()) | |
{ | |
System.out.println(space); | |
} | |
Map<String, String> params = new HashMap<String, String>() | |
{ | |
{ | |
//put("expand", "body,version,body.editor"); | |
put("expand", "body,version"); | |
} | |
}; | |
PageResultItem page = confluence.getContentById("113868801", params); | |
System.out.println(page); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment