org.freehep.application.studio
Class LibInfo

java.lang.Object
  extended by org.freehep.application.studio.LibInfo

public class LibInfo
extends Object

Library file descriptor.

Typically, instances of this class describe either libraries referenced in a plugin descriptor, or library files installed in one of the extension directories.

If a library descriptor is a part of a plugin descriptor (obtained from a list returned by PluginInfo.getLibraries(), its location and href are set to corresponding fields in the plugin descriptor. version is only set if the location is in valid id-version.ext format. If not, it remains undefined, end the ID is set to location without extension. All other fields are undefined, and corresponding getters return null.

If a library descriptor corresponds to a file on disk, its location is set to the file name (without extension). If the file name is in valid ID-version format, it is parsed to set both id and version. Otherwise, ID is set to the file name and the version remains undefined. dir corresponds to the installation directory, and file is an absolute abstract path. All other fields are undefined, and corresponding getters return null.

Author:
onoprien

Constructor Summary
LibInfo(File file, PluginDir dir)
          Constructs library descriptor given a file name and an installation directory.
LibInfo(LibInfo other)
          Copy constructor.
LibInfo(String location, String href)
          Constructs library descriptor from information found in a plugin descriptor.
 
Method Summary
 boolean checkMavenID()
          Attempts to read Maven manifest and set this library id and version to maven artifact and version.
 boolean equals(Object o)
           
 PluginDir getDir()
           
 File getFile()
           
 String getHref()
           
 String getId()
           
 String getLocation()
           
 String getVersion()
           
 int hashCode()
           
 void setDir(PluginDir dir)
           
 void setFile(File file)
           
 void setHref(String href)
           
 void setId(String id)
           
 void setLocation(String location)
           
 void setVersion(String version)
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LibInfo

public LibInfo(String location,
               String href)
Constructs library descriptor from information found in a plugin descriptor. If location is in valid ID-version.ext format, it is parsed to set both ID and version. Otherwise, ID is set to location without extension, and the version remains unknown.


LibInfo

public LibInfo(File file,
               PluginDir dir)
Constructs library descriptor given a file name and an installation directory. If the file name is in valid ID-version format, it is parsed to set both ID and version. Otherwise, ID is set to the file name (without extension) and the version remains unknown.


LibInfo

public LibInfo(LibInfo other)
Copy constructor. All fields are copied.

Method Detail

getId

public String getId()

setId

public void setId(String id)

getVersion

public String getVersion()

setVersion

public void setVersion(String version)

getLocation

public String getLocation()

setLocation

public void setLocation(String location)

getHref

public String getHref()

setHref

public void setHref(String href)

getDir

public PluginDir getDir()

setDir

public void setDir(PluginDir dir)

getFile

public File getFile()

setFile

public void setFile(File file)

checkMavenID

public final boolean checkMavenID()
Attempts to read Maven manifest and set this library id and version to maven artifact and version.

Returns:
True if artifact and version were successfully extracted.

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2000-2013 FreeHEP. All Rights Reserved.