[ci skip] spotlessApply with the new settings

This commit is contained in:
Raven Szewczyk committed 2023-01-29 11:36:41 +00:00
1 parent 6b208b98bc
commit a309488cdf
214 files changed
+9283 -9265

No files matched your search

@@ -1,7 +1,6 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
* To change this license header, choose License Headers in Project Properties. To change this template file, choose
* Tools | Templates and open the template in the editor.
*/
package minetweaker.runtime.providers;
@@ -15,6 +14,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import minetweaker.runtime.IScriptIterator;
/**
@@ -22,49 +22,50 @@ import minetweaker.runtime.IScriptIterator;
* @author Stan
*/
public class ScriptIteratorZip implements IScriptIterator {
private final File file;
private final ZipFile zipFile;
private final Iterator<ZipEntry> entries;
private ZipEntry current;
public ScriptIteratorZip(File file) throws IOException {
this.file = file;
private final File file;
private final ZipFile zipFile;
private final Iterator<ZipEntry> entries;
private ZipEntry current;
zipFile = new ZipFile(file);
List<ZipEntry> entriesList = new ArrayList<ZipEntry>();
Enumeration<? extends ZipEntry> original = zipFile.entries();
while (original.hasMoreElements()) {
ZipEntry entry = original.nextElement();
if (entry.getName().startsWith("scripts/") && entry.getName().endsWith(".zs")) {
entriesList.add(entry);
}
}
public ScriptIteratorZip(File file) throws IOException {
this.file = file;
entries = entriesList.iterator();
}
zipFile = new ZipFile(file);
List<ZipEntry> entriesList = new ArrayList<ZipEntry>();
Enumeration<? extends ZipEntry> original = zipFile.entries();
while (original.hasMoreElements()) {
ZipEntry entry = original.nextElement();
if (entry.getName().startsWith("scripts/") && entry.getName().endsWith(".zs")) {
entriesList.add(entry);
}
}
@Override
public String getGroupName() {
return file.getName().substring(0, file.getName().lastIndexOf('.'));
}
entries = entriesList.iterator();
}
@Override
public boolean next() {
if (entries.hasNext()) {
current = entries.next();
return true;
} else {
return false;
}
}
@Override
public String getGroupName() {
return file.getName().substring(0, file.getName().lastIndexOf('.'));
}
@Override
public String getName() {
return current.getName().substring("scripts/".length());
}
@Override
public boolean next() {
if (entries.hasNext()) {
current = entries.next();
return true;
} else {
return false;
}
}
@Override
public InputStream open() throws IOException {
return zipFile.getInputStream(current);
}
@Override
public String getName() {
return current.getName().substring("scripts/".length());
}
@Override
public InputStream open() throws IOException {
return zipFile.getInputStream(current);
}
}