2012-03-28 18:05:52 +00:00
|
|
|
/*
|
2014-04-04 22:03:18 +00:00
|
|
|
* WorldEdit, a Minecraft world manipulation toolkit
|
|
|
|
* Copyright (C) sk89q <http://www.sk89q.com>
|
|
|
|
* Copyright (C) WorldEdit team and contributors
|
2012-03-28 18:05:52 +00:00
|
|
|
*
|
2014-04-04 22:03:18 +00:00
|
|
|
* This program is free software: you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU Lesser General Public License as published by the
|
|
|
|
* Free Software Foundation, either version 3 of the License, or
|
2012-03-28 18:05:52 +00:00
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
2014-04-04 22:03:18 +00:00
|
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
|
|
|
* for more details.
|
2012-03-28 18:05:52 +00:00
|
|
|
*
|
2014-04-04 22:03:18 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
2012-03-28 18:05:52 +00:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2014-04-03 02:08:50 +00:00
|
|
|
package com.sk89q.worldedit.command;
|
2012-03-28 18:05:52 +00:00
|
|
|
|
2014-06-30 00:47:08 +00:00
|
|
|
import com.sk89q.worldedit.LocalConfiguration;
|
|
|
|
import com.sk89q.worldedit.LocalSession;
|
|
|
|
import com.sk89q.worldedit.WorldEdit;
|
|
|
|
import com.sk89q.worldedit.WorldEditException;
|
2019-04-04 23:16:04 +00:00
|
|
|
import com.sk89q.worldedit.command.util.CommandPermissions;
|
2019-04-17 06:02:23 +00:00
|
|
|
import com.sk89q.worldedit.command.util.CommandPermissionsConditionGenerator;
|
2014-06-28 08:01:49 +00:00
|
|
|
import com.sk89q.worldedit.entity.Player;
|
2014-06-28 00:55:39 +00:00
|
|
|
import com.sk89q.worldedit.extension.platform.Actor;
|
2014-07-10 05:04:17 +00:00
|
|
|
import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard;
|
2014-07-10 04:08:34 +00:00
|
|
|
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
2018-10-24 06:33:04 +00:00
|
|
|
import com.sk89q.worldedit.extent.clipboard.io.BuiltInClipboardFormat;
|
2014-07-10 04:08:34 +00:00
|
|
|
import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormat;
|
2018-07-24 01:50:57 +00:00
|
|
|
import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormats;
|
2014-07-10 04:08:34 +00:00
|
|
|
import com.sk89q.worldedit.extent.clipboard.io.ClipboardReader;
|
|
|
|
import com.sk89q.worldedit.extent.clipboard.io.ClipboardWriter;
|
2014-07-10 05:04:17 +00:00
|
|
|
import com.sk89q.worldedit.function.operation.Operations;
|
|
|
|
import com.sk89q.worldedit.math.transform.Transform;
|
2014-07-10 04:08:34 +00:00
|
|
|
import com.sk89q.worldedit.session.ClipboardHolder;
|
2019-04-28 05:12:05 +00:00
|
|
|
import com.sk89q.worldedit.util.formatting.component.PaginationBox;
|
|
|
|
import com.sk89q.worldedit.util.formatting.component.SchematicPaginationBox;
|
2019-04-27 10:33:13 +00:00
|
|
|
import com.sk89q.worldedit.util.formatting.text.TextComponent;
|
2015-12-28 20:05:16 +00:00
|
|
|
import com.sk89q.worldedit.util.io.Closer;
|
|
|
|
import com.sk89q.worldedit.util.io.file.FilenameException;
|
2019-03-14 09:10:37 +00:00
|
|
|
import org.enginehub.piston.annotation.Command;
|
|
|
|
import org.enginehub.piston.annotation.CommandContainer;
|
|
|
|
import org.enginehub.piston.annotation.param.Arg;
|
|
|
|
import org.enginehub.piston.annotation.param.ArgFlag;
|
|
|
|
import org.enginehub.piston.annotation.param.Switch;
|
2019-03-14 02:51:48 +00:00
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
2019-04-04 23:16:04 +00:00
|
|
|
import org.enginehub.piston.exception.StopExecutionException;
|
2014-05-02 01:00:59 +00:00
|
|
|
|
2014-07-10 04:08:34 +00:00
|
|
|
import java.io.BufferedInputStream;
|
|
|
|
import java.io.BufferedOutputStream;
|
2012-12-15 18:49:44 +00:00
|
|
|
import java.io.File;
|
2014-07-10 04:08:34 +00:00
|
|
|
import java.io.FileInputStream;
|
|
|
|
import java.io.FileOutputStream;
|
|
|
|
import java.io.IOException;
|
2015-12-28 20:05:16 +00:00
|
|
|
import java.util.ArrayList;
|
2012-12-25 22:36:57 +00:00
|
|
|
import java.util.Arrays;
|
2015-12-28 20:05:16 +00:00
|
|
|
import java.util.List;
|
2012-12-15 18:49:44 +00:00
|
|
|
|
2019-03-14 02:51:48 +00:00
|
|
|
import static com.google.common.base.Preconditions.checkNotNull;
|
|
|
|
|
2012-03-28 18:05:52 +00:00
|
|
|
/**
|
2014-06-28 08:01:49 +00:00
|
|
|
* Commands that work with schematic files.
|
2012-03-28 18:05:52 +00:00
|
|
|
*/
|
2019-04-17 06:02:23 +00:00
|
|
|
@CommandContainer(superTypes = CommandPermissionsConditionGenerator.Registration.class)
|
2012-03-28 18:05:52 +00:00
|
|
|
public class SchematicCommands {
|
|
|
|
|
2019-03-14 02:51:48 +00:00
|
|
|
private static final Logger log = LoggerFactory.getLogger(SchematicCommands.class);
|
2014-06-28 08:01:49 +00:00
|
|
|
private final WorldEdit worldEdit;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a new instance.
|
|
|
|
*
|
|
|
|
* @param worldEdit reference to WorldEdit
|
|
|
|
*/
|
|
|
|
public SchematicCommands(WorldEdit worldEdit) {
|
|
|
|
checkNotNull(worldEdit);
|
|
|
|
this.worldEdit = worldEdit;
|
2012-03-28 18:05:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Command(
|
2019-03-14 09:10:37 +00:00
|
|
|
name = "load",
|
|
|
|
desc = "Load a schematic into your clipboard"
|
2012-03-28 18:05:52 +00:00
|
|
|
)
|
2019-03-14 09:10:37 +00:00
|
|
|
@CommandPermissions({"worldedit.clipboard.load", "worldedit.schematic.load"})
|
|
|
|
public void load(Player player, LocalSession session,
|
2019-04-15 09:03:05 +00:00
|
|
|
@Arg(desc = "File name.")
|
|
|
|
String filename,
|
|
|
|
@Arg(desc = "Format name.", def = "sponge")
|
|
|
|
String formatName) throws FilenameException {
|
2014-07-10 04:08:34 +00:00
|
|
|
LocalConfiguration config = worldEdit.getConfiguration();
|
|
|
|
|
|
|
|
File dir = worldEdit.getWorkingDirectoryFile(config.saveDir);
|
2019-04-28 05:12:05 +00:00
|
|
|
File f = worldEdit.getSafeOpenFile(player, dir, filename,
|
|
|
|
BuiltInClipboardFormat.SPONGE_SCHEMATIC.getPrimaryFileExtension(),
|
|
|
|
ClipboardFormats.getFileExtensionArray());
|
2014-07-10 04:08:34 +00:00
|
|
|
|
|
|
|
if (!f.exists()) {
|
|
|
|
player.printError("Schematic " + filename + " does not exist!");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2018-07-24 01:50:57 +00:00
|
|
|
ClipboardFormat format = ClipboardFormats.findByFile(f);
|
|
|
|
if (format == null) {
|
|
|
|
format = ClipboardFormats.findByAlias(formatName);
|
|
|
|
}
|
2014-07-10 04:08:34 +00:00
|
|
|
if (format == null) {
|
|
|
|
player.printError("Unknown schematic format: " + formatName);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2018-06-16 06:36:55 +00:00
|
|
|
try (Closer closer = Closer.create()) {
|
2015-06-19 22:27:20 +00:00
|
|
|
FileInputStream fis = closer.register(new FileInputStream(f));
|
|
|
|
BufferedInputStream bis = closer.register(new BufferedInputStream(fis));
|
2018-07-24 01:50:57 +00:00
|
|
|
ClipboardReader reader = closer.register(format.getReader(bis));
|
2014-07-10 04:08:34 +00:00
|
|
|
|
2018-06-19 00:53:15 +00:00
|
|
|
Clipboard clipboard = reader.read();
|
|
|
|
session.setClipboard(new ClipboardHolder(clipboard));
|
2014-07-10 04:08:34 +00:00
|
|
|
|
2015-06-19 22:27:20 +00:00
|
|
|
log.info(player.getName() + " loaded " + f.getCanonicalPath());
|
|
|
|
player.print(filename + " loaded. Paste it with //paste");
|
2014-07-10 04:08:34 +00:00
|
|
|
} catch (IOException e) {
|
|
|
|
player.printError("Schematic could not read or it does not exist: " + e.getMessage());
|
2019-04-28 05:12:05 +00:00
|
|
|
log.warn("Failed to load schematic: " + e.getMessage());
|
2014-07-10 04:08:34 +00:00
|
|
|
}
|
2012-03-28 18:05:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Command(
|
2019-03-14 09:10:37 +00:00
|
|
|
name = "save",
|
|
|
|
desc = "Save a schematic into your clipboard"
|
2012-03-28 18:05:52 +00:00
|
|
|
)
|
2019-03-14 09:10:37 +00:00
|
|
|
@CommandPermissions({"worldedit.clipboard.save", "worldedit.schematic.save"})
|
|
|
|
public void save(Player player, LocalSession session,
|
2019-04-15 09:03:05 +00:00
|
|
|
@Arg(desc = "File name.")
|
|
|
|
String filename,
|
|
|
|
@Arg(desc = "Format name.", def = "sponge")
|
|
|
|
String formatName,
|
|
|
|
@Switch(name = 'f', desc = "Overwrite an existing file.")
|
|
|
|
boolean allowOverwrite
|
2019-04-04 23:16:04 +00:00
|
|
|
) throws WorldEditException {
|
2014-07-10 04:08:34 +00:00
|
|
|
LocalConfiguration config = worldEdit.getConfiguration();
|
|
|
|
|
|
|
|
File dir = worldEdit.getWorkingDirectoryFile(config.saveDir);
|
|
|
|
|
2018-07-24 01:50:57 +00:00
|
|
|
ClipboardFormat format = ClipboardFormats.findByAlias(formatName);
|
2014-07-10 04:08:34 +00:00
|
|
|
if (format == null) {
|
|
|
|
player.printError("Unknown schematic format: " + formatName);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2018-07-24 01:50:57 +00:00
|
|
|
File f = worldEdit.getSafeSaveFile(player, dir, filename, format.getPrimaryFileExtension());
|
|
|
|
|
2019-03-15 21:08:11 +00:00
|
|
|
boolean overwrite = f.exists();
|
|
|
|
if (overwrite) {
|
|
|
|
if (!player.hasPermission("worldedit.schematic.delete")) {
|
2019-04-27 10:33:13 +00:00
|
|
|
throw new StopExecutionException(TextComponent.of("That schematic already exists!"));
|
2019-03-15 21:08:11 +00:00
|
|
|
}
|
|
|
|
if (!allowOverwrite) {
|
|
|
|
player.printError("That schematic already exists. Use the -f flag to overwrite it.");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-07-10 04:08:34 +00:00
|
|
|
ClipboardHolder holder = session.getClipboard();
|
2014-07-10 05:04:17 +00:00
|
|
|
Clipboard clipboard = holder.getClipboard();
|
|
|
|
Transform transform = holder.getTransform();
|
|
|
|
Clipboard target;
|
|
|
|
|
2014-07-10 05:51:17 +00:00
|
|
|
// If we have a transform, bake it into the copy
|
2014-07-10 05:04:17 +00:00
|
|
|
if (!transform.isIdentity()) {
|
2018-06-19 00:53:15 +00:00
|
|
|
FlattenedClipboardTransform result = FlattenedClipboardTransform.transform(clipboard, transform);
|
2014-07-10 05:04:17 +00:00
|
|
|
target = new BlockArrayClipboard(result.getTransformedRegion());
|
2014-07-10 05:51:17 +00:00
|
|
|
target.setOrigin(clipboard.getOrigin());
|
2014-07-10 05:04:17 +00:00
|
|
|
Operations.completeLegacy(result.copyTo(target));
|
|
|
|
} else {
|
|
|
|
target = clipboard;
|
|
|
|
}
|
2014-07-10 04:08:34 +00:00
|
|
|
|
2019-03-15 21:08:11 +00:00
|
|
|
// Create parent directories
|
|
|
|
File parent = f.getParentFile();
|
|
|
|
if (parent != null && !parent.exists()) {
|
|
|
|
if (!parent.mkdirs()) {
|
2019-04-27 10:33:13 +00:00
|
|
|
throw new StopExecutionException(TextComponent.of(
|
|
|
|
"Could not create folder for schematics!"));
|
2014-07-10 04:08:34 +00:00
|
|
|
}
|
2019-03-15 21:08:11 +00:00
|
|
|
}
|
2014-07-10 04:08:34 +00:00
|
|
|
|
2019-03-15 21:08:11 +00:00
|
|
|
try (Closer closer = Closer.create()) {
|
2014-07-10 04:08:34 +00:00
|
|
|
FileOutputStream fos = closer.register(new FileOutputStream(f));
|
|
|
|
BufferedOutputStream bos = closer.register(new BufferedOutputStream(fos));
|
|
|
|
ClipboardWriter writer = closer.register(format.getWriter(bos));
|
2018-06-19 00:53:15 +00:00
|
|
|
writer.write(target);
|
2019-03-15 21:08:11 +00:00
|
|
|
|
|
|
|
log.info(player.getName() + " saved " + f.getCanonicalPath() + (overwrite ? " (overwriting previous file)" : ""));
|
|
|
|
player.print(filename + " saved" + (overwrite ? " (overwriting previous file)." : "."));
|
2014-07-10 04:08:34 +00:00
|
|
|
} catch (IOException e) {
|
|
|
|
player.printError("Schematic could not written: " + e.getMessage());
|
2019-03-14 02:51:48 +00:00
|
|
|
log.warn("Failed to write a saved clipboard", e);
|
2014-07-10 04:08:34 +00:00
|
|
|
}
|
2012-03-28 18:05:52 +00:00
|
|
|
}
|
|
|
|
|
2014-05-02 01:00:59 +00:00
|
|
|
@Command(
|
2019-03-14 09:10:37 +00:00
|
|
|
name = "delete",
|
|
|
|
aliases = {"d"},
|
|
|
|
desc = "Delete a saved schematic"
|
2014-05-02 01:00:59 +00:00
|
|
|
)
|
|
|
|
@CommandPermissions("worldedit.schematic.delete")
|
2019-03-14 09:10:37 +00:00
|
|
|
public void delete(Actor actor,
|
2019-04-15 09:03:05 +00:00
|
|
|
@Arg(desc = "File name.")
|
|
|
|
String filename) throws WorldEditException {
|
2014-06-28 08:01:49 +00:00
|
|
|
LocalConfiguration config = worldEdit.getConfiguration();
|
|
|
|
File dir = worldEdit.getWorkingDirectoryFile(config.saveDir);
|
2019-03-15 21:08:11 +00:00
|
|
|
|
|
|
|
File f = worldEdit.getSafeOpenFile(actor instanceof Player ? ((Player) actor) : null,
|
|
|
|
dir, filename, "schematic", ClipboardFormats.getFileExtensionArray());
|
2014-05-02 01:00:59 +00:00
|
|
|
|
|
|
|
if (!f.exists()) {
|
2019-03-15 21:08:11 +00:00
|
|
|
actor.printError("Schematic " + filename + " does not exist!");
|
2014-05-02 01:00:59 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!f.delete()) {
|
2019-03-15 21:08:11 +00:00
|
|
|
actor.printError("Deletion of " + filename + " failed! Maybe it is read-only.");
|
2014-05-02 01:00:59 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2019-03-15 21:08:11 +00:00
|
|
|
actor.print(filename + " has been deleted.");
|
2019-03-08 21:00:42 +00:00
|
|
|
try {
|
2019-03-15 21:08:11 +00:00
|
|
|
log.info(actor.getName() + " deleted " + f.getCanonicalPath());
|
2019-03-08 21:00:42 +00:00
|
|
|
} catch (IOException e) {
|
2019-03-15 21:08:11 +00:00
|
|
|
log.info(actor.getName() + " deleted " + f.getAbsolutePath());
|
2019-03-08 21:00:42 +00:00
|
|
|
}
|
2014-05-02 01:00:59 +00:00
|
|
|
}
|
|
|
|
|
2012-03-28 18:05:52 +00:00
|
|
|
@Command(
|
2019-03-14 09:10:37 +00:00
|
|
|
name = "formats",
|
|
|
|
aliases = {"listformats", "f"},
|
|
|
|
desc = "List available formats"
|
2012-03-28 18:05:52 +00:00
|
|
|
)
|
2012-04-01 16:21:27 +00:00
|
|
|
@CommandPermissions("worldedit.schematic.formats")
|
2019-03-14 09:10:37 +00:00
|
|
|
public void formats(Actor actor) {
|
2014-07-10 04:08:34 +00:00
|
|
|
actor.print("Available clipboard formats (Name: Lookup names)");
|
2012-03-28 18:05:52 +00:00
|
|
|
StringBuilder builder;
|
|
|
|
boolean first = true;
|
2018-07-24 01:50:57 +00:00
|
|
|
for (ClipboardFormat format : ClipboardFormats.getAll()) {
|
2012-03-28 18:05:52 +00:00
|
|
|
builder = new StringBuilder();
|
2018-07-24 01:50:57 +00:00
|
|
|
builder.append(format.getName()).append(": ");
|
2014-07-10 04:08:34 +00:00
|
|
|
for (String lookupName : format.getAliases()) {
|
2012-03-28 18:05:52 +00:00
|
|
|
if (!first) {
|
|
|
|
builder.append(", ");
|
|
|
|
}
|
|
|
|
builder.append(lookupName);
|
|
|
|
first = false;
|
|
|
|
}
|
|
|
|
first = true;
|
2014-06-28 00:55:39 +00:00
|
|
|
actor.print(builder.toString());
|
2012-03-28 18:05:52 +00:00
|
|
|
}
|
|
|
|
}
|
2012-03-28 19:30:36 +00:00
|
|
|
|
|
|
|
@Command(
|
2019-03-14 09:10:37 +00:00
|
|
|
name = "list",
|
|
|
|
aliases = {"all", "ls"},
|
|
|
|
desc = "List saved schematics",
|
|
|
|
descFooter = "Note: Format is not fully verified until loading."
|
2012-03-28 19:30:36 +00:00
|
|
|
)
|
2012-04-01 16:21:27 +00:00
|
|
|
@CommandPermissions("worldedit.schematic.list")
|
2019-04-04 23:16:04 +00:00
|
|
|
public void list(Actor actor,
|
2019-04-15 09:03:05 +00:00
|
|
|
@ArgFlag(name = 'p', desc = "Page to view.", def = "1")
|
|
|
|
int page,
|
|
|
|
@Switch(name = 'd', desc = "Sort by date, oldest first")
|
|
|
|
boolean oldFirst,
|
|
|
|
@Switch(name = 'n', desc = "Sort by date, newest first")
|
2019-04-28 05:12:05 +00:00
|
|
|
boolean newFirst) throws WorldEditException {
|
2019-04-04 23:16:04 +00:00
|
|
|
if (oldFirst && newFirst) {
|
2019-04-27 10:33:13 +00:00
|
|
|
throw new StopExecutionException(TextComponent.of("Cannot sort by oldest and newest."));
|
2019-04-04 23:16:04 +00:00
|
|
|
}
|
2014-06-28 08:01:49 +00:00
|
|
|
File dir = worldEdit.getWorkingDirectoryFile(worldEdit.getConfiguration().saveDir);
|
2016-01-13 23:55:49 +00:00
|
|
|
List<File> fileList = allFiles(dir);
|
|
|
|
|
2016-05-18 16:44:22 +00:00
|
|
|
if (fileList == null || fileList.isEmpty()) {
|
2015-12-28 20:05:16 +00:00
|
|
|
actor.printError("No schematics found.");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2016-03-08 17:42:23 +00:00
|
|
|
File[] files = new File[fileList.size()];
|
|
|
|
fileList.toArray(files);
|
|
|
|
|
2019-04-04 23:16:04 +00:00
|
|
|
final int sortType = oldFirst ? -1 : newFirst ? 1 : 0;
|
2012-12-25 22:36:57 +00:00
|
|
|
// cleanup file list
|
2018-06-16 06:36:55 +00:00
|
|
|
Arrays.sort(files, (f1, f2) -> {
|
|
|
|
// http://stackoverflow.com/questions/203030/best-way-to-list-files-in-java-sorted-by-date-modified
|
|
|
|
int res;
|
|
|
|
if (sortType == 0) { // use name by default
|
|
|
|
int p = f1.getParent().compareTo(f2.getParent());
|
|
|
|
if (p == 0) { // same parent, compare names
|
|
|
|
res = f1.getName().compareTo(f2.getName());
|
|
|
|
} else { // different parent, sort by that
|
|
|
|
res = p;
|
2016-01-13 23:55:49 +00:00
|
|
|
}
|
2018-06-16 06:36:55 +00:00
|
|
|
} else {
|
|
|
|
res = Long.compare(f1.lastModified(), f2.lastModified()); // use date if there is a flag
|
|
|
|
if (sortType == 1) res = -res; // flip date for newest first instead of oldest first
|
2012-12-25 22:36:57 +00:00
|
|
|
}
|
2018-06-16 06:36:55 +00:00
|
|
|
return res;
|
2012-12-25 22:36:57 +00:00
|
|
|
});
|
|
|
|
|
2019-04-28 05:12:05 +00:00
|
|
|
String pageCommand = actor.isPlayer() ? "/schem list -p %page%" + (oldFirst ? " -d" : newFirst ? " -n" : "") : null;
|
|
|
|
PaginationBox paginationBox = new SchematicPaginationBox(worldEdit.getConfiguration().saveDir, files, pageCommand);
|
|
|
|
actor.print(paginationBox.create(page));
|
2015-12-28 20:05:16 +00:00
|
|
|
}
|
|
|
|
|
2016-01-13 23:55:49 +00:00
|
|
|
private List<File> allFiles(File root) {
|
|
|
|
File[] files = root.listFiles();
|
|
|
|
if (files == null) return null;
|
2018-06-16 06:36:55 +00:00
|
|
|
List<File> fileList = new ArrayList<>();
|
2016-01-13 23:55:49 +00:00
|
|
|
for (File f : files) {
|
|
|
|
if (f.isDirectory()) {
|
|
|
|
List<File> subFiles = allFiles(f);
|
|
|
|
if (subFiles == null) continue; // empty subdir
|
|
|
|
fileList.addAll(subFiles);
|
|
|
|
} else {
|
|
|
|
fileList.add(f);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return fileList;
|
|
|
|
}
|
|
|
|
|
2012-03-28 18:05:52 +00:00
|
|
|
}
|