Do not set member until we completely validate it

This commit is contained in:
Andrew Gaul 2012-04-30 13:13:54 -07:00 committed by Andrew Gaul
parent af65dbbac3
commit c7dc1213f0
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;
}