You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by GitBox <gi...@apache.org> on 2021/07/19 10:16:52 UTC

[GitHub] [brooklyn-server] ahgittin commented on a change in pull request #1195: Feature/working peristence import api

ahgittin commented on a change in pull request #1195:
URL: https://github.com/apache/brooklyn-server/pull/1195#discussion_r672172387



##########
File path: rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/ServerResource.java
##########
@@ -549,19 +552,22 @@ protected Response exportPersistenceData(MementoCopyMode preferredOrigin) {
     }
 
     @Override
-    public Response importPersistenceData(String persistenceExportLocation) {
+    public Response importPersistenceData(byte[] persistenceData) {
         try {
-            File persistenceLocation = new File(persistenceExportLocation);
-            if (!persistenceLocation.isDirectory()){
-                throw WebResourceUtils.badRequest("Invalid persistence directory - %s does not exist or is not a directory", persistenceExportLocation);
-            }
+            // create a temporary archive where persistence data supplied is written to
+            File tempZipFile = File.createTempFile("persistence-import",null);

Review comment:
       should we delete this file at the end of this method?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org