You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by GitBox <gi...@apache.org> on 2020/05/27 16:28:37 UTC

[GitHub] [sling-org-apache-sling-feature-cpconverter] bosschaert commented on a change in pull request #28: Feature Converter doesn't cleanup after itself

bosschaert commented on a change in pull request #28:
URL: https://github.com/apache/sling-org-apache-sling-feature-cpconverter/pull/28#discussion_r431278083



##########
File path: src/main/java/org/apache/sling/feature/cpconverter/cli/ShutDownHook.java
##########
@@ -76,4 +82,15 @@ public void run() {
         logger.info("+-----------------------------------------------------+");
     }
 
+    private void cleanUp(){
+        String tmpDir = System.getProperty("java.io.tmpdir");
+        logger.info("Cleaning up tmp directories {}, {}", tmpDir + "sub-content-packages", tmpDir + "syntethic-content-packages" );
+
+        try {
+            FileUtils.deleteDirectory( new File (tmpDir, "syntethic-content-packages") );
+            FileUtils.deleteDirectory( new File(tmpDir, "sub-content-packages") );
+        } catch (IOException e) {
+            logger.error( "Error Deleting {}, {}", tmpDir + "sub-content-packages", tmpDir + "syntethic-content-packages");
+        }

Review comment:
       I would make `"sub-content-packages"` and `"syntethic-content-packages"` constants...




----------------------------------------------------------------
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.

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