JaRMoS  1.1
Java Reduced Model Simulations
 All Classes Namespaces Files Functions Variables Enumerator Groups Pages
WebModelManager.java
Go to the documentation of this file.
1 package jarmos.app.io;
2 
3 import jarmos.app.Const;
4 
5 import java.io.IOException;
6 import java.net.URL;
7 
8 import android.content.Context;
9 import android.util.Log;
10 
17 public class WebModelManager extends jarmos.io.WebModelManager {
18 
19  private DexHelper dh;
20 
21  public WebModelManager(URL rooturl, Context c) {
22  super(rooturl);
23  dh = new DexHelper(c);
24  }
25 
31  @Override
32  public ClassLoader getClassLoader() {
33  try {
34  return dh.getDexClassLoader(getInStream(Const.DEX_CLASSES_JARFILE));
35  } catch (IOException e) {
36  Log.e("WebModelManager", "I/O Exception during input stream creation for file " + Const.DEX_CLASSES_JARFILE
37  + " in model " + getModelDir() + ", loading from web location " + this.getModelURI(), e);
38  e.printStackTrace();
39  return null;
40  }
41  }
42 
43  @Override
44  protected String getLoadingMessage() {
45  return "Reading remote model info";
46  }
47 
48 }
ClassLoader getClassLoader()
Overrides the standard implementation as different class loaders (dex) are required within android...
final InputStream getInStream(String filename)
Returns an InputStream instance streaming the contents of the file given by filename.
static final String DEX_CLASSES_JARFILE
The file name within a model directory that contains any runtime-loadable classes.
Definition: Const.java:33
A model manager implementation that allows to load models from web locations.
String getLoadingMessage()
A short message that writes "loading SD models" dependent on the actual instance. ...
Class that contains miscellaneous JaRMoS specific constants and static functions. ...
Definition: Const.java:26
Utility class for providing class loaders that load from dex-jarfiles.
Definition: DexHelper.java:26
WebModelManager(URL rooturl, Context c)