public class LibInfo extends Object
Typically, instances of this class describe either libraries referenced in a plugin descriptor, or library files installed in one of the extension directories.
In a library descriptor that is a part of a plugin descriptor (obtained from a list returned by
PluginInfo.getLibraries()
, href property is copied from the plugin manifest.
If LOCATION string found in the plugin manifest is in valid ID-VERSION.ext format,
both id and location properties are set to ID, and version property is set
to VERSION. If LOCATION string in the plugin manifest is not in valid ID-VERSION.ext
format, both id and location are initially set to LOCATION with stripped extension,
and version remains undefined. When a library descriptor with undefined version is added to
PluginMap
, it's id property may be modified if the location-to-id map found in the application
extension directory where the plugin is installed maps its location to some id.
dir property corresponds to the plugin installation directory, if known. All other properties are undefined.
In a library descriptor that corresponds to a file on disk, if the file name is in valid ID-VERSION.ext format, both id and location properties are set to ID, and version property is set to VERSION. Otherwise, location is set to the file name (without extension), id and version are set based on maven manifest embedded in the file. If the manifest is not found, id is set to location (file name without extension), and version remains undefined. dir corresponds to the installation directory, and file is an absolute abstract path of the file.
Getters for all undefined properties return null.
Constructor and Description |
---|
LibInfo(File file,
PluginDir dir)
Constructs library descriptor given a file and an installation directory.
|
LibInfo(LibInfo other)
Copy constructor.
|
LibInfo(String location,
String href)
Constructs library descriptor from information found in a plugin manifest.
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkMavenID()
Attempts to read maven manifest and set this library id and version to maven artifact and version.
|
PluginDir |
getDir() |
File |
getFile() |
String |
getHref() |
String |
getId() |
String |
getLocation() |
String |
getVersion() |
void |
setDir(PluginDir dir) |
void |
setFile(File file) |
void |
setHref(String href) |
void |
setId(String id) |
void |
setLocation(String location) |
void |
setVersion(String version) |
public LibInfo(String location, String href)
location
- Location as read from plugin manifest, expected to end with a file extension.href
- HREF as read from plugin manifest.public LibInfo(File file, PluginDir dir)
public LibInfo(LibInfo other)
public String getId()
public void setId(String id)
public String getVersion()
public void setVersion(String version)
public String getLocation()
public void setLocation(String location)
public String getHref()
public void setHref(String href)
public PluginDir getDir()
public void setDir(PluginDir dir)
public File getFile()
public void setFile(File file)
public final boolean checkMavenID()
Copyright © 2000–2015 FreeHEP. All rights reserved.