package team.unstudio.udpl.util;

import java.io.File;
import java.net.URL;
import org.apache.commons.lang.Validate;
import org.bukkit.plugin.java.JavaPlugin;

public final class PluginUtils {

	private PluginUtils() {}
	
	public void saveDirectory(JavaPlugin plugin,String resourcePath,boolean replace){
		Validate.notEmpty(resourcePath);
		resourcePath = resourcePath.replace('\\', '/');
		URL url = plugin.getClass().getClassLoader().getResource(resourcePath);
		if(url == null)
			return;
		File path = new File(url.getPath());
		File outPath = new File(plugin.getDataFolder(),resourcePath);
		if(!outPath.exists())
			outPath.mkdirs();
		for (File file : path.listFiles()) {
			if(file.isFile())
				plugin.saveResource(resourcePath+"/"+file.getName(), replace);
			else
				saveDirectory(plugin, resourcePath+"/"+file.getName(), replace);
		}
	}
}

@@ -543,16 +543,103 @@
 th());%0D%0A
+%09%09if(path.isFile())%7B%0D%0A%09%09%09plugin.saveResource(resourcePath, replace);%0D%0A%09%09%09return;%0D%0A%09%09%7D%0D%0A
 %09%09File o

Update PluginUtils