Class AppStarter.ClassPathIndexFile
java.lang.Object
de.iip_ecosphere.platform.services.spring.loader.AppStarter.ClassPathIndexFile
- Enclosing class:
AppStarter
A class path index file that provides ordering information for JARs. Taken over from spring as not accessible.
- Author:
- Spring
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateClassPathIndexFile(File root, List<String> lines) Creates an instance based on a file root and a listing of index lines. -
Method Summary
Modifier and TypeMethodDescriptionprivate static FileTurns an URL into a file.private URLTurns a line into an URL.(package private) booleancontainsEntry(String name) Returns whether a given name is contained in the index.private StringextractName(String line) Extracts the name from the line.getUrls()Returns the URLs of all entries.private static AppStarter.ClassPathIndexFileloadIfPossible(File root, File indexFile) Loads the classpath index file if possible.private static AppStarter.ClassPathIndexFileloadIfPossible(File root, String location) Loads the classpath index file if possible.(package private) static AppStarter.ClassPathIndexFileloadIfPossible(URL root, String location) Loads the classpath index file if possible.loadLines(InputStream inputStream) Loads the lines of the index file.(package private) intsize()Returns the size of the classpath index, i.e., the number of lines.
-
Field Details
-
root
-
lines
-
-
Constructor Details
-
ClassPathIndexFile
Creates an instance based on a file root and a listing of index lines.- Parameters:
root- the rootlines- the lines
-
-
Method Details
-
extractName
Extracts the name from the line.- Parameters:
line- the line- Returns:
- the extracted name
- Throws:
IllegalStateException- if the classpath index is malformed
-
size
int size()Returns the size of the classpath index, i.e., the number of lines.- Returns:
- the size
-
containsEntry
Returns whether a given name is contained in the index.- Parameters:
name- the name to look for- Returns:
truewhether an entry for that name is known,falseelse
-
getUrls
Returns the URLs of all entries.- Returns:
- the URLs
-
asUrl
Turns a line into an URL.- Parameters:
line- the line- Returns:
- the URL
- Throws:
IllegalStateException- if the URL cannot be constructed
-
loadIfPossible
Loads the classpath index file if possible.- Parameters:
root- the root URLlocation- the location of the classpath index file- Returns:
- the classpath index file, may be null for none/not found (legacy loading)
- Throws:
IOException- if the file cannot be read
-
loadIfPossible
private static AppStarter.ClassPathIndexFile loadIfPossible(File root, String location) throws IOException Loads the classpath index file if possible.- Parameters:
root- the root URLlocation- the location of the classpath index file- Returns:
- the classpath index file, may be null for none/not found (legacy loading)
- Throws:
IOException- if the file cannot be read
-
loadIfPossible
private static AppStarter.ClassPathIndexFile loadIfPossible(File root, File indexFile) throws IOException Loads the classpath index file if possible.- Parameters:
root- the root URLindexFile- the classpath index file- Returns:
- the classpath index file, may be null for none/not found (legacy loading)
- Throws:
IOException- if the file cannot be read
-
loadLines
Loads the lines of the index file.- Parameters:
inputStream- the input stream to load from- Returns:
- the lines
- Throws:
IOException- if reading the lines fails
-
asFile
Turns an URL into a file.- Parameters:
url- the URL- Returns:
- the file
-