annotate gui/edu/unc/genomics/ResourceManager.java @ 2:e16016635b2a

Uploaded
author timpalpant
date Mon, 13 Feb 2012 22:12:06 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
1 package edu.unc.genomics;
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
2
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
3 import java.nio.file.Files;
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
4 import java.nio.file.Path;
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
5 import java.nio.file.Paths;
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
6
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
7 /**
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
8 * Find resources based on platform/package
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
9 * @author timpalpant
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
10 *
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
11 */
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
12 public class ResourceManager {
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
13
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
14 private static final Path ASSEMBLIES_DIR = Paths.get("assemblies");
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
15 private static final Path IMAGES_DIR = Paths.get("images");
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
16
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
17 public static Path getResourceDirectory() {
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
18 Path osx = Paths.get("../Resources");
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
19 if (Files.exists(osx)) {
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
20 return osx;
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
21 }
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
22
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
23 return Paths.get("resources");
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
24 }
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
25
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
26 public static Path getAssembliesDirectory() {
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
27 return getResourceDirectory().resolve(ASSEMBLIES_DIR);
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
28 }
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
29
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
30 public static Path getImagesDirectory() {
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
31 return getResourceDirectory().resolve(IMAGES_DIR);
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
32 }
e16016635b2a Uploaded
timpalpant
parents:
diff changeset
33 }