Created
January 28, 2018 13:42
-
-
Save nickname55/aa78800bbca686b261a3bfe505d93de9 to your computer and use it in GitHub Desktop.
получаем space content, при этом у контента развёрнут body.editor
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.ContentContainter; | |
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"); | |
put("expand", "body.editor"); | |
} | |
}; | |
ContentContainter content = confluence.getSpaceContent("KARMA", params); | |
System.out.println(content); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment