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:
11: public String type;
12:
13: public boolean valid() throws Exception {
14: File file = null;
15: if ("dir".equals(type)) {
16: file = new File(FileSection.getFileSection().getPath()
17: + "/" + path);
18: file.mkdir();
19: } else {
20: file = new File(FileSection.getFileSection().getPath()
21: + "/" + path);
22: file.createNewFile();
23: }
24: return file.exists();
25: }
26: }
|