/** * Append a list of paths, inserting "/" signs as appropriate * @param base base path/URL * @param paths subpaths * @return base+"/"+paths[0]+"/"+paths[1]... */ public static String appendToURL(String base, String... paths) { String result = base; for (String path : paths) { result = appendToURL(result, path); } return result; }
/** * Append a list of paths, inserting "/" signs as appropriate * @param base base path/URL * @param paths subpaths * @return base+"/"+paths[0]+"/"+paths[1]... */ public static String appendToURL(String base, String... paths) { String result = base; for (String path : paths) { result = appendToURL(result, path); } return result; }
/** * Get a complete export, with all values * @param exportSet * @param name name of the configuration * @param external flag to indicate that it is an external configuration * @return the retrieved config * @throws IOException IO problems */ public PublishedExports retrieveExports(PublishedExportsSet exportSet, String name, boolean external) throws IOException { if (!exportSet.contains(name)) { throw new FileNotFoundException("Unknown export " + name); } String exportsURL = getExportURL(external); exportsURL = SliderUtils.appendToURL(exportsURL, name); return get(resource(exportsURL), PublishedExports.class); }
/** * Get a complete export, with all values * @param exportSet * @param name name of the configuration * @param external flag to indicate that it is an external configuration * @return the retrieved config * @throws IOException IO problems */ public PublishedExports retrieveExports(PublishedExportsSet exportSet, String name, boolean external) throws IOException { if (!exportSet.contains(name)) { throw new FileNotFoundException("Unknown export " + name); } String exportsURL = getExportURL(external); exportsURL = SliderUtils.appendToURL(exportsURL, name); return get(resource(exportsURL), PublishedExports.class); }
/** * Get a complete configuration, with all values * @param configSet config set to ask for * @param name name of the configuration * @param external flag to indicate that it is an external configuration * @return the retrieved config * @throws IOException IO problems */ public PublishedConfiguration retrieveConfiguration(PublishedConfigSet configSet, String name, boolean external) throws IOException { String confURL = getConfigurationURL(external); if (!configSet.contains(name)) { throw new FileNotFoundException("Unknown configuration " + name); } confURL = SliderUtils.appendToURL(confURL, name); WebResource webResource = resource(confURL); return get(webResource, PublishedConfiguration.class); }
/** * Get a complete configuration, with all values * @param configSet config set to ask for * @param name name of the configuration * @param external flag to indicate that it is an external configuration * @return the retrieved config * @throws IOException IO problems */ public PublishedConfiguration retrieveConfiguration(PublishedConfigSet configSet, String name, boolean external) throws IOException { String confURL = getConfigurationURL(external); if (!configSet.contains(name)) { throw new FileNotFoundException("Unknown configuration " + name); } confURL = SliderUtils.appendToURL(confURL, name); WebResource webResource = resource(confURL); return get(webResource, PublishedConfiguration.class); }
String configurationsURL = SliderUtils.appendToURL( publisherURL.toExternalForm(), RestPaths.SLIDER_CONFIGSET); String exportsURL = SliderUtils.appendToURL( publisherURL.toExternalForm(), RestPaths.SLIDER_EXPORTS);
String configurationsURL = SliderUtils.appendToURL( publisherURL.toExternalForm(), RestPaths.SLIDER_CONFIGSET); String exportsURL = SliderUtils.appendToURL( publisherURL.toExternalForm(), RestPaths.SLIDER_EXPORTS);