Do not eagerly check for existence in FilePayload

This is a TOCTOU violation and FilePayload.getInput already propagates
this.  This commit allows external callers like jclouds-cli to
introspect on the exception type, returning a more friendly error
message in some situations.
This commit is contained in:
Andrew Gaul 2013-07-15 23:26:42 -07:00
parent d52f460562
commit ac58a70e32
1 changed files with 1 additions and 1 deletions

View File

@ -34,7 +34,7 @@ public class FilePayload extends BasePayload<File> {
public FilePayload(File content) {
super(content);
getContentMetadata().setContentLength(content.length());
checkArgument(checkNotNull(content, "content").exists(), "file must exist: " + content);
checkNotNull(content, "content");
}
/**