Made the initResourceDir method public so that we can reconfigure
the resource directory in tools. git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@504 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
@@ -321,6 +321,35 @@ public class ResourceManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (Re)initializes the directory to search for resource files.
|
||||||
|
*
|
||||||
|
* @param resourceDir the directory path, or <code>null</code> to set the resource dir to
|
||||||
|
* the value of the <code>resource_dir</code> system property.
|
||||||
|
*/
|
||||||
|
public void initResourceDir (String resourceDir)
|
||||||
|
{
|
||||||
|
// if none was specified, check the resource_dir system property
|
||||||
|
if (resourceDir == null) {
|
||||||
|
try {
|
||||||
|
resourceDir = System.getProperty("resource_dir");
|
||||||
|
} catch (SecurityException se) {
|
||||||
|
// no problem
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// if we found no resource directory, don't use one
|
||||||
|
if (resourceDir == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// make sure there's a trailing slash
|
||||||
|
if (!resourceDir.endsWith(File.separator)) {
|
||||||
|
resourceDir += File.separator;
|
||||||
|
}
|
||||||
|
_rdir = new File(resourceDir);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Given a path relative to the resource directory, the path is properly jimmied (assuming we
|
* Given a path relative to the resource directory, the path is properly jimmied (assuming we
|
||||||
* always use /) and combined with the resource directory to yield a {@link File} object that
|
* always use /) and combined with the resource directory to yield a {@link File} object that
|
||||||
@@ -665,29 +694,6 @@ public class ResourceManager
|
|||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void initResourceDir (String resourceDir)
|
|
||||||
{
|
|
||||||
// if none was specified, check the resource_dir system property
|
|
||||||
if (resourceDir == null) {
|
|
||||||
try {
|
|
||||||
resourceDir = System.getProperty("resource_dir");
|
|
||||||
} catch (SecurityException se) {
|
|
||||||
// no problem
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// if we found no resource directory, don't use one
|
|
||||||
if (resourceDir == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// make sure there's a trailing slash
|
|
||||||
if (!resourceDir.endsWith(File.separator)) {
|
|
||||||
resourceDir += File.separator;
|
|
||||||
}
|
|
||||||
_rdir = new File(resourceDir);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads up a resource set based on the supplied definition information.
|
* Loads up a resource set based on the supplied definition information.
|
||||||
|
|||||||
Reference in New Issue
Block a user