mirror of https://github.com/apache/nifi.git
NIFI-5894 set a default last modified time when no last modified time is provided instead of NPE
This closes #3229. Signed-off-by: Joseph Witt <joewitt@apache.org>
This commit is contained in:
parent
b574a7e41a
commit
0bd3635ff9
|
@ -313,12 +313,14 @@ public class FTPTransfer implements FileTransfer {
|
|||
perms.append(file.hasPermission(FTPFile.WORLD_ACCESS, FTPFile.WRITE_PERMISSION) ? "w" : "-");
|
||||
perms.append(file.hasPermission(FTPFile.WORLD_ACCESS, FTPFile.EXECUTE_PERMISSION) ? "x" : "-");
|
||||
|
||||
final long lastModifiedTime = (file.getTimestamp() != null) ? file.getTimestamp().getTimeInMillis() : 0L;
|
||||
|
||||
FileInfo.Builder builder = new FileInfo.Builder()
|
||||
.filename(file.getName())
|
||||
.fullPathFileName(newFullForwardPath)
|
||||
.directory(file.isDirectory())
|
||||
.size(file.getSize())
|
||||
.lastModifiedTime(file.getTimestamp().getTimeInMillis())
|
||||
.lastModifiedTime(lastModifiedTime)
|
||||
.permissions(perms.toString())
|
||||
.owner(file.getUser())
|
||||
.group(file.getGroup());
|
||||
|
|
Loading…
Reference in New Issue