Fix the whole Javadoc syntax
This commit is contained in:
parent
7f1ce66fd0
commit
e1a84448a2
@ -1,7 +1,35 @@
|
|||||||
package fr.xephi.authme;
|
package fr.xephi.authme;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.net.URLConnection;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Server;
|
||||||
|
import org.bukkit.World;
|
||||||
|
import org.bukkit.command.Command;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.plugin.PluginManager;
|
||||||
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
import org.bukkit.scheduler.BukkitTask;
|
||||||
|
import org.mcstats.Metrics;
|
||||||
|
import org.mcstats.Metrics.Graph;
|
||||||
|
|
||||||
import com.earth2me.essentials.Essentials;
|
import com.earth2me.essentials.Essentials;
|
||||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||||
|
|
||||||
import fr.xephi.authme.api.API;
|
import fr.xephi.authme.api.API;
|
||||||
import fr.xephi.authme.api.NewAPI;
|
import fr.xephi.authme.api.NewAPI;
|
||||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||||
@ -52,32 +80,6 @@ import fr.xephi.authme.util.StringUtils;
|
|||||||
import fr.xephi.authme.util.Utils;
|
import fr.xephi.authme.util.Utils;
|
||||||
import fr.xephi.authme.util.Wrapper;
|
import fr.xephi.authme.util.Wrapper;
|
||||||
import net.minelink.ctplus.CombatTagPlus;
|
import net.minelink.ctplus.CombatTagPlus;
|
||||||
import org.apache.logging.log4j.LogManager;
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.Location;
|
|
||||||
import org.bukkit.Server;
|
|
||||||
import org.bukkit.World;
|
|
||||||
import org.bukkit.command.Command;
|
|
||||||
import org.bukkit.command.CommandSender;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.plugin.PluginManager;
|
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
|
||||||
import org.bukkit.scheduler.BukkitTask;
|
|
||||||
import org.mcstats.Metrics;
|
|
||||||
import org.mcstats.Metrics.Graph;
|
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStreamReader;
|
|
||||||
import java.net.URL;
|
|
||||||
import java.net.URLConnection;
|
|
||||||
import java.util.Calendar;
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
|
||||||
import java.util.logging.Logger;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The AuthMe main class.
|
* The AuthMe main class.
|
||||||
@ -983,6 +985,8 @@ public class AuthMe extends JavaPlugin {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the management instance.
|
* Return the management instance.
|
||||||
|
*
|
||||||
|
* @return management The Management
|
||||||
*/
|
*/
|
||||||
public Management getManagement() {
|
public Management getManagement() {
|
||||||
return management;
|
return management;
|
||||||
|
|||||||
@ -1,12 +1,5 @@
|
|||||||
package fr.xephi.authme;
|
package fr.xephi.authme;
|
||||||
|
|
||||||
import fr.xephi.authme.permission.PermissionsManager;
|
|
||||||
import fr.xephi.authme.settings.Settings;
|
|
||||||
import fr.xephi.authme.util.Utils;
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.OfflinePlayer;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
@ -14,6 +7,14 @@ import java.util.concurrent.ExecutorService;
|
|||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
import java.util.concurrent.Future;
|
import java.util.concurrent.Future;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.OfflinePlayer;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import fr.xephi.authme.permission.PermissionsManager;
|
||||||
|
import fr.xephi.authme.settings.Settings;
|
||||||
|
import fr.xephi.authme.util.Utils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
public class DataManager {
|
public class DataManager {
|
||||||
@ -65,7 +66,7 @@ public class DataManager {
|
|||||||
/**
|
/**
|
||||||
* Method purgeAntiXray.
|
* Method purgeAntiXray.
|
||||||
*
|
*
|
||||||
* @param cleared List<String>
|
* @param cleared List of String
|
||||||
*/
|
*/
|
||||||
public synchronized void purgeAntiXray(List<String> cleared) {
|
public synchronized void purgeAntiXray(List<String> cleared) {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@ -90,7 +91,7 @@ public class DataManager {
|
|||||||
/**
|
/**
|
||||||
* Method purgeLimitedCreative.
|
* Method purgeLimitedCreative.
|
||||||
*
|
*
|
||||||
* @param cleared List<String>
|
* @param cleared List of String
|
||||||
*/
|
*/
|
||||||
public synchronized void purgeLimitedCreative(List<String> cleared) {
|
public synchronized void purgeLimitedCreative(List<String> cleared) {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@ -127,7 +128,7 @@ public class DataManager {
|
|||||||
/**
|
/**
|
||||||
* Method purgeDat.
|
* Method purgeDat.
|
||||||
*
|
*
|
||||||
* @param cleared List<String>
|
* @param cleared List of String
|
||||||
*/
|
*/
|
||||||
public synchronized void purgeDat(List<String> cleared) {
|
public synchronized void purgeDat(List<String> cleared) {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@ -160,7 +161,7 @@ public class DataManager {
|
|||||||
/**
|
/**
|
||||||
* Method purgeEssentials.
|
* Method purgeEssentials.
|
||||||
*
|
*
|
||||||
* @param cleared List<String>
|
* @param cleared List of String
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public void purgeEssentials(List<String> cleared) {
|
public void purgeEssentials(List<String> cleared) {
|
||||||
|
|||||||
@ -1,15 +1,16 @@
|
|||||||
package fr.xephi.authme.api;
|
package fr.xephi.authme.api;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Server;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
import fr.xephi.authme.AuthMe;
|
import fr.xephi.authme.AuthMe;
|
||||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||||
import fr.xephi.authme.cache.auth.PlayerCache;
|
import fr.xephi.authme.cache.auth.PlayerCache;
|
||||||
import fr.xephi.authme.security.crypts.HashedPassword;
|
import fr.xephi.authme.security.crypts.HashedPassword;
|
||||||
import fr.xephi.authme.util.Utils;
|
import fr.xephi.authme.util.Utils;
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.Location;
|
|
||||||
import org.bukkit.Server;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.plugin.Plugin;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The current API of AuthMe.
|
* The current API of AuthMe.
|
||||||
@ -76,7 +77,7 @@ public class NewAPI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param player
|
* @param player a Player
|
||||||
*
|
*
|
||||||
* @return true if player is a npc
|
* @return true if player is a npc
|
||||||
*/
|
*/
|
||||||
@ -85,7 +86,7 @@ public class NewAPI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param player
|
* @param player a Player
|
||||||
*
|
*
|
||||||
* @return true if the player is unrestricted
|
* @return true if the player is unrestricted
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -1,11 +1,12 @@
|
|||||||
package fr.xephi.authme.cache.auth;
|
package fr.xephi.authme.cache.auth;
|
||||||
|
|
||||||
import fr.xephi.authme.security.crypts.HashedPassword;
|
|
||||||
import org.bukkit.Location;
|
|
||||||
|
|
||||||
import static com.google.common.base.Objects.firstNonNull;
|
import static com.google.common.base.Objects.firstNonNull;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
|
|
||||||
|
import fr.xephi.authme.security.crypts.HashedPassword;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
@ -24,7 +25,7 @@ public class PlayerAuth {
|
|||||||
private String realName;
|
private String realName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* @param serialized String
|
||||||
*/
|
*/
|
||||||
public PlayerAuth(String serialized) {
|
public PlayerAuth(String serialized) {
|
||||||
this.deserialize(serialized);
|
this.deserialize(serialized);
|
||||||
@ -340,6 +341,8 @@ public class PlayerAuth {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Method to deserialize PlayerAuth
|
* Method to deserialize PlayerAuth
|
||||||
|
*
|
||||||
|
* @param str String
|
||||||
*/
|
*/
|
||||||
public void deserialize(String str) {
|
public void deserialize(String str) {
|
||||||
String[] args = str.split(";");
|
String[] args = str.split(";");
|
||||||
|
|||||||
@ -1,11 +1,12 @@
|
|||||||
package fr.xephi.authme.command;
|
package fr.xephi.authme.command;
|
||||||
|
|
||||||
import fr.xephi.authme.util.StringUtils;
|
|
||||||
import org.bukkit.command.CommandSender;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
|
import fr.xephi.authme.util.StringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The AuthMe command handler, responsible for mapping incoming commands to the correct {@link CommandDescription}
|
* The AuthMe command handler, responsible for mapping incoming commands to the correct {@link CommandDescription}
|
||||||
* or to display help messages for unknown invocations.
|
* or to display help messages for unknown invocations.
|
||||||
@ -16,6 +17,8 @@ public class CommandHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a command handler.
|
* Create a command handler.
|
||||||
|
*
|
||||||
|
* @param commandService The CommandService instance
|
||||||
*/
|
*/
|
||||||
public CommandHandler(CommandService commandService) {
|
public CommandHandler(CommandService commandService) {
|
||||||
this.commandService = commandService;
|
this.commandService = commandService;
|
||||||
@ -45,6 +48,11 @@ public class CommandHandler {
|
|||||||
return !FoundResultStatus.MISSING_BASE_COMMAND.equals(result.getResultStatus());
|
return !FoundResultStatus.MISSING_BASE_COMMAND.equals(result.getResultStatus());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param sender
|
||||||
|
* @param result
|
||||||
|
*/
|
||||||
private void executeCommand(CommandSender sender, FoundCommandResult result) {
|
private void executeCommand(CommandSender sender, FoundCommandResult result) {
|
||||||
ExecutableCommand executableCommand = result.getCommandDescription().getExecutableCommand();
|
ExecutableCommand executableCommand = result.getCommandDescription().getExecutableCommand();
|
||||||
List<String> arguments = result.getArguments();
|
List<String> arguments = result.getArguments();
|
||||||
|
|||||||
@ -1,5 +1,9 @@
|
|||||||
package fr.xephi.authme.command;
|
package fr.xephi.authme.command;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
import fr.xephi.authme.AuthMe;
|
import fr.xephi.authme.AuthMe;
|
||||||
import fr.xephi.authme.command.help.HelpProvider;
|
import fr.xephi.authme.command.help.HelpProvider;
|
||||||
import fr.xephi.authme.datasource.DataSource;
|
import fr.xephi.authme.datasource.DataSource;
|
||||||
@ -8,9 +12,6 @@ import fr.xephi.authme.output.Messages;
|
|||||||
import fr.xephi.authme.permission.PermissionsManager;
|
import fr.xephi.authme.permission.PermissionsManager;
|
||||||
import fr.xephi.authme.process.Management;
|
import fr.xephi.authme.process.Management;
|
||||||
import fr.xephi.authme.security.PasswordSecurity;
|
import fr.xephi.authme.security.PasswordSecurity;
|
||||||
import org.bukkit.command.CommandSender;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Service for implementations of {@link ExecutableCommand} to execute some common tasks.
|
* Service for implementations of {@link ExecutableCommand} to execute some common tasks.
|
||||||
@ -31,6 +32,7 @@ public class CommandService {
|
|||||||
* @param commandMapper Command mapper
|
* @param commandMapper Command mapper
|
||||||
* @param helpProvider Help provider
|
* @param helpProvider Help provider
|
||||||
* @param messages Messages instance
|
* @param messages Messages instance
|
||||||
|
* @param passwordSecurity The Password Security instance
|
||||||
*/
|
*/
|
||||||
public CommandService(AuthMe authMe, CommandMapper commandMapper, HelpProvider helpProvider, Messages messages,
|
public CommandService(AuthMe authMe, CommandMapper commandMapper, HelpProvider helpProvider, Messages messages,
|
||||||
PasswordSecurity passwordSecurity) {
|
PasswordSecurity passwordSecurity) {
|
||||||
@ -51,6 +53,12 @@ public class CommandService {
|
|||||||
messages.send(sender, messageKey);
|
messages.send(sender, messageKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param sender CommandSender
|
||||||
|
* @param messageKey MessageKey
|
||||||
|
* @param replacements String...
|
||||||
|
*/
|
||||||
public void send(CommandSender sender, MessageKey messageKey, String... replacements) {
|
public void send(CommandSender sender, MessageKey messageKey, String... replacements) {
|
||||||
messages.send(sender, messageKey, replacements);
|
messages.send(sender, messageKey, replacements);
|
||||||
}
|
}
|
||||||
@ -127,11 +135,20 @@ public class CommandService {
|
|||||||
return authMe.getManagement();
|
return authMe.getManagement();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return PermissionManager the PermissionManager
|
||||||
|
*/
|
||||||
public PermissionsManager getPermissionsManager() {
|
public PermissionsManager getPermissionsManager() {
|
||||||
// TODO ljacqu 20151226: Might be nicer to pass the perm manager via constructor
|
// TODO ljacqu 20151226: Might be nicer to pass the perm manager via constructor
|
||||||
return authMe.getPermissionsManager();
|
return authMe.getPermissionsManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param key MessageKey
|
||||||
|
* @return StringArray Array of String
|
||||||
|
*/
|
||||||
public String[] retrieveMessage(MessageKey key) {
|
public String[] retrieveMessage(MessageKey key) {
|
||||||
return messages.retrieve(key);
|
return messages.retrieve(key);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,9 +3,10 @@ package fr.xephi.authme.command;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* <p>
|
||||||
* Result of a command mapping by {@link CommandHandler}. An object of this class represents a successful mapping
|
* Result of a command mapping by {@link CommandHandler}. An object of this class represents a successful mapping
|
||||||
* as well as erroneous ones, as communicated with {@link FoundResultStatus}.
|
* as well as erroneous ones, as communicated with {@link FoundResultStatus}.
|
||||||
* <p />
|
* </p>
|
||||||
* Fields other than {@link FoundResultStatus} are available depending, among other factors, on the status:
|
* Fields other than {@link FoundResultStatus} are available depending, among other factors, on the status:
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>{@link FoundResultStatus#SUCCESS} entails that mapping the input to a command was successful. Therefore,
|
* <li>{@link FoundResultStatus#SUCCESS} entails that mapping the input to a command was successful. Therefore,
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
package fr.xephi.authme.command;
|
package fr.xephi.authme.command;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Common base type for player-only commands, handling the verification that the command sender is indeed a player.
|
* Common base type for player-only commands, handling the verification that the command sender is indeed a player.
|
||||||
*/
|
*/
|
||||||
@ -35,7 +35,7 @@ public abstract class PlayerCommand implements ExecutableCommand {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return an alternative command (textual representation) that is not restricted to players only.
|
* Return an alternative command (textual representation) that is not restricted to players only.
|
||||||
* Example: "authme register <playerName> <password>"
|
* Example: "authme register <playerName> <password>"
|
||||||
*
|
*
|
||||||
* @return Alternative command not only for players, or null if not applicable
|
* @return Alternative command not only for players, or null if not applicable
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -1,5 +1,11 @@
|
|||||||
package fr.xephi.authme.datasource;
|
package fr.xephi.authme.datasource;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.concurrent.ExecutorService;
|
||||||
|
import java.util.concurrent.Executors;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import com.google.common.base.Optional;
|
import com.google.common.base.Optional;
|
||||||
import com.google.common.cache.CacheBuilder;
|
import com.google.common.cache.CacheBuilder;
|
||||||
import com.google.common.cache.CacheLoader;
|
import com.google.common.cache.CacheLoader;
|
||||||
@ -7,15 +13,10 @@ import com.google.common.cache.LoadingCache;
|
|||||||
import com.google.common.cache.RemovalListener;
|
import com.google.common.cache.RemovalListener;
|
||||||
import com.google.common.cache.RemovalListeners;
|
import com.google.common.cache.RemovalListeners;
|
||||||
import com.google.common.cache.RemovalNotification;
|
import com.google.common.cache.RemovalNotification;
|
||||||
|
|
||||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||||
import fr.xephi.authme.cache.auth.PlayerCache;
|
import fr.xephi.authme.cache.auth.PlayerCache;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.concurrent.ExecutorService;
|
|
||||||
import java.util.concurrent.Executors;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
public class CacheDataSource implements DataSource {
|
public class CacheDataSource implements DataSource {
|
||||||
@ -315,7 +316,7 @@ public class CacheDataSource implements DataSource {
|
|||||||
/**
|
/**
|
||||||
* Method purgeBanned.
|
* Method purgeBanned.
|
||||||
*
|
*
|
||||||
* @param banned List<String>
|
* @param banned List of String
|
||||||
*
|
*
|
||||||
* @see fr.xephi.authme.datasource.DataSource#purgeBanned(List)
|
* @see fr.xephi.authme.datasource.DataSource#purgeBanned(List)
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
package fr.xephi.authme.datasource;
|
package fr.xephi.authme.datasource;
|
||||||
|
|
||||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
public interface DataSource {
|
public interface DataSource {
|
||||||
@ -67,7 +67,7 @@ public interface DataSource {
|
|||||||
*
|
*
|
||||||
* @param until long
|
* @param until long
|
||||||
*
|
*
|
||||||
* @return List<String>
|
* @return List of String
|
||||||
*/
|
*/
|
||||||
List<String> autoPurgeDatabase(long until);
|
List<String> autoPurgeDatabase(long until);
|
||||||
|
|
||||||
@ -103,7 +103,7 @@ public interface DataSource {
|
|||||||
*
|
*
|
||||||
* @param auth PlayerAuth
|
* @param auth PlayerAuth
|
||||||
*
|
*
|
||||||
* @return List<String>
|
* @return List of String
|
||||||
*/
|
*/
|
||||||
List<String> getAllAuthsByName(PlayerAuth auth);
|
List<String> getAllAuthsByName(PlayerAuth auth);
|
||||||
|
|
||||||
@ -112,7 +112,7 @@ public interface DataSource {
|
|||||||
*
|
*
|
||||||
* @param ip String
|
* @param ip String
|
||||||
*
|
*
|
||||||
* @return List<String> * @throws Exception
|
* @return List of String * @throws Exception
|
||||||
*/
|
*/
|
||||||
List<String> getAllAuthsByIp(String ip);
|
List<String> getAllAuthsByIp(String ip);
|
||||||
|
|
||||||
@ -121,7 +121,7 @@ public interface DataSource {
|
|||||||
*
|
*
|
||||||
* @param email String
|
* @param email String
|
||||||
*
|
*
|
||||||
* @return List<String> * @throws Exception
|
* @return List of String * @throws Exception
|
||||||
*/
|
*/
|
||||||
List<String> getAllAuthsByEmail(String email);
|
List<String> getAllAuthsByEmail(String email);
|
||||||
|
|
||||||
@ -141,7 +141,7 @@ public interface DataSource {
|
|||||||
/**
|
/**
|
||||||
* Method purgeBanned.
|
* Method purgeBanned.
|
||||||
*
|
*
|
||||||
* @param banned List<String>
|
* @param banned List of String
|
||||||
*/
|
*/
|
||||||
void purgeBanned(List<String> banned);
|
void purgeBanned(List<String> banned);
|
||||||
|
|
||||||
@ -195,14 +195,14 @@ public interface DataSource {
|
|||||||
/**
|
/**
|
||||||
* Method getAllAuths.
|
* Method getAllAuths.
|
||||||
*
|
*
|
||||||
* @return List<PlayerAuth>
|
* @return List of PlayerAuth
|
||||||
*/
|
*/
|
||||||
List<PlayerAuth> getAllAuths();
|
List<PlayerAuth> getAllAuths();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method getLoggedPlayers.
|
* Method getLoggedPlayers.
|
||||||
*
|
*
|
||||||
* @return List<PlayerAuth>
|
* @return List of PlayerAuth
|
||||||
*/
|
*/
|
||||||
List<PlayerAuth> getLoggedPlayers();
|
List<PlayerAuth> getLoggedPlayers();
|
||||||
|
|
||||||
|
|||||||
@ -390,7 +390,7 @@ public class FlatFile implements DataSource {
|
|||||||
*
|
*
|
||||||
* @param until long
|
* @param until long
|
||||||
*
|
*
|
||||||
* @return List<String> * @see fr.xephi.authme.datasource.DataSource#autoPurgeDatabase(long)
|
* @return List of String * @see fr.xephi.authme.datasource.DataSource#autoPurgeDatabase(long)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<String> autoPurgeDatabase(long until) {
|
public List<String> autoPurgeDatabase(long until) {
|
||||||
@ -606,7 +606,7 @@ public class FlatFile implements DataSource {
|
|||||||
*
|
*
|
||||||
* @param auth PlayerAuth
|
* @param auth PlayerAuth
|
||||||
*
|
*
|
||||||
* @return List<String> * @see fr.xephi.authme.datasource.DataSource#getAllAuthsByName(PlayerAuth)
|
* @return List of String * @see fr.xephi.authme.datasource.DataSource#getAllAuthsByName(PlayerAuth)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<String> getAllAuthsByName(PlayerAuth auth) {
|
public List<String> getAllAuthsByName(PlayerAuth auth) {
|
||||||
@ -643,7 +643,7 @@ public class FlatFile implements DataSource {
|
|||||||
*
|
*
|
||||||
* @param ip String
|
* @param ip String
|
||||||
*
|
*
|
||||||
* @return List<String> * @see fr.xephi.authme.datasource.DataSource#getAllAuthsByIp(String)
|
* @return List of String * @see fr.xephi.authme.datasource.DataSource#getAllAuthsByIp(String)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<String> getAllAuthsByIp(String ip) {
|
public List<String> getAllAuthsByIp(String ip) {
|
||||||
@ -680,7 +680,7 @@ public class FlatFile implements DataSource {
|
|||||||
*
|
*
|
||||||
* @param email String
|
* @param email String
|
||||||
*
|
*
|
||||||
* @return List<String> * @see fr.xephi.authme.datasource.DataSource#getAllAuthsByEmail(String)
|
* @return List of String * @see fr.xephi.authme.datasource.DataSource#getAllAuthsByEmail(String)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<String> getAllAuthsByEmail(String email) {
|
public List<String> getAllAuthsByEmail(String email) {
|
||||||
@ -715,7 +715,7 @@ public class FlatFile implements DataSource {
|
|||||||
/**
|
/**
|
||||||
* Method purgeBanned.
|
* Method purgeBanned.
|
||||||
*
|
*
|
||||||
* @param banned List<String>
|
* @param banned List of String
|
||||||
*
|
*
|
||||||
* @see fr.xephi.authme.datasource.DataSource#purgeBanned(List)
|
* @see fr.xephi.authme.datasource.DataSource#purgeBanned(List)
|
||||||
*/
|
*/
|
||||||
@ -860,7 +860,7 @@ public class FlatFile implements DataSource {
|
|||||||
/**
|
/**
|
||||||
* Method getAllAuths.
|
* Method getAllAuths.
|
||||||
*
|
*
|
||||||
* @return List<PlayerAuth> * @see fr.xephi.authme.datasource.DataSource#getAllAuths()
|
* @return List of PlayerAuth * @see fr.xephi.authme.datasource.DataSource#getAllAuths()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<PlayerAuth> getAllAuths() {
|
public List<PlayerAuth> getAllAuths() {
|
||||||
@ -912,7 +912,7 @@ public class FlatFile implements DataSource {
|
|||||||
/**
|
/**
|
||||||
* Method getLoggedPlayers.
|
* Method getLoggedPlayers.
|
||||||
*
|
*
|
||||||
* @return List<PlayerAuth> * @see fr.xephi.authme.datasource.DataSource#getLoggedPlayers()
|
* @return List of PlayerAuth * @see fr.xephi.authme.datasource.DataSource#getLoggedPlayers()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<PlayerAuth> getLoggedPlayers() {
|
public List<PlayerAuth> getLoggedPlayers() {
|
||||||
|
|||||||
@ -1,15 +1,20 @@
|
|||||||
package fr.xephi.authme.datasource;
|
package fr.xephi.authme.datasource;
|
||||||
|
|
||||||
|
import java.sql.Connection;
|
||||||
|
import java.sql.DriverManager;
|
||||||
|
import java.sql.PreparedStatement;
|
||||||
|
import java.sql.ResultSet;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
import java.sql.Statement;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import fr.xephi.authme.ConsoleLogger;
|
import fr.xephi.authme.ConsoleLogger;
|
||||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||||
import fr.xephi.authme.security.crypts.HashedPassword;
|
import fr.xephi.authme.security.crypts.HashedPassword;
|
||||||
import fr.xephi.authme.settings.Settings;
|
import fr.xephi.authme.settings.Settings;
|
||||||
import fr.xephi.authme.util.StringUtils;
|
import fr.xephi.authme.util.StringUtils;
|
||||||
|
|
||||||
import java.sql.*;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
public class SQLite implements DataSource {
|
public class SQLite implements DataSource {
|
||||||
@ -35,7 +40,8 @@ public class SQLite implements DataSource {
|
|||||||
/**
|
/**
|
||||||
* Constructor for SQLite.
|
* Constructor for SQLite.
|
||||||
*
|
*
|
||||||
* @throws ClassNotFoundException * @throws SQLException
|
* @throws ClassNotFoundException Exception
|
||||||
|
* @throws SQLException Exception
|
||||||
*/
|
*/
|
||||||
public SQLite() throws ClassNotFoundException, SQLException {
|
public SQLite() throws ClassNotFoundException, SQLException {
|
||||||
this.database = Settings.getMySQLDatabase;
|
this.database = Settings.getMySQLDatabase;
|
||||||
@ -67,7 +73,8 @@ public class SQLite implements DataSource {
|
|||||||
/**
|
/**
|
||||||
* Method connect.
|
* Method connect.
|
||||||
*
|
*
|
||||||
* @throws ClassNotFoundException * @throws SQLException
|
* @throws ClassNotFoundException
|
||||||
|
* @throws SQLException
|
||||||
*/
|
*/
|
||||||
private synchronized void connect() throws ClassNotFoundException, SQLException {
|
private synchronized void connect() throws ClassNotFoundException, SQLException {
|
||||||
Class.forName("org.sqlite.JDBC");
|
Class.forName("org.sqlite.JDBC");
|
||||||
@ -147,7 +154,8 @@ public class SQLite implements DataSource {
|
|||||||
*
|
*
|
||||||
* @param user String
|
* @param user String
|
||||||
*
|
*
|
||||||
* @return boolean * @see fr.xephi.authme.datasource.DataSource#isAuthAvailable(String)
|
* @return boolean
|
||||||
|
* @see fr.xephi.authme.datasource.DataSource#isAuthAvailable(String)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public synchronized boolean isAuthAvailable(String user) {
|
public synchronized boolean isAuthAvailable(String user) {
|
||||||
@ -172,7 +180,8 @@ public class SQLite implements DataSource {
|
|||||||
*
|
*
|
||||||
* @param user String
|
* @param user String
|
||||||
*
|
*
|
||||||
* @return PlayerAuth * @see fr.xephi.authme.datasource.DataSource#getAuth(String)
|
* @return PlayerAuth
|
||||||
|
* @see fr.xephi.authme.datasource.DataSource#getAuth(String)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public synchronized PlayerAuth getAuth(String user) {
|
public synchronized PlayerAuth getAuth(String user) {
|
||||||
@ -201,7 +210,8 @@ public class SQLite implements DataSource {
|
|||||||
*
|
*
|
||||||
* @param auth PlayerAuth
|
* @param auth PlayerAuth
|
||||||
*
|
*
|
||||||
* @return boolean * @see fr.xephi.authme.datasource.DataSource#saveAuth(PlayerAuth)
|
* @return boolean
|
||||||
|
* @see fr.xephi.authme.datasource.DataSource#saveAuth(PlayerAuth)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public synchronized boolean saveAuth(PlayerAuth auth) {
|
public synchronized boolean saveAuth(PlayerAuth auth) {
|
||||||
@ -247,7 +257,8 @@ public class SQLite implements DataSource {
|
|||||||
*
|
*
|
||||||
* @param auth PlayerAuth
|
* @param auth PlayerAuth
|
||||||
*
|
*
|
||||||
* @return boolean * @see fr.xephi.authme.datasource.DataSource#updatePassword(PlayerAuth)
|
* @return boolean
|
||||||
|
* @see fr.xephi.authme.datasource.DataSource#updatePassword(PlayerAuth)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public synchronized boolean updatePassword(PlayerAuth auth) {
|
public synchronized boolean updatePassword(PlayerAuth auth) {
|
||||||
@ -281,7 +292,8 @@ public class SQLite implements DataSource {
|
|||||||
*
|
*
|
||||||
* @param auth PlayerAuth
|
* @param auth PlayerAuth
|
||||||
*
|
*
|
||||||
* @return boolean * @see fr.xephi.authme.datasource.DataSource#updateSession(PlayerAuth)
|
* @return boolean
|
||||||
|
* @see fr.xephi.authme.datasource.DataSource#updateSession(PlayerAuth)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean updateSession(PlayerAuth auth) {
|
public boolean updateSession(PlayerAuth auth) {
|
||||||
@ -307,7 +319,8 @@ public class SQLite implements DataSource {
|
|||||||
*
|
*
|
||||||
* @param until long
|
* @param until long
|
||||||
*
|
*
|
||||||
* @return int * @see fr.xephi.authme.datasource.DataSource#purgeDatabase(long)
|
* @return int
|
||||||
|
* @see fr.xephi.authme.datasource.DataSource#purgeDatabase(long)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int purgeDatabase(long until) {
|
public int purgeDatabase(long until) {
|
||||||
@ -330,7 +343,8 @@ public class SQLite implements DataSource {
|
|||||||
*
|
*
|
||||||
* @param until long
|
* @param until long
|
||||||
*
|
*
|
||||||
* @return List<String> * @see fr.xephi.authme.datasource.DataSource#autoPurgeDatabase(long)
|
* @return List of String
|
||||||
|
* @see fr.xephi.authme.datasource.DataSource#autoPurgeDatabase(long)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<String> autoPurgeDatabase(long until) {
|
public List<String> autoPurgeDatabase(long until) {
|
||||||
@ -359,7 +373,8 @@ public class SQLite implements DataSource {
|
|||||||
*
|
*
|
||||||
* @param user String
|
* @param user String
|
||||||
*
|
*
|
||||||
* @return boolean * @see fr.xephi.authme.datasource.DataSource#removeAuth(String)
|
* @return boolean
|
||||||
|
* @see fr.xephi.authme.datasource.DataSource#removeAuth(String)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public synchronized boolean removeAuth(String user) {
|
public synchronized boolean removeAuth(String user) {
|
||||||
@ -382,7 +397,8 @@ public class SQLite implements DataSource {
|
|||||||
*
|
*
|
||||||
* @param auth PlayerAuth
|
* @param auth PlayerAuth
|
||||||
*
|
*
|
||||||
* @return boolean * @see fr.xephi.authme.datasource.DataSource#updateQuitLoc(PlayerAuth)
|
* @return boolean
|
||||||
|
* @see fr.xephi.authme.datasource.DataSource#updateQuitLoc(PlayerAuth)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean updateQuitLoc(PlayerAuth auth) {
|
public boolean updateQuitLoc(PlayerAuth auth) {
|
||||||
@ -409,7 +425,8 @@ public class SQLite implements DataSource {
|
|||||||
*
|
*
|
||||||
* @param ip String
|
* @param ip String
|
||||||
*
|
*
|
||||||
* @return int * @see fr.xephi.authme.datasource.DataSource#getIps(String)
|
* @return int
|
||||||
|
* @see fr.xephi.authme.datasource.DataSource#getIps(String)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int getIps(String ip) {
|
public int getIps(String ip) {
|
||||||
@ -439,7 +456,8 @@ public class SQLite implements DataSource {
|
|||||||
*
|
*
|
||||||
* @param auth PlayerAuth
|
* @param auth PlayerAuth
|
||||||
*
|
*
|
||||||
* @return boolean * @see fr.xephi.authme.datasource.DataSource#updateEmail(PlayerAuth)
|
* @return boolean
|
||||||
|
* @see fr.xephi.authme.datasource.DataSource#updateEmail(PlayerAuth)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean updateEmail(PlayerAuth auth) {
|
public boolean updateEmail(PlayerAuth auth) {
|
||||||
@ -516,7 +534,8 @@ public class SQLite implements DataSource {
|
|||||||
*
|
*
|
||||||
* @param auth PlayerAuth
|
* @param auth PlayerAuth
|
||||||
*
|
*
|
||||||
* @return List<String> * @see fr.xephi.authme.datasource.DataSource#getAllAuthsByName(PlayerAuth)
|
* @return List of String
|
||||||
|
* @see fr.xephi.authme.datasource.DataSource#getAllAuthsByName(PlayerAuth)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<String> getAllAuthsByName(PlayerAuth auth) {
|
public List<String> getAllAuthsByName(PlayerAuth auth) {
|
||||||
@ -547,7 +566,8 @@ public class SQLite implements DataSource {
|
|||||||
*
|
*
|
||||||
* @param ip String
|
* @param ip String
|
||||||
*
|
*
|
||||||
* @return List<String> * @see fr.xephi.authme.datasource.DataSource#getAllAuthsByIp(String)
|
* @return List of String
|
||||||
|
* @see fr.xephi.authme.datasource.DataSource#getAllAuthsByIp(String)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<String> getAllAuthsByIp(String ip) {
|
public List<String> getAllAuthsByIp(String ip) {
|
||||||
@ -578,7 +598,8 @@ public class SQLite implements DataSource {
|
|||||||
*
|
*
|
||||||
* @param email String
|
* @param email String
|
||||||
*
|
*
|
||||||
* @return List<String> * @see fr.xephi.authme.datasource.DataSource#getAllAuthsByEmail(String)
|
* @return List of String
|
||||||
|
* @see fr.xephi.authme.datasource.DataSource#getAllAuthsByEmail(String)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<String> getAllAuthsByEmail(String email) {
|
public List<String> getAllAuthsByEmail(String email) {
|
||||||
@ -623,7 +644,8 @@ public class SQLite implements DataSource {
|
|||||||
/**
|
/**
|
||||||
* Method getType.
|
* Method getType.
|
||||||
*
|
*
|
||||||
* @return DataSourceType * @see fr.xephi.authme.datasource.DataSource#getType()
|
* @return DataSourceType
|
||||||
|
* @see fr.xephi.authme.datasource.DataSource#getType()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public DataSourceType getType() {
|
public DataSourceType getType() {
|
||||||
@ -725,7 +747,8 @@ public class SQLite implements DataSource {
|
|||||||
/**
|
/**
|
||||||
* Method getAccountsRegistered.
|
* Method getAccountsRegistered.
|
||||||
*
|
*
|
||||||
* @return int * @see fr.xephi.authme.datasource.DataSource#getAccountsRegistered()
|
* @return int
|
||||||
|
* @see fr.xephi.authme.datasource.DataSource#getAccountsRegistered()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int getAccountsRegistered() {
|
public int getAccountsRegistered() {
|
||||||
@ -765,7 +788,7 @@ public class SQLite implements DataSource {
|
|||||||
/**
|
/**
|
||||||
* Method getAllAuths.
|
* Method getAllAuths.
|
||||||
*
|
*
|
||||||
* @return List<PlayerAuth>
|
* @return List of PlayerAuth
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<PlayerAuth> getAllAuths() {
|
public List<PlayerAuth> getAllAuths() {
|
||||||
@ -791,7 +814,7 @@ public class SQLite implements DataSource {
|
|||||||
/**
|
/**
|
||||||
* Method getLoggedPlayers.
|
* Method getLoggedPlayers.
|
||||||
*
|
*
|
||||||
* @return List<PlayerAuth>
|
* @return List of PlayerAuth
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<PlayerAuth> getLoggedPlayers() {
|
public List<PlayerAuth> getLoggedPlayers() {
|
||||||
|
|||||||
@ -25,7 +25,11 @@ public enum DefaultPermission {
|
|||||||
this.title = title;
|
this.title = title;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Return the textual representation. */
|
/**
|
||||||
|
* Return the textual representation.
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
public String getTitle() {
|
public String getTitle() {
|
||||||
return title;
|
return title;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,10 +1,11 @@
|
|||||||
package fr.xephi.authme.permission;
|
package fr.xephi.authme.permission;
|
||||||
|
|
||||||
import de.bananaco.bpermissions.api.ApiLayer;
|
import java.util.ArrayList;
|
||||||
import de.bananaco.bpermissions.api.CalculableType;
|
import java.util.Arrays;
|
||||||
import fr.xephi.authme.command.CommandDescription;
|
import java.util.List;
|
||||||
import fr.xephi.authme.util.CollectionUtils;
|
import java.util.Map;
|
||||||
import net.milkbowl.vault.permission.Permission;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import org.anjocaido.groupmanager.GroupManager;
|
import org.anjocaido.groupmanager.GroupManager;
|
||||||
import org.anjocaido.groupmanager.permissions.AnjoPermissionsHandler;
|
import org.anjocaido.groupmanager.permissions.AnjoPermissionsHandler;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
@ -17,24 +18,25 @@ import org.bukkit.plugin.Plugin;
|
|||||||
import org.bukkit.plugin.PluginManager;
|
import org.bukkit.plugin.PluginManager;
|
||||||
import org.bukkit.plugin.RegisteredServiceProvider;
|
import org.bukkit.plugin.RegisteredServiceProvider;
|
||||||
import org.tyrannyofheaven.bukkit.zPermissions.ZPermissionsService;
|
import org.tyrannyofheaven.bukkit.zPermissions.ZPermissionsService;
|
||||||
|
|
||||||
|
import de.bananaco.bpermissions.api.ApiLayer;
|
||||||
|
import de.bananaco.bpermissions.api.CalculableType;
|
||||||
|
import fr.xephi.authme.command.CommandDescription;
|
||||||
|
import fr.xephi.authme.util.CollectionUtils;
|
||||||
|
import net.milkbowl.vault.permission.Permission;
|
||||||
import ru.tehkode.permissions.PermissionManager;
|
import ru.tehkode.permissions.PermissionManager;
|
||||||
import ru.tehkode.permissions.PermissionUser;
|
import ru.tehkode.permissions.PermissionUser;
|
||||||
import ru.tehkode.permissions.bukkit.PermissionsEx;
|
import ru.tehkode.permissions.bukkit.PermissionsEx;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.logging.Logger;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* <p>
|
||||||
* PermissionsManager.
|
* PermissionsManager.
|
||||||
* <p/>
|
* </p><p>
|
||||||
* A permissions manager, to manage and use various permissions systems.
|
* A permissions manager, to manage and use various permissions systems.
|
||||||
* This manager supports dynamic plugin hooking and various other features.
|
* This manager supports dynamic plugin hooking and various other features.
|
||||||
* <p/>
|
* </p><p>
|
||||||
* Written by Tim Visée.
|
* Written by Tim Visée.
|
||||||
*
|
* </p>
|
||||||
* @author Tim Visée, http://timvisee.com
|
* @author Tim Visée, http://timvisee.com
|
||||||
* @version 0.2.1
|
* @version 0.2.1
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -13,56 +13,57 @@
|
|||||||
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
package fr.xephi.authme.security.crypts;
|
package fr.xephi.authme.security.crypts;
|
||||||
|
|
||||||
import fr.xephi.authme.ConsoleLogger;
|
|
||||||
import fr.xephi.authme.security.crypts.description.HasSalt;
|
|
||||||
import fr.xephi.authme.security.crypts.description.Usage;
|
|
||||||
import fr.xephi.authme.security.crypts.description.Recommendation;
|
|
||||||
import fr.xephi.authme.security.crypts.description.SaltType;
|
|
||||||
import fr.xephi.authme.settings.Settings;
|
|
||||||
import fr.xephi.authme.util.StringUtils;
|
|
||||||
|
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.security.SecureRandom;
|
import java.security.SecureRandom;
|
||||||
|
|
||||||
|
import fr.xephi.authme.ConsoleLogger;
|
||||||
|
import fr.xephi.authme.security.crypts.description.HasSalt;
|
||||||
|
import fr.xephi.authme.security.crypts.description.Recommendation;
|
||||||
|
import fr.xephi.authme.security.crypts.description.SaltType;
|
||||||
|
import fr.xephi.authme.security.crypts.description.Usage;
|
||||||
|
import fr.xephi.authme.settings.Settings;
|
||||||
|
import fr.xephi.authme.util.StringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* <p>
|
||||||
* BCrypt implements OpenBSD-style Blowfish password hashing using the scheme
|
* BCrypt implements OpenBSD-style Blowfish password hashing using the scheme
|
||||||
* described in "A Future-Adaptable Password Scheme" by Niels Provos and David
|
* described in "A Future-Adaptable Password Scheme" by Niels Provos and David
|
||||||
* Mazieres.
|
* Mazieres.
|
||||||
* <p/>
|
* </p><p>
|
||||||
* This password hashing system tries to thwart off-line password cracking using
|
* This password hashing system tries to thwart off-line password cracking using
|
||||||
* a computationally-intensive hashing algorithm, based on Bruce Schneier's
|
* a computationally-intensive hashing algorithm, based on Bruce Schneier's
|
||||||
* Blowfish cipher. The work factor of the algorithm is parameterised, so it can
|
* Blowfish cipher. The work factor of the algorithm is parameterised, so it can
|
||||||
* be increased as computers get faster.
|
* be increased as computers get faster.
|
||||||
* <p/>
|
* </p><p>
|
||||||
* Usage is really simple. To hash a password for the first time, call the
|
* Usage is really simple. To hash a password for the first time, call the
|
||||||
* hashpw method with a random salt, like this:
|
* hashpw method with a random salt, like this:
|
||||||
* <p/>
|
* </p><p>
|
||||||
* <code>
|
* <code>
|
||||||
* String pw_hash = BCrypt.hashpw(plain_password, BCrypt.gensalt()); <br />
|
* String pw_hash = BCrypt.hashpw(plain_password, BCrypt.gensalt()); <br>
|
||||||
* </code>
|
* </code>
|
||||||
* <p/>
|
* </p><p>
|
||||||
* To check whether a plaintext password matches one that has been hashed
|
* To check whether a plaintext password matches one that has been hashed
|
||||||
* previously, use the checkpw method:
|
* previously, use the checkpw method:
|
||||||
* <p/>
|
* </p><p>
|
||||||
* <code>
|
* <code>
|
||||||
* if (BCrypt.checkpw(candidate_password, stored_hash))<br />
|
* if (BCrypt.checkpw(candidate_password, stored_hash))<br>
|
||||||
* System.out.println("It matches");<br />
|
* System.out.println("It matches");<br>
|
||||||
* else<br />
|
* else<br>
|
||||||
* System.out.println("It does not match");<br />
|
* System.out.println("It does not match");<br>
|
||||||
* </code>
|
* </code>
|
||||||
* <p/>
|
* </p><p>
|
||||||
* The gensalt() method takes an optional parameter (log_rounds) that determines
|
* The gensalt() method takes an optional parameter (log_rounds) that determines
|
||||||
* the computational complexity of the hashing:
|
* the computational complexity of the hashing:
|
||||||
* <p/>
|
* </p><p>
|
||||||
* <code>
|
* <code>
|
||||||
* String strong_salt = BCrypt.gensalt(10)<br />
|
* String strong_salt = BCrypt.gensalt(10)<br>
|
||||||
* String stronger_salt = BCrypt.gensalt(12)<br />
|
* String stronger_salt = BCrypt.gensalt(12)<br>
|
||||||
* </code>
|
* </code>
|
||||||
* <p/>
|
* </p><p>
|
||||||
* The amount of work increases exponentially (2**log_rounds), so each increment
|
* The amount of work increases exponentially (2**log_rounds), so each increment
|
||||||
* is twice as much work. The default log_rounds is 10, and the valid range is 4
|
* is twice as much work. The default log_rounds is 10, and the valid range is 4
|
||||||
* to 31.
|
* to 31.
|
||||||
*
|
* </p>
|
||||||
* @author Damien Miller
|
* @author Damien Miller
|
||||||
* @version 0.2
|
* @version 0.2
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -241,8 +241,9 @@ public class WHIRLPOOL extends UnsaltedMethod {
|
|||||||
*
|
*
|
||||||
* @param source plaintext data to hash.
|
* @param source plaintext data to hash.
|
||||||
* @param sourceBits how many bits of plaintext to process.
|
* @param sourceBits how many bits of plaintext to process.
|
||||||
* <p/>
|
* <p>
|
||||||
* This method maintains the invariant: bufferBits < 512
|
* This method maintains the invariant: bufferBits < 512
|
||||||
|
* </p>
|
||||||
*/
|
*/
|
||||||
public void NESSIEadd(byte[] source, long sourceBits) {
|
public void NESSIEadd(byte[] source, long sourceBits) {
|
||||||
/*
|
/*
|
||||||
@ -322,10 +323,12 @@ public class WHIRLPOOL extends UnsaltedMethod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* <p>
|
||||||
* Get the hash value from the hashing state.
|
* Get the hash value from the hashing state.
|
||||||
* <p/>
|
* </p>
|
||||||
* This method uses the invariant: bufferBits < 512
|
* <p>
|
||||||
*
|
* This method uses the invariant: bufferBits < 512
|
||||||
|
* </p>
|
||||||
* @param digest byte[]
|
* @param digest byte[]
|
||||||
*/
|
*/
|
||||||
public void NESSIEfinalize(byte[] digest) {
|
public void NESSIEfinalize(byte[] digest) {
|
||||||
@ -367,7 +370,7 @@ public class WHIRLPOOL extends UnsaltedMethod {
|
|||||||
* Delivers string input data to the hashing algorithm.
|
* Delivers string input data to the hashing algorithm.
|
||||||
*
|
*
|
||||||
* @param source plaintext data to hash (ASCII text string).
|
* @param source plaintext data to hash (ASCII text string).
|
||||||
* This method maintains the invariant: bufferBits < 512
|
* This method maintains the invariant: bufferBits < 512
|
||||||
*/
|
*/
|
||||||
public void NESSIEadd(String source) {
|
public void NESSIEadd(String source) {
|
||||||
if (source.length() > 0) {
|
if (source.length() > 0) {
|
||||||
|
|||||||
@ -13,10 +13,14 @@ import java.lang.annotation.Target;
|
|||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
public @interface HasSalt {
|
public @interface HasSalt {
|
||||||
|
|
||||||
/** The type of the salt. */
|
/** The type of the salt.
|
||||||
|
* @return salttype The SaltType
|
||||||
|
*/
|
||||||
SaltType value();
|
SaltType value();
|
||||||
|
|
||||||
/** For text salts, the length of the salt. */
|
/** For text salts, the length of the salt.
|
||||||
|
* @return int Integer
|
||||||
|
*/
|
||||||
int length() default 0;
|
int length() default 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,7 +12,9 @@ import java.lang.annotation.Target;
|
|||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
public @interface Recommendation {
|
public @interface Recommendation {
|
||||||
|
|
||||||
/** The recommendation for using the hash algorithm. */
|
/** The recommendation for using the hash algorithm.
|
||||||
|
* @return Usage The Usage
|
||||||
|
*/
|
||||||
Usage value();
|
Usage value();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,15 +1,16 @@
|
|||||||
package fr.xephi.authme.security.pbkdf2;
|
package fr.xephi.authme.security.pbkdf2;
|
||||||
|
|
||||||
import javax.crypto.Mac;
|
|
||||||
import javax.crypto.spec.SecretKeySpec;
|
|
||||||
import java.security.InvalidKeyException;
|
import java.security.InvalidKeyException;
|
||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
import java.security.NoSuchProviderException;
|
import java.security.NoSuchProviderException;
|
||||||
|
|
||||||
|
import javax.crypto.Mac;
|
||||||
|
import javax.crypto.spec.SecretKeySpec;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default PRF implementation based on standard javax.crypt.Mac mechanisms.
|
|
||||||
* <p>
|
* <p>
|
||||||
* <hr />
|
* Default PRF implementation based on standard javax.crypt.Mac mechanisms.
|
||||||
|
* </p>
|
||||||
* <p>
|
* <p>
|
||||||
* A free Java implementation of Password Based Key Derivation Function 2 as
|
* A free Java implementation of Password Based Key Derivation Function 2 as
|
||||||
* defined by RFC 2898. Copyright (c) 2007 Matthias Gärtner
|
* defined by RFC 2898. Copyright (c) 2007 Matthias Gärtner
|
||||||
|
|||||||
@ -75,7 +75,7 @@ public interface PBKDF2 {
|
|||||||
/**
|
/**
|
||||||
* Allow setting of configured parameters.
|
* Allow setting of configured parameters.
|
||||||
*
|
*
|
||||||
* @param parameters
|
* @param parameters PBKDF2Parameters
|
||||||
*/
|
*/
|
||||||
void setParameters(PBKDF2Parameters parameters);
|
void setParameters(PBKDF2Parameters parameters);
|
||||||
|
|
||||||
|
|||||||
@ -8,20 +8,17 @@ import java.security.SecureRandom;
|
|||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* Request for Comments: 2898 PKCS #5: Password-Based Cryptography Specification
|
* Request for Comments: 2898 PKCS #5: Password-Based Cryptography Specification
|
||||||
* <p>
|
* </p><p>
|
||||||
* Version 2.0
|
* Version 2.0
|
||||||
* <p>
|
* </p>
|
||||||
* <p>
|
* <p>
|
||||||
* PBKDF2 (P, S, c, dkLen)
|
* PBKDF2 (P, S, c, dkLen)
|
||||||
* <p>
|
* </p>
|
||||||
* <p>
|
|
||||||
* Options:
|
* Options:
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>PRF underlying pseudorandom function (hLen denotes the length in octets
|
* <li>PRF underlying pseudorandom function (hLen denotes the length in octets
|
||||||
* of the pseudorandom function output). PRF is pluggable.</li>
|
* of the pseudorandom function output). PRF is pluggable.</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
* <p>
|
|
||||||
* <p>
|
|
||||||
* Input:
|
* Input:
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>P password, an octet string</li>
|
* <li>P password, an octet string</li>
|
||||||
@ -30,15 +27,11 @@ import java.security.SecureRandom;
|
|||||||
* <li>dkLen intended length in octets of the derived key, a positive integer,
|
* <li>dkLen intended length in octets of the derived key, a positive integer,
|
||||||
* at most (2^32 - 1) * hLen</li>
|
* at most (2^32 - 1) * hLen</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
* <p>
|
|
||||||
* <p>
|
|
||||||
* Output:
|
* Output:
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>DK derived key, a dkLen-octet string</li>
|
* <li>DK derived key, a dkLen-octet string</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
* <p>
|
* <p>
|
||||||
* <hr />
|
|
||||||
* <p>
|
|
||||||
* A free Java implementation of Password Based Key Derivation Function 2 as
|
* A free Java implementation of Password Based Key Derivation Function 2 as
|
||||||
* defined by RFC 2898. Copyright (c) 2007 Matthias Gärtner
|
* defined by RFC 2898. Copyright (c) 2007 Matthias Gärtner
|
||||||
* </p>
|
* </p>
|
||||||
@ -115,13 +108,14 @@ public class PBKDF2Engine implements PBKDF2 {
|
|||||||
* ISO-8559-1 encoding. Output result as
|
* ISO-8559-1 encoding. Output result as
|
||||||
* "Salt:iteration-count:PBKDF2" with binary data in hexadecimal
|
* "Salt:iteration-count:PBKDF2" with binary data in hexadecimal
|
||||||
* encoding.
|
* encoding.
|
||||||
* <p/>
|
* <p>
|
||||||
* Example: Password "password" (without the quotes) leads to
|
* Example: Password "password" (without the quotes) leads to
|
||||||
* 48290A0B96C426C3:1000:973899B1D4AFEB3ED371060D0797E0EE0142BD04
|
* 48290A0B96C426C3:1000:973899B1D4AFEB3ED371060D0797E0EE0142BD04
|
||||||
*
|
* </p>
|
||||||
* @param args Supply the password as argument.
|
* @param args Supply the password as argument.
|
||||||
*
|
*
|
||||||
* @throws IOException * @throws NoSuchAlgorithmException * @throws NoSuchAlgorithmException
|
* @throws IOException an ioexception occured
|
||||||
|
* @throws NoSuchAlgorithmException a NoSuchAlgorithmException occured
|
||||||
*/
|
*/
|
||||||
public static void main(String[] args)
|
public static void main(String[] args)
|
||||||
throws IOException, NoSuchAlgorithmException {
|
throws IOException, NoSuchAlgorithmException {
|
||||||
@ -266,8 +260,8 @@ public class PBKDF2Engine implements PBKDF2 {
|
|||||||
/**
|
/**
|
||||||
* Integer division with ceiling function.
|
* Integer division with ceiling function.
|
||||||
*
|
*
|
||||||
* @param a
|
* @param a Integer
|
||||||
* @param b
|
* @param b Integer
|
||||||
*
|
*
|
||||||
* @return ceil(a/b) * @see <a href="http://tools.ietf.org/html/rfc2898">RFC 2898 5.2 Step
|
* @return ceil(a/b) * @see <a href="http://tools.ietf.org/html/rfc2898">RFC 2898 5.2 Step
|
||||||
* 2.</a>
|
* 2.</a>
|
||||||
@ -288,7 +282,7 @@ public class PBKDF2Engine implements PBKDF2 {
|
|||||||
* @param prf Pseudo Random Function
|
* @param prf Pseudo Random Function
|
||||||
* @param S Salt as array of bytes
|
* @param S Salt as array of bytes
|
||||||
* @param c Iteration count
|
* @param c Iteration count
|
||||||
* @param blockIndex
|
* @param blockIndex Integer
|
||||||
*
|
*
|
||||||
* @see <a href="http://tools.ietf.org/html/rfc2898">RFC 2898 5.2 Step
|
* @see <a href="http://tools.ietf.org/html/rfc2898">RFC 2898 5.2 Step
|
||||||
* 3.</a>
|
* 3.</a>
|
||||||
@ -314,8 +308,8 @@ public class PBKDF2Engine implements PBKDF2 {
|
|||||||
* Block-Xor. Xor source bytes into destination byte buffer. Destination
|
* Block-Xor. Xor source bytes into destination byte buffer. Destination
|
||||||
* buffer must be same length or less than source buffer.
|
* buffer must be same length or less than source buffer.
|
||||||
*
|
*
|
||||||
* @param dest
|
* @param dest byte array
|
||||||
* @param src
|
* @param src byte array
|
||||||
*/
|
*/
|
||||||
protected void xor(byte[] dest, byte[] src) {
|
protected void xor(byte[] dest, byte[] src) {
|
||||||
for (int i = 0; i < dest.length; i++) {
|
for (int i = 0; i < dest.length; i++) {
|
||||||
@ -326,9 +320,9 @@ public class PBKDF2Engine implements PBKDF2 {
|
|||||||
/**
|
/**
|
||||||
* Four-octet encoding of the integer i, most significant octet first.
|
* Four-octet encoding of the integer i, most significant octet first.
|
||||||
*
|
*
|
||||||
* @param dest
|
* @param dest byte array
|
||||||
* @param offset
|
* @param offset Integer
|
||||||
* @param i
|
* @param i Integer
|
||||||
*
|
*
|
||||||
* @see <a href="http://tools.ietf.org/html/rfc2898">RFC 2898 5.2 Step
|
* @see <a href="http://tools.ietf.org/html/rfc2898">RFC 2898 5.2 Step
|
||||||
* 3.</a>
|
* 3.</a>
|
||||||
|
|||||||
@ -5,8 +5,6 @@ package fr.xephi.authme.security.pbkdf2;
|
|||||||
* Parameter data holder for PBKDF2 configuration.
|
* Parameter data holder for PBKDF2 configuration.
|
||||||
* </p>
|
* </p>
|
||||||
* <p>
|
* <p>
|
||||||
* <hr />
|
|
||||||
* <p>
|
|
||||||
* A free Java implementation of Password Based Key Derivation Function 2 as
|
* A free Java implementation of Password Based Key Derivation Function 2 as
|
||||||
* defined by RFC 2898. Copyright (c) 2007 Matthias Gärtner
|
* defined by RFC 2898. Copyright (c) 2007 Matthias Gärtner
|
||||||
* </p>
|
* </p>
|
||||||
|
|||||||
@ -1,13 +1,13 @@
|
|||||||
package fr.xephi.authme.settings;
|
package fr.xephi.authme.settings;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Xephi59
|
* @author Xephi59
|
||||||
* @version $Revision: 1.0 $
|
* @version $Revision: 1.0 $
|
||||||
@ -88,7 +88,7 @@ public class OtherAccounts extends CustomConfiguration {
|
|||||||
*
|
*
|
||||||
* @param uuid UUID
|
* @param uuid UUID
|
||||||
*
|
*
|
||||||
* @return List<String>
|
* @return StringList
|
||||||
*/
|
*/
|
||||||
public List<String> getAllPlayersByUUID(UUID uuid) {
|
public List<String> getAllPlayersByUUID(UUID uuid) {
|
||||||
return this.getStringList(uuid.toString());
|
return this.getStringList(uuid.toString());
|
||||||
|
|||||||
@ -122,7 +122,7 @@ public final class Settings {
|
|||||||
/**
|
/**
|
||||||
* Method reload.
|
* Method reload.
|
||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception if something went wrong
|
||||||
*/
|
*/
|
||||||
public static void reload() throws Exception {
|
public static void reload() throws Exception {
|
||||||
plugin.getLogger().info("Loading Configuration File...");
|
plugin.getLogger().info("Loading Configuration File...");
|
||||||
@ -141,7 +141,6 @@ public final class Settings {
|
|||||||
messageFile = new File(PLUGIN_FOLDER, "messages" + File.separator + "messages_" + messagesLanguage + ".yml");
|
messageFile = new File(PLUGIN_FOLDER, "messages" + File.separator + "messages_" + messagesLanguage + ".yml");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void loadVariables() {
|
public static void loadVariables() {
|
||||||
helpHeader = configFile.getString("settings.helpHeader", "AuthMeReloaded");
|
helpHeader = configFile.getString("settings.helpHeader", "AuthMeReloaded");
|
||||||
messagesLanguage = checkLang(configFile.getString("settings.messagesLanguage", "en").toLowerCase());
|
messagesLanguage = checkLang(configFile.getString("settings.messagesLanguage", "en").toLowerCase());
|
||||||
@ -340,6 +339,11 @@ public final class Settings {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param key the key to set
|
||||||
|
* @param value the value to set
|
||||||
|
*/
|
||||||
public static void setValue(String key, Object value) {
|
public static void setValue(String key, Object value) {
|
||||||
instance.set(key, value);
|
instance.set(key, value);
|
||||||
save();
|
save();
|
||||||
@ -382,6 +386,7 @@ public final class Settings {
|
|||||||
*
|
*
|
||||||
* @param name String
|
* @param name String
|
||||||
* @param ip String
|
* @param ip String
|
||||||
|
* @param domain String
|
||||||
*
|
*
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
@ -768,11 +773,21 @@ public final class Settings {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param path
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
private static boolean contains(String path) {
|
private static boolean contains(String path) {
|
||||||
return configFile.contains(path);
|
return configFile.contains(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
// public because it's used in AuthMe at one place
|
// public because it's used in AuthMe at one place
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param path String
|
||||||
|
* @param value String
|
||||||
|
*/
|
||||||
public void set(String path, Object value) {
|
public void set(String path, Object value) {
|
||||||
configFile.set(path, value);
|
configFile.set(path, value);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,6 +15,8 @@ public final class CollectionUtils {
|
|||||||
/**
|
/**
|
||||||
* Get a range from a list based on start and count parameters in a safe way.
|
* Get a range from a list based on start and count parameters in a safe way.
|
||||||
*
|
*
|
||||||
|
* @param <T> element
|
||||||
|
* @param list The List
|
||||||
* @param start The start index
|
* @param start The start index
|
||||||
* @param count The number of elements to add
|
* @param count The number of elements to add
|
||||||
*
|
*
|
||||||
@ -34,6 +36,8 @@ public final class CollectionUtils {
|
|||||||
/**
|
/**
|
||||||
* Get all elements from a list starting from the given index.
|
* Get all elements from a list starting from the given index.
|
||||||
*
|
*
|
||||||
|
* @param <T> element
|
||||||
|
* @param list The List
|
||||||
* @param start The start index
|
* @param start The start index
|
||||||
*
|
*
|
||||||
* @return The sublist of all elements from index {@code start} and on; empty list
|
* @return The sublist of all elements from index {@code start} and on; empty list
|
||||||
@ -46,6 +50,11 @@ public final class CollectionUtils {
|
|||||||
return getRange(list, start, list.size() - start);
|
return getRange(list, start, list.size() - start);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param <T> element
|
||||||
|
* @param coll Collection
|
||||||
|
* @return boolean Boolean
|
||||||
|
*/
|
||||||
public static <T> boolean isEmpty(Collection<T> coll) {
|
public static <T> boolean isEmpty(Collection<T> coll) {
|
||||||
return coll == null || coll.isEmpty();
|
return coll == null || coll.isEmpty();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user