New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow customization of libraries by server operators #808

Merged
merged 7 commits into from Jan 17, 2018

Conversation

Projects
None yet
3 participants
@smartboyathome
Contributor

smartboyathome commented Jan 8, 2018

This allows server operators to manually specify libraries that their plugins need to run. Phase one of #451.

@@ -0,0 +1,134 @@
package net.glowstone.util;

This comment has been minimized.

@mastercoms

mastercoms Jan 9, 2018

Member

Perhaps move these into a new package?

@mastercoms mastercoms changed the title from Allow customization of libraries by server operators. to Allow customization of libraries by server operators Jan 9, 2018

@momothereal momothereal referenced this pull request Jan 9, 2018

Merged

Config validation #809

smartboyathome added some commits Jan 9, 2018

import net.glowstone.util.Library;
import net.glowstone.util.LibraryManager;
import net.glowstone.library.Library;
import net.glowstone.library.LibraryManager;

This comment has been minimized.

@mastercoms

mastercoms Jan 9, 2018

Member

Sorry that I wasn't clear, I meant net.glowstone.util.library, but I'm fine with this too. It's really up to you with which you feel is better.

@@ -11,7 +11,7 @@ public static void agentmain(String agentArgs, Instrumentation instrumentation)
inst = instrumentation;
}
static void addJarFile(JarFile file) {
public static void addJarFile(JarFile file) {

This comment has been minimized.

@momothereal

momothereal Jan 10, 2018

Member

Needs documentation

@@ -134,6 +138,24 @@ public boolean getBoolean(Key key) {
return bool;
}
/**
* Retrieves a section as a list of maps.
* @param key the key to look up

This comment has been minimized.

@momothereal

momothereal Jan 10, 2018

Member

Blank line before description and params

private static final String VERSION_KEY = "version";
@SuppressWarnings("unchecked")
public static Library fromConfigMap(Map<?, ?> configMap) {

This comment has been minimized.

@momothereal

momothereal Jan 10, 2018

Member

Needs documentation

this.checksumValue = checksumValue;
}
public String getGroupId() {

This comment has been minimized.

@momothereal

momothereal Jan 10, 2018

Member

Lombokify these getters

return checksumValue;
}
public Map<?, ?> toConfigMap() {

This comment has been minimized.

@momothereal

momothereal Jan 10, 2018

Member

Needs documentation

static void addJarFile(JarFile file) {
/**
* Adds a JAR file to the system class loader.
* @param file The JAR file to add to the class loader.

This comment has been minimized.

@momothereal

momothereal Jan 13, 2018

Member

Line between the description and params

@@ -227,15 +221,16 @@ String getLibrary() {
* the checksum will be automatically validated.
*
* @param file the file.
* @param checksum the reference checksum to validate the file's digest with.
* @param algorithm the {@link HashAlgorithm} used to compute the file's digest.
* @param library the library containing the algorithm and the checksum.

This comment has been minimized.

@momothereal

momothereal Jan 13, 2018

Member

the {@link Library} containing [...]

* See {@link LibraryDownloader#checksum(File, String, HashAlgorithm)}
* @param algorithm the algorithm used to validate the checksum.
* See {@link LibraryDownloader#checksum(File, String, HashAlgorithm)}
* @param library an object representing a library

This comment has been minimized.

@momothereal

momothereal Jan 13, 2018

Member

a {@link Library} instance representing a library

@momothereal momothereal requested a review from mastercoms Jan 16, 2018

@mastercoms mastercoms merged commit 1fcb93a into GlowstoneMC:dev Jan 17, 2018

2 checks passed

ci/circleci: build Your tests passed on CircleCI!
Details
license/cla Contributor License Agreement is signed.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment