public LoadFromConfluence(String username, String password) { this(new RESTClient(Type.XML, username, password)); }
private String get(String uri) { return client.get(uri); }
private void put(String uri, String entity) { client.put(uri, entity); }
public String loadResourceAsText(String resourcePath) { try { Type type = client.getType(); return text(get(uri(resourcePath, type)), type); } catch (Exception cause) { throw new InvalidStoryResource(resourcePath, cause); } }
public void put(String uri, String entity) { client().resource(uri).type(format(APPLICATION_TYPE, type.name().toLowerCase())) .put(ClientResponse.class, entity); }
public void uploadResource(Resource resource) { try { Type type = client.getType(); put(uri(resource.getURI(), type), entity(resource, type)); } catch (Exception cause) { throw new InvalidStoryResource(resource.toString(), cause); } }
public String get(String uri) { return client().resource(uri).accept(format(APPLICATION_TYPE, type.name().toLowerCase())) .get(ClientResponse.class).getEntity(String.class); }
public UploadToREST(Type type, String username, String password) { this.client = new RESTClient(type, username, password); }
private String get(String uri) { return client.get(uri); }
public IndexFromRedmine(String username, String password, ResourceNameResolver nameResolver) { super(new RESTClient(Type.JSON, username, password), nameResolver); }
public Page loadPage(String pageUrl, boolean expanded) { String pattern = expanded ? EXPAND_PAGE : REGULAR_PAGE; String content = client.get(format(pattern, pageUrl)); XStream parse = configureXStream(); Page page = (Page) parse.fromXML(content); return page; }
public LoadFromREST(Type type, String username, String password) { this.client = new RESTClient(type, username, password); }
public Page loadRootPage(String baseUrl, String spaceKey, String pageName) { String searchResult = client.get(format(SEARCH_PAGE, baseUrl, spaceKey, pageName)); XStream parse = configureXStream(); Results results = (Results) parse.fromXML(searchResult); return results.getGroup().getResult(); }
public IndexFromConfluence(String username, String password) { this(new RESTClient(Type.XML, username, password)); }
public IndexFromXWiki(String username, String password, ResourceNameResolver nameResolver) { super(new RESTClient(Type.JSON, username, password), nameResolver); }