summaryrefslogtreecommitdiff
path: root/gi/posterior-regularisation/prjava/src/util/FileSystem.java
blob: d7812e4023c1026b695bf3c22e1f383922e74738 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package util;

import java.io.File;

public class FileSystem {
	public static boolean createDir(String directory) {

		File dir = new File(directory);
		if (!dir.isDirectory()) {
			boolean success = dir.mkdirs();
			if (!success) {
				System.out.println("Unable to create directory " + directory);
				return false;
			}
			System.out.println("Created directory " + directory);
		} else {
			System.out.println("Reusing directory " + directory);
		}
		return true;
	}
}