Skip to content

BoyBACKS/releasesChecker-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Release Checker - API

Easy to use and lightweight api for notify about new release version from GitHub

Table of Contentes

  1. About
  2. Short Wiki
  3. Libraries and API's
  4. Installation
  5. Contributing
  6. ToDo
  7. License

About

This api works by getting releases versions via GitHub API, using link https://api.github.com/repos/[REPOSITORY AUTHOR]/[REPOSITORY NAME]/releases".

The methods described in Method Summary, modify the values of the variables,

private static String version;
private static String repositoryURL;

coded in API. This API uses jsonSimple library to work, maven dependency is in Installation*. In case of errors with API please describe it in Issues.

Short Wiki

Method Summary

Type Method Description
String getVersion(String version) Get the latest release version
String getRepository(String author, String repositoryName) Get the author and repository name
boolean releaseCheck() Gets state of latest release

Errors

Message Reason
[ERROR] Assign a version using getVersion(). Setting default value as FALSE. You need to specify a version of release
[ERROR] Assign a repository URL using getRepository(). Setting default value as FALSE. You need to specify a repository and release
java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0 There is no releases in that repository

Working Example

public static void main(String[] args) {
  getVersion("v2.0");
  getRepository("boybacks", "xorencrypt");
  if (releaseCheck()) {
    System.out.println("There is no new versions");
  }
  else {
    System.out.println("There is new version");
  }
}

Libraries and API's

Installation

Add this to your maven project in pom.xml file:

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

Compile scope is very important If you don't want to add dependencies manually or by using external jar files:

<dependency>
    <groupId>com.github.BoyBACKS</groupId>
    <artifactId>releasesChecker-API</artifactId>
    <version>v1.2.1</version>
    <scope>compile</scope>
</dependency>

* For v1.2.1, adding jsonSimple dependency is not required:

<dependency>
    <groupId>com.googlecode.json-simple</groupId>
    <artifactId>json-simple</artifactId>
    <version>1.1.1</version>
</dependency>

Contributing

Pull requests are always welcome. For bigger changes, please open an issue first to discuss what you would like to change.

ToDo

  • For now, we do not expect another versions.

Donate

Would you like to support my work? Click here how you would like to do it!

License

GNU GPLv3