Notice
Recent Posts
Recent Comments
Link
«   2025/04   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30
Archives
Today
Total
관리 메뉴

미래학자

test 본문

전산 지식

test

미래학자 2017. 7. 3. 00:15

test


function jQuery(a,c) {
// Shortcut for document ready (because $(document).each() is silly)
if ( a && a.constructor == Function && jQuery.fn.ready )
return jQuery(document).ready(a);
// Make sure that a selection was provided
a = a || jQuery.context || document;
// Watch for when a jQuery object is passed as the selector
if ( a.jquery )
return $( jQuery.merge( a, [] ) );
// Watch for when a jQuery object is passed at the context
if ( c && c.jquery )
return $( c ).find(a);
// If the context is global, return a new object
if ( window == this )
return new jQuery(a,c);
// Handle HTML strings
var m = /^[^<]*(<.+>)[^>]*$/.exec(a);
if ( m ) a = jQuery.clean( [ m[1] ] );
// Watch for when an array is passed in
this.get( a.constructor == Array || a.length && !a.nodeType && a[0] != undefined && a[0].nodeType ?
// Assume that it is an array of DOM Elements
jQuery.merge( a, [] ) :
// Find the matching elements and save them for later
jQuery.find( a, c ) );
// See if an extra function was provided
var fn = arguments[ arguments.length - 1 ];
// If so, execute it in context
if ( fn && fn.constructor == Function )
this.each(fn);
}
view raw js hosted with ❤ by GitHub


public class FileClassLoader {
public static void main(String[] args) {
FileClassLoader fileClassLoader = new FileClassLoader();
File cpList = new File(fileClassLoader.getClass().getResource("/").getPath(), "classpath.properties");
FileClassLoader fcl = new FileClassLoader();
try {
BufferedReader br = new BufferedReader(new FileReader(cpList));
URL[] urlList = fcl.getUrl(br);
br.close();
URLClassLoader ucl = new URLClassLoader(urlList);
Object obj = ucl.loadClass("test.Hello").newInstance();
System.out.println(obj.getClass().getSimpleName());
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
private URL[] getUrl(BufferedReader br) throws MalformedURLException, IOException {
String line = null;
URL[] urlList = null;
while((line = br.readLine()) != null) {
File cp = new File(line);
if (cp.exists()) {
URL[] temp;
int length = 0;
if (urlList != null) {
length = urlList.length;
temp = new URL[length + 1];
System.arraycopy(urlList, 0, temp, 0, length);
} else {
temp = new URL[1];
}
temp[length] = cp.toURI().toURL();
urlList = temp;
}
}
return urlList;
}
}
Comments