[GitHub] [nifi] Wastack commented on a change in pull request #4370: NIFI-6128 UnpackContent: Store unpacked file data
Wastack commented on a change in pull request #4370: URL: https://github.com/apache/nifi/pull/4370#discussion_r453512358 ## File path: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/UnpackContent.java ## @@ -321,6 +337,13 @@ public void process(final InputStream in) throws IOException { attributes.put(CoreAttributes.ABSOLUTE_PATH.key(), absPathString); attributes.put(CoreAttributes.MIME_TYPE.key(), OCTET_STREAM); +attributes.put(FILE_PERMISSIONS_ATTRIBUTE, FileInfo.permissionToString(tarEntry.getMode())); +attributes.put(FILE_OWNER_ATTRIBUTE, String.valueOf(tarEntry.getUserName())); +attributes.put(FILE_GROUP_ATTRIBUTE, String.valueOf(tarEntry.getGroupName())); + +final String timeAsString = DATE_TIME_FORMATTER.format(tarEntry.getModTime().toInstant()); + attributes.put(FILE_LAST_MODIFIED_TIME_ATTRIBUTE, timeAsString); Review comment: Let's modify file.creationTime to the same as lastModifiedTime in order to avoid (minimize) confusion. 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: us...@infra.apache.org
[GitHub] [nifi] Wastack commented on a change in pull request #4370: NIFI-6128 UnpackContent: Store unpacked file data
Wastack commented on a change in pull request #4370: URL: https://github.com/apache/nifi/pull/4370#discussion_r450789703 ## File path: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/UnpackContent.java ## @@ -321,6 +328,15 @@ public void process(final InputStream in) throws IOException { attributes.put(CoreAttributes.ABSOLUTE_PATH.key(), absPathString); attributes.put(CoreAttributes.MIME_TYPE.key(), OCTET_STREAM); +attributes.put(FILE_INNER_PERMISSION, String.valueOf(tarEntry.getMode())); +attributes.put(FILE_INNER_OWNER, String.valueOf(tarEntry.getUserName())); +attributes.put(FILE_INNER_GROUP, String.valueOf(tarEntry.getGroupName())); + +String timePattern = "-MM-dd'T'HH:mm:ssZ"; +DateFormat df = new SimpleDateFormat(timePattern); Review comment: > The built-in `DateTimeFormatter.ISO_OFFSET_DATE_TIME` instance seems to me the right format here. Some other processors (ListFTP, ListFile, PutFile, GetFile) use "-MM-dd'T'HH:mm:ssZ" format explicitly. 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: us...@infra.apache.org