package net.gtaun.wl.race.importer;

import java.io.File;

import net.gtaun.wl.race.TrackManager;

public abstract class Importer
{
	protected final TrackManager trackManager;
	
	
	protected Importer(TrackManager trackManager)
	{
		this.trackManager = trackManager;	
	}
	
	public void importTracks(File dir)
	{
		File[] files = dir.listFiles();
		for (File file : files)
		{
			System.out.println(String.format("%1$s Import Track: %2$s", getClass().getSimpleName(), file.getPath()));
			try
			{
				importTrack(file);
			}
			catch (Throwable e)
			{
				System.out.println("Cannot import this file.");
			}
		}
	}
	
	public abstract void importTrack(File file) throws Throwable;
}

@@ -512,16 +512,35 @@
 (file);%0A
+%09%09%09%09file.delete();%0A
 %09%09%09%7D%0A%09%09%09
@@ -592,31 +592,53 @@
 ln(%22
-Cannot import this file
+Import file %5C%22%22 + file.getName() + %22%5C%22 Failed
 .%22);

添加导入后删除文件的功能。