diff java-genomics-toolkit/gui/edu/unc/genomics/ResourceManager.java @ 0:1daf3026d231

Upload alpha version
author timpalpant
date Mon, 13 Feb 2012 21:55:55 -0500
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/java-genomics-toolkit/gui/edu/unc/genomics/ResourceManager.java	Mon Feb 13 21:55:55 2012 -0500
@@ -0,0 +1,33 @@
+package edu.unc.genomics;
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+/**
+ * Find resources based on platform/package
+ * @author timpalpant
+ *
+ */
+public class ResourceManager {
+	
+	private static final Path ASSEMBLIES_DIR = Paths.get("assemblies");
+	private static final Path IMAGES_DIR = Paths.get("images");
+	
+	public static Path getResourceDirectory() {
+		Path osx = Paths.get("../Resources");
+		if (Files.exists(osx)) {
+			return osx;
+		}
+		
+		return Paths.get("resources");
+	}
+	
+	public static Path getAssembliesDirectory() {
+		return getResourceDirectory().resolve(ASSEMBLIES_DIR);
+	}
+	
+	public static Path getImagesDirectory() {
+		return getResourceDirectory().resolve(IMAGES_DIR);
+	}
+}