Package com.norconex.commons.lang.jar
Class JarFile
- java.lang.Object
-
- com.norconex.commons.lang.jar.JarFile
-
- All Implemented Interfaces:
Comparable<JarFile>
public class JarFile extends Object implements Comparable<JarFile>
Simple Jar file representation holding name and version information.- Since:
- 1.10.0
- Author:
- Pascal Essiembre
-
-
Field Summary
Fields Modifier and Type Field Description static FileFilterFILTER
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(JarFile o)booleanequals(Object other)StringgetBaseName()StringgetFullName()DategetLastModified()FilegetPath()StringgetVersion()inthashCode()booleanisSameVersion(JarFile jarFile)Gets whether this Jar has the same name and version as the provided jar.booleanisSameVersionAndTime(JarFile jarFile)Gets whether this Jar has the same name and version as the provided jar, as well as the same last modified date.booleanisVersionGreaterThan(JarFile file)StringtoString()
-
-
-
Field Detail
-
FILTER
public static final FileFilter FILTER
-
-
Constructor Detail
-
JarFile
public JarFile(File jarFile)
-
-
Method Detail
-
getPath
public File getPath()
-
getFullName
public String getFullName()
-
getBaseName
public String getBaseName()
-
getVersion
public String getVersion()
-
getLastModified
public Date getLastModified()
-
isVersionGreaterThan
public boolean isVersionGreaterThan(JarFile file)
-
isSameVersion
public boolean isSameVersion(JarFile jarFile)
Gets whether this Jar has the same name and version as the provided jar.- Parameters:
jarFile- jar file- Returns:
trueif the jar names and versions are the same.- Since:
- 1.13.0
-
isSameVersionAndTime
public boolean isSameVersionAndTime(JarFile jarFile)
Gets whether this Jar has the same name and version as the provided jar, as well as the same last modified date.- Parameters:
jarFile- jar file- Returns:
trueif the jar names, versions and last modified dates are the same.- Since:
- 1.13.0
-
compareTo
public int compareTo(JarFile o)
- Specified by:
compareToin interfaceComparable<JarFile>
-
-