Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename operation from tempDir to target in AS2 package #116

Closed
ihudedi opened this issue Sep 13, 2020 · 6 comments
Closed

Rename operation from tempDir to target in AS2 package #116

ihudedi opened this issue Sep 13, 2020 · 6 comments
Assignees
Labels

Comments

@ihudedi
Copy link

ihudedi commented Sep 13, 2020

Hi Philip,
We have an issue when the AS2 code trying to rename the file from tempDir to the target.
When the tempDir and the target aren't on the same file system we are getting IOException when trying to rename file.
You are using renameTo method in java.io.File
Could you please modify the code to use move operation in nio package
java.nio.file.Files#move(oldPath,newPath,StandardCopyOption.ATOMIC_MOVE,StandardCopyOption.REPLACE_EXISITING)
You use the tempDir in some places in your code when you store the as2 message ,mdn etc.
Please see the attached link
https://stackoverflow.com/questions/6080295/how-to-rename-a-file-using-java-io-packages#6080330
Thanks,
Itay

@phax phax self-assigned this Sep 13, 2020
@phax phax added the bug label Sep 17, 2020
@phax
Copy link
Owner

phax commented Sep 17, 2020

Hi Itay,
please post some stacktrace here.
I checked the AS2IOHelper.moveFile and it actually does copy + delete.
I scanned the sources and I don't see any call to renameTo.
Thanks, Philip

@ihudedi
Copy link
Author

ihudedi commented Sep 21, 2020

Hi Philip,
You can see it in AS2IOHelper.getFileOperationManager ().renameFile
This method actual call the renameTo in java.io
You can search for all occurancies.
It's exist in AbstractStorageModule::store
Thanks,
Itay

phax added a commit that referenced this issue Sep 21, 2020
@phax
Copy link
Owner

phax commented Sep 21, 2020

Thanks Itay for pointing me to the right place - too many abstraction layers in place ;-)
Fixed in the latest SNAPSHOT. Will be part of of the 4.6.3 release

@phax phax closed this as completed Sep 21, 2020
@ihudedi
Copy link
Author

ihudedi commented Sep 22, 2020

Hi Philip,
Do you know when 4.6.3 is going to be released?
Thanks,
Itay

@phax
Copy link
Owner

phax commented Sep 22, 2020

Work in progress - on Maven Central within the next half hour

@ihudedi
Copy link
Author

ihudedi commented Sep 22, 2020

Thanks a lot for the quick response.
Itay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants