Removing config and coverageName from publishWorldImage.

This commit is contained in:
Joergen Schoeyen Nicolaysen 2012-01-19 10:50:41 +01:00
parent ee75f7138e
commit b12a7fb0a5
2 changed files with 2 additions and 11 deletions

View File

@ -1522,21 +1522,12 @@ public class GeoServerRESTPublisher {
* @param workspace Workspace to use * @param workspace Workspace to use
* @param coveragestore Name of the coveragestore * @param coveragestore Name of the coveragestore
* @param zipFile zip file to upload * @param zipFile zip file to upload
* @param configure Configure parameter. It may be null.
* @param coverageName coverageName parameter to append. Only works if configure is set. It may be null.
* @return true if the operation completed successfully. * @return true if the operation completed successfully.
*/ */
public boolean publishWorldimage(String workspace, String coveragestore, File zipFile, String configure, String coverageName) throws FileNotFoundException { public boolean publishWorldimage(String workspace, String coveragestore, File zipFile) throws FileNotFoundException {
// build full URL // build full URL
StringBuilder sbUrl = new StringBuilder(restURL).append("/rest/workspaces/").append(workspace).append("/coveragestores/").append(coveragestore) StringBuilder sbUrl = new StringBuilder(restURL).append("/rest/workspaces/").append(workspace).append("/coveragestores/").append(coveragestore)
.append("/file.worldimage"); .append("/file.worldimage");
if ( configure != null && coverageName != null) {
sbUrl.append("?configure").append(configure);
if ( coverageName != null) {
sbUrl.append("&coverageName=").append(coverageName);
}
}
String sentResult = HTTPUtils.put(sbUrl.toString(), zipFile, "application/zip", gsuser, gspass); String sentResult = HTTPUtils.put(sbUrl.toString(), zipFile, "application/zip", gsuser, gspass);
boolean fileSent = sentResult != null; boolean fileSent = sentResult != null;

View File

@ -478,7 +478,7 @@ public class GeoserverRESTPublisherTest extends GeoserverRESTTest {
File worldImageFile = new ClassPathResource("testdata/worldimagetest.zip").getFile(); File worldImageFile = new ClassPathResource("testdata/worldimagetest.zip").getFile();
// test publish // test publish
boolean wp = publisher.publishWorldimage(DEFAULT_WS, storeName, worldImageFile, null, null); boolean wp = publisher.publishWorldimage(DEFAULT_WS, storeName, worldImageFile);
assertTrue("Publish worldfile failed.",wp); assertTrue("Publish worldfile failed.",wp);
} }