mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-17 08:05:29 +01:00
Fix transfer of lang files to directory paths with spaces
This commit is contained in:
parent
5c45682cf7
commit
aaf54722a2
@ -109,7 +109,6 @@ import java.util.Optional;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
|
||||||
import java.util.concurrent.ConcurrentSkipListSet;
|
import java.util.concurrent.ConcurrentSkipListSet;
|
||||||
import java.util.jar.JarEntry;
|
import java.util.jar.JarEntry;
|
||||||
import java.util.jar.JarFile;
|
import java.util.jar.JarFile;
|
||||||
@ -697,12 +696,13 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
|||||||
*/
|
*/
|
||||||
private void setupLang() throws IOException, URISyntaxException {
|
private void setupLang() throws IOException, URISyntaxException {
|
||||||
final String path = "lang";
|
final String path = "lang";
|
||||||
final File jarFile = new File(getClass().getProtectionDomain().getCodeSource().getLocation().getPath());
|
final File jarFile = new File(getClass().getProtectionDomain().getCodeSource().getLocation().getPath()
|
||||||
|
.replace("%20", " "));
|
||||||
if (jarFile.isFile()) {
|
if (jarFile.isFile()) {
|
||||||
final JarFile jar = new JarFile(jarFile);
|
final JarFile jar = new JarFile(jarFile);
|
||||||
final Enumeration<JarEntry> entries = jar.entries();
|
final Enumeration<JarEntry> entries = jar.entries();
|
||||||
final Set<String> results = new HashSet<>();
|
final Set<String> results = new HashSet<>();
|
||||||
while(entries.hasMoreElements()) {
|
while (entries.hasMoreElements()) {
|
||||||
final String name = entries.nextElement().getName();
|
final String name = entries.nextElement().getName();
|
||||||
if (name.startsWith(path + "/") && name.contains("strings.yml")) {
|
if (name.startsWith(path + "/") && name.contains("strings.yml")) {
|
||||||
results.add(name);
|
results.add(name);
|
||||||
|
Loading…
Reference in New Issue
Block a user