URL odnosnikiem do katalogu

0

Witam

classPath = new URL[]{ new URL("file://E:/")};
...
programClass = classLoader.loadClass(genName);

I to dziala.
Ale jesli dam

classPath = new URL[]{ new URL("file://E:/katalog")};<code>
To juz nie widzi klasy do zaladowania. Dlaczego?
0
folly_niezalogowany napisał(a)

classPath = new URL[]{ new URL("file://E:/katalog")};



nie testowałem tego ale może dodaj / na końcu ? 
Nie dostajesz żadnego SecurityException ?
0

Podejrzewam ze uzyty jest URLClassLoader, zatem za API:
"This class loader is used to load classes and resources from a search path of URLs referring to both JAR files and directories. Any URL that ends with a '/' is assumed to refer to a directory. Otherwise, the URL is assumed to refer to a JAR file which will be opened as needed."

Zatem, poprzedni post daje rozwiazanie problemu.

1 użytkowników online, w tym zalogowanych: 0, gości: 1