/** * Create a container, which is equivalent to a bucket * * @param containerName Name of the container */ public void createContainer(String containerName) { HttpURLConnection urlConnection = new ConnBuilder(credentials, containerName, null) .method("PUT") .getConnection(); Response response = doVoidOperation(urlConnection); if (!response.isSuccessCode()) { if (response.isAuthDenied()) { log.warn("Refreshing credentials and retrying"); authenticate(); createContainer(containerName); } else { log.error(Util.getMessage("ErrorCreatingContainer") + containerName + " ,code = " + response.code); } } }
@Override protected void createRootDir() { rackspaceClient.authenticate(); rackspaceClient.createContainer(container); }
/** * Create a container, which is equivalent to a bucket * * @param containerName Name of the container */ public void createContainer(String containerName) { HttpURLConnection urlConnection = new ConnBuilder(credentials, containerName, null) .method("PUT") .getConnection(); Response response = doVoidOperation(urlConnection); if (!response.isSuccessCode()) { if (response.isAuthDenied()) { log.warn("Refreshing credentials and retrying"); authenticate(); createContainer(containerName); } else { log.error(Util.getMessage("ErrorCreatingContainer") + containerName + " ,code = " + response.code); } } }
@Override protected void createRootDir() { rackspaceClient.authenticate(); rackspaceClient.createContainer(container); }