public static class ResourcePathManager.Resource
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
TYPE_HTML |
static int |
TYPE_JSON |
static int |
TYPE_MP4 |
static int |
TYPE_PDF |
Constructor and Description |
---|
Resource(int type,
java.lang.String dir,
java.lang.String name)
Initializes this Resource object
|
Resource(int type,
java.lang.String dir,
java.lang.String name,
java.lang.Class clazz)
Initializes this Resource object
|
Modifier and Type | Method and Description |
---|---|
<T> T |
create(android.content.Context context)
Create this Resource into an Object of type T.
|
java.lang.String |
getAbsolutePath()
Returns the absolute path of this Resource
|
java.lang.String |
getDir()
Returns the directroy path of this Resource
|
java.lang.String |
getFileExtension()
Returns the file extension of this Resource
|
java.lang.String |
getName()
Returns the name of this Resource
|
java.lang.String |
getRelativePath()
Returns the relative path of this Resource
|
int |
getType()
Returns the file type of this Resource
|
java.io.InputStream |
open(android.content.Context context)
Returns an inputstream for this Resource
|
public static final int TYPE_HTML
public static final int TYPE_JSON
public static final int TYPE_PDF
public static final int TYPE_MP4
public Resource(int type, java.lang.String dir, java.lang.String name)
type
- the type of file of the resourcedir
- the sub directory of the fielname
- the name of the file (excluding extension)public Resource(int type, java.lang.String dir, java.lang.String name, java.lang.Class clazz)
type
- the type of file of the resourcedir
- the dir path of the filename
- the name of the file (excluding extension)clazz
- the class file that this file is represented aspublic java.lang.String getDir()
public java.lang.String getName()
public int getType()
public <T> T create(android.content.Context context)
context
- android contextpublic java.io.InputStream open(android.content.Context context)
context
- android contextpublic java.lang.String getAbsolutePath()
public java.lang.String getRelativePath()
public java.lang.String getFileExtension()