문제

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:

  1. FileUtils is not part of the standard JDK, it a class in the Apache Commons IO library.
  2. The operations you mentioned do not use non-blocking IO.

So to answer your question, yes, your overall operation is safe.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top