Added containsResource() and a sensible toString().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@627 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: ResourceBundle.java,v 1.1 2001/11/20 00:21:41 mdb Exp $
|
// $Id: ResourceBundle.java,v 1.2 2001/11/20 03:46:28 mdb Exp $
|
||||||
|
|
||||||
package com.threerings.resource;
|
package com.threerings.resource;
|
||||||
|
|
||||||
@@ -55,6 +55,25 @@ public class ResourceBundle
|
|||||||
return stream;
|
return stream;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if this resource bundle contains the resource with the
|
||||||
|
* specified path. This avoids actually loading the resource, in the
|
||||||
|
* event that the caller only cares to know that the resource exists.
|
||||||
|
*/
|
||||||
|
public boolean containsResource (String path)
|
||||||
|
{
|
||||||
|
return (_source.getJarEntry(path) != null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a string representation of this resource bundle.
|
||||||
|
*/
|
||||||
|
public String toString ()
|
||||||
|
{
|
||||||
|
return "[path=" + _source.getName() +
|
||||||
|
", entries=" + _source.size() + "]";
|
||||||
|
}
|
||||||
|
|
||||||
/** The jar file from which we load resources. */
|
/** The jar file from which we load resources. */
|
||||||
protected JarFile _source;
|
protected JarFile _source;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user