You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2020/07/06 12:34:26 UTC

[GitHub] [nifi] MikeThomsen commented on a change in pull request #4371: NIFI-7589 Fix path value when unpacking tar

MikeThomsen commented on a change in pull request #4371:
URL: https://github.com/apache/nifi/pull/4371#discussion_r450189107



##########
File path: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/UnpackContent.java
##########
@@ -309,7 +309,10 @@ public void process(final InputStream in) throws IOException {
                             }
                             final File file = new File(tarEntry.getName());
                             final Path filePath = file.toPath();
-                            final String filePathString = filePath.getParent() + "/";
+                            String filePathString = "/";
+                            if(filePath.getParent() != null) {
+                                filePathString = filePath.getParent() + "/";

Review comment:
       The `/` should be moved to the front of the string concatenation for consistency and so that we don't have trailing separators. Once you do that, we can merge.

##########
File path: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/UnpackContent.java
##########
@@ -309,7 +309,10 @@ public void process(final InputStream in) throws IOException {
                             }
                             final File file = new File(tarEntry.getName());
                             final Path filePath = file.toPath();
-                            final String filePathString = filePath.getParent() + "/";
+                            String filePathString = "/";
+                            if(filePath.getParent() != null) {

Review comment:
       Should have a whitespace between the if and parenthesis.




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