mirror of https://github.com/apache/jclouds.git
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:
parent
d52f460562
commit
ac58a70e32
|
@ -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");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue