h-bomb
h-bomb

Reputation: 356

Do the methods in Apache's FileUtils peform synchronous (blocking) i/o?

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.

Upvotes: 2

Views: 3978

Answers (1)

Perception
Perception

Reputation: 80633

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.

Upvotes: 2

Related Questions