public abstract class Media extends Object
HDD
, JAR
...
Example:
Engine.start("First Code", Version.create(1, 0, 0), "resources"); final Media media = Media.get("img", "image.png"); System.out.println(media.getPath()); // print: resources/img/image.png
Constructor and Description |
---|
Media() |
Modifier and Type | Method and Description |
---|---|
static Media |
create(String path)
Create a media.
|
abstract File |
getFile()
Get the file descriptor.
|
abstract OutputStream |
getOutputStream()
Get the media output stream.
|
abstract String |
getPath()
Get the media path.
|
static String |
getPath(String... path)
Construct a usable path using a list of string, automatically separated by the portable separator.
|
static String |
getPathSeparator(String separator,
String... path)
Construct a usable path using a list of string, automatically separated by the portable separator.
|
static String |
getSeparator()
Get the media separator.
|
abstract InputStream |
getStream()
Get the media stream.
|
static void |
setSeparator(String separator)
Set the file separator.
|
public static Media create(String path)
path
- The media path.public static void setSeparator(String separator)
separator
- The file separator.public static String getSeparator()
public static String getPath(String... path)
path
- The list of folders (if has) and file.public static String getPathSeparator(String separator, String... path)
separator
- The separator to use.path
- The list of folders (if has) and file.public abstract String getPath()
public abstract File getFile()
public abstract InputStream getStream()
public abstract OutputStream getOutputStream()
Copyright © 2014 Byron 3D Games Studio. All rights reserved.