public final class Resource
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static Resource |
resource
The singleton element.
|
Modifier | Constructor and Description |
---|---|
private |
Resource()
Since this is a singleton class, nobody should be able to instanciate it.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
getBytesFromResourceLocation(java.lang.String rawResrcLoc)
Gets the byte data from a file at the given resource location.
|
private byte[] |
getBytesFromStream(java.io.InputStream stream)
Gets the byte data from a file.
|
static Resource |
getInstance() |
private java.io.FileInputStream |
getStreamFromFile(java.lang.String fileName)
Gets the byte data from a file.
|
java.io.InputStream |
getStreamFromResourceLocation(java.lang.String rawResrcLoc)
Gets the byte data from a file at the given resource location.
|
static java.util.Properties |
readProperties(java.lang.String resourceName) |
private static Resource resource
private Resource()
public static Resource getInstance()
public static java.util.Properties readProperties(java.lang.String resourceName) throws java.io.IOException
resourceName
- java.io.IOException
public byte[] getBytesFromResourceLocation(java.lang.String rawResrcLoc)
rawResrcLoc
- Description of the Parameterprivate byte[] getBytesFromStream(java.io.InputStream stream)
stream
- Description of the Parameterprivate java.io.FileInputStream getStreamFromFile(java.lang.String fileName)
fileName
- Description of the Parameterpublic java.io.InputStream getStreamFromResourceLocation(java.lang.String rawResrcLoc)
rawResrcLoc
- Description of the Parameter