01: // Copyright (C) 2003,2004,2005 by Object Mentor, Inc. All rights reserved.
02: // Released under the terms of the GNU General Public License version 2 or later.
03: package fitnesse.fixtures;
04:
05: import fit.ColumnFixture;
06: import java.io.File;
07:
08: public class FileSectionFileAdder extends ColumnFixture {
09: public String path;
10: public String type;
11:
12: public boolean valid() throws Exception {
13: File file = null;
14: if ("dir".equals(type)) {
15: file = new File(FileSection.getFileSection().getPath()
16: + "/" + path);
17: file.mkdir();
18: } else {
19: file = new File(FileSection.getFileSection().getPath()
20: + "/" + path);
21: file.createNewFile();
22: }
23: return file.exists();
24: }
25: }
|