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.*;
06: import java.io.File;
07: import fitnesse.util.FileUtil;
08:
09: public class FileSection extends Fixture {
10: private static File fileSection;
11:
12: public static File getFileSection() {
13: return fileSection;
14: }
15:
16: public void doTable(Parse table) {
17: try {
18: String arg = getArgs()[0];
19: if ("setup".equals(arg.toLowerCase())) {
20: new File(FitnesseFixtureContext.baseDir).mkdir();
21: File dir = new File(FitnesseFixtureContext.baseDir
22: + "/" + FitnesseFixtureContext.root.getName());
23: dir.mkdir();
24: fileSection = new File(dir, "files");
25: fileSection.mkdir();
26: } else {
27: FileUtil
28: .deleteFileSystemDirectory(FitnesseFixtureContext.baseDir);
29: fileSection = null;
30: }
31: } catch (Exception e) {
32: exception(table, e);
33: }
34: }
35: }
|