public abstract class Install extends Object
This is a useful package to deploy file based resources along with the classloader. Files or directories are detected via classloader and copied temporarily to the file system. Here you can access the resources locally - for example for loading a native library.
Platform dependent resources are supported via subdirectories.
When loading a non platform dependent resource, the file is searched in the class loader with getResourceAsStream(x) where x is
Install
instance| Constructor and Description |
|---|
Install(String path,
String name,
boolean platformDependent) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
delete()
Delete the temporary installation.
|
ClassLoader |
getClassLoader() |
File |
getFile() |
File[] |
getFiles() |
String |
getName() |
String |
getPath() |
static String |
getPlatformDefaultId() |
static String |
getPlatformFallbackId() |
static String |
getPlatformId() |
boolean |
isPlatformDependent() |
File |
load()
Load the first occurrence of the designated target from the classloader
and save it as a local temporary resource.
|
File[] |
loadAll()
Load all occurrences of the designated target from the classloader.
|
void |
setClassLoader(ClassLoader classLoader) |
static void |
setPlatformDefaultId(String value) |
static void |
setPlatformFallbackId(String value) |
static void |
setPlatformId(String value) |
public static String getPlatformDefaultId()
public static String getPlatformFallbackId()
public static String getPlatformId()
public static void setPlatformDefaultId(String value)
public static void setPlatformFallbackId(String value)
public static void setPlatformId(String value)
public boolean delete()
true if all artifacts are deleted.public ClassLoader getClassLoader()
public File getFile()
public File[] getFiles()
public String getName()
public String getPath()
public boolean isPlatformDependent()
public File load() throws IOException
IOExceptionpublic File[] loadAll() throws IOException
IOExceptionpublic void setClassLoader(ClassLoader classLoader)
Copyright © 2013 intarsys consulting GmbH. All Rights Reserved.