Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected URL findURL(ClassLoader cl)
- {
- URL u = cl.getResource(nativeName);
- String nativeFile = (new StringBuffer("native/".length() + nativeName.length())).append("native/").append(nativeName).toString();
- String metaInfFile = (new StringBuffer("META-INF/".length() + nativeName.length())).append("META-INF/").append(nativeName).toString();
- if(u == null)
- u = cl.getResource(nativeFile);
- if(u == null)
- u = cl.getResource(metaInfFile);
- if(u == null)
- {
- File f = new File(nativeFile);
- if(f.exists())
- try
- {
- u = f.toURL();
- }
- catch(MalformedURLException malformedurlexception) { }
- }
- if(u == null)
- {
- File f = new File(metaInfFile);
- if(f.exists())
- try
- {
- u = f.toURL();
- }
- catch(MalformedURLException malformedurlexception1) { }
- }
- return u;
- }
- public final String getGeneratedName()
- {
- return nativeName;
- }
- public final String getName()
- {
- return name;
- }
- public final String toString()
- {
- return toStringBuffer(null).toString();
- }
- public StringBuffer toStringBuffer(StringBuffer in)
- {
- if(in == null)
- in = new StringBuffer(64);
- else
- in.ensureCapacity(in.length() + 64);
- in.append("{ NativeLoader: name = ");
- in.append(name);
- in.append(", nativeName = ");
- in.append(nativeName);
- in.append(" }");
- return in;
- }
- private static String osPrefix;
- private static String osSuffix;
- private final String name;
- private final String nativeName;
- private boolean attemptedLoading;
- private boolean loadingSuccessful;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement