Do the methods in Apache's FileUtils peform synchronous (blocking) i/o?
-
30-05-2021 - |
문제
Do the methods in Apache's FileUtils perform synchronous (blocking) i/o?
I am making a call to FileUtils.copyDirectoryToDirectory. In my next line, I want to delete the directory that I copied.
Example:
FileUtils.copyDirectoryToDirectory(source, destination);
FileUtils.deleteDirectory(source);
Just want to make sure this is "safe" and asynchronous (non-blocking) i/o isn't happening.
Thanks.
해결책
Two things:
- FileUtils is not part of the standard JDK, it a class in the Apache Commons IO library.
- The operations you mentioned do not use non-blocking IO.
So to answer your question, yes, your overall operation is safe.
제휴하지 않습니다 StackOverflow