Merge pull request #594 from andrewgaul/in-directory-null

Do not set member until we completely validate it
This commit is contained in:
Adrian Cole 2012-04-30 15:16:00 -07:00
commit ca32ab3af5
1 changed files with 2 additions and 1 deletions

View File

@ -140,8 +140,9 @@ public class ListContainerOptions extends ListOptions implements Cloneable {
*
*/
public ListContainerOptions inDirectory(String dir) {
this.dir = checkNotNull(dir, "dir");
checkNotNull(dir, "dir");
checkArgument(!dir.equals("/"), "dir must not be a slash");
this.dir = dir;
return this;
}