vfs-s3 icon indicating copy to clipboard operation
vfs-s3 copied to clipboard

Getting the last modified timestamp returns different results

Open boris-petrov opened this issue 5 years ago • 0 comments

When using DigitalOcean Spaces, requesting the last modified time in these two ways yields two different results:

def fileSystemOptions = new FileSystemOptions()
S3FileSystemConfigBuilder.getInstance().setCredentialsProvider(fileSystemOptions,
	new AWSStaticCredentialsProvider(new BasicAWSCredentials('username', 'password')))

def file = VFS.getManager().resolveFile('s3://ams3.digitaloceanspaces.com/folder', fileSystemOptions)
println file.getChildren()[0].getContent().getLastModifiedTime()

file = VFS.getManager().resolveFile('s3://ams3.digitaloceanspaces.com/folder/file.txt', fileSystemOptions)
println file.getContent().getLastModifiedTime()

In my case I get:

1575469137773
1575469137000

That is, when getting the file directly, the timestamp is truncated. This is not a bug in vfs-s3 but rather in DigitalOcean. However, a workaround in vfs-s3 would be nice.

boris-petrov avatar Dec 01 '20 10:12 boris-petrov