public final class Medias extends Object
FactoryMedia
.
This class is Thread-Safe.
Modifier and Type | Method and Description |
---|---|
static Media |
create(String... path)
Create a media.
|
static Media |
get(File file)
Get a media from an existing file descriptor.
|
static List<Media> |
getByExtension(File jar,
String fullPath,
int prefixLength,
String extension)
Get all media by extension found in the direct JAR path (does not search in sub folders).
|
static List<Media> |
getByExtension(String extension,
Media folder)
Get all media by extension found in the direct path (does not search in sub folders).
|
static File |
getJarResources()
Get the running JAR resources.
|
static String |
getJarResourcesPrefix()
Get the running JAR resources prefix folder.
|
static String |
getResourcesDirectory()
Get the resources directory.
|
static Class<?> |
getResourcesLoader()
Get the resources loader.
|
static String |
getSeparator()
Get the path separator.
|
static Media |
getWithSuffix(Media media,
String suffix)
Get the media with an additional suffix, just before the dot of the extension if has.
|
static void |
setFactoryMedia(FactoryMedia factoryMedia)
Set the media factory used.
|
static void |
setLoadFromJar(Class<?> clazz)
Activate or no the resources loading from *.jar.
|
static void |
setResourcesDirectory(String directory)
Define resources directory.
|
static void |
setSeparator(String separator)
Set the path separator.
|
public static Media create(String... path)
path
- The media path.LionEngineException
- If path is null
.public static Media get(File file)
setResourcesDirectory(String)
must be activated.file
- The file descriptor.public static List<Media> getByExtension(String extension, Media folder)
extension
- The extension (without dot; eg: png).folder
- The folder to search in.public static List<Media> getByExtension(File jar, String fullPath, int prefixLength, String extension)
jar
- The JAR file.fullPath
- The full path in JAR.prefixLength
- The prefix length in JAR.extension
- The extension (without dot; eg: png).public static void setFactoryMedia(FactoryMedia factoryMedia)
factoryMedia
- The media factory used.public static void setResourcesDirectory(String directory)
directory
- The main resources directory (may be null
).public static void setLoadFromJar(Class<?> clazz)
null
value will disable load from jar.clazz
- The class loader reference (resources entry point).public static Media getWithSuffix(Media media, String suffix)
media
- The current media reference.suffix
- The suffix to add.public static String getResourcesDirectory()
public static Class<?> getResourcesLoader()
null
if none.public static File getJarResources()
LionEngineException
- If JAR not available.public static String getJarResourcesPrefix()
LionEngineException
- If JAR not available.public static void setSeparator(String separator)
separator
- The path separator.public static String getSeparator()
Copyright © 2017 Byron 3D Games Studio. All rights reserved.