mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2025-01-27 01:51:41 +01:00
cleanup string concatenates
This commit is contained in:
parent
51067498ea
commit
b5546c07b4
@ -12,7 +12,9 @@ import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.nio.file.Files;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
@ -180,16 +182,19 @@ public class Utils {
|
||||
}
|
||||
|
||||
public static void purgeDirectory(File file) {
|
||||
String files[] = file.list();
|
||||
if (files != null && files.length != 0) {
|
||||
for (String temp : files) {
|
||||
File fileDelete = new File(file, temp);
|
||||
if (fileDelete.isDirectory()) {
|
||||
purgeDirectory(fileDelete);
|
||||
fileDelete.delete();
|
||||
} else {
|
||||
fileDelete.delete();
|
||||
}
|
||||
if (!file.isDirectory()) {
|
||||
return;
|
||||
}
|
||||
File[] files = file.listFiles();
|
||||
if (files == null) {
|
||||
return;
|
||||
}
|
||||
for (File target : files) {
|
||||
if(target.isDirectory()) {
|
||||
purgeDirectory(target);
|
||||
target.delete();
|
||||
} else {
|
||||
target.delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -50,24 +50,24 @@ public class PHPBB implements EncryptionMethod {
|
||||
* Encode hash
|
||||
*/
|
||||
private String _hash_encode64(String input, int count) {
|
||||
String output = "";
|
||||
StringBuilder output = new StringBuilder();
|
||||
int i = 0;
|
||||
do {
|
||||
int value = input.charAt(i++);
|
||||
output += itoa64.charAt(value & 0x3f);
|
||||
output.append(itoa64.charAt(value & 0x3f));
|
||||
if (i < count)
|
||||
value |= input.charAt(i) << 8;
|
||||
output += itoa64.charAt((value >> 6) & 0x3f);
|
||||
output.append(itoa64.charAt((value >> 6) & 0x3f));
|
||||
if (i++ >= count)
|
||||
break;
|
||||
if (i < count)
|
||||
value |= input.charAt(i) << 16;
|
||||
output += itoa64.charAt((value >> 12) & 0x3f);
|
||||
output.append(itoa64.charAt((value >> 12) & 0x3f));
|
||||
if (i++ >= count)
|
||||
break;
|
||||
output += itoa64.charAt((value >> 18) & 0x3f);
|
||||
output.append(itoa64.charAt((value >> 18) & 0x3f));
|
||||
} while (i < count);
|
||||
return output;
|
||||
return output.toString();
|
||||
}
|
||||
|
||||
String _hash_crypt_private(String password, String setting) {
|
||||
|
Loading…
Reference in New Issue
Block a user