public static void convertFolderToBinary(String dir, boolean recursive)
	{
		File file = R2DFileUtility.getResource(dir);
		if(!file.exists() || !file.isDirectory())
			return;
		R2DFileFilter filter = new R2DFileFilter();
		for(File f : file.listFiles())
		{
			if(f.isFile() && filter.accept(file, f.getName()))
			{
				try
				{
					String localPath = R2DFileUtility.getRelativeFile(f).getPath();
					R2DFileManager read = new R2DFileManager(localPath,null);
					read.read();
					
					f.renameTo(new File(f.getAbsolutePath()+".orig"));
					
					R2DFileManager write = new R2DFileManager(localPath.substring(0,localPath.length()-4)+".bin",null);
					write.setCollection(read.getCollection());
					write.write();
				} catch(IOException e)
				{
					throw new Remote2DException(e);
				}
			} else if(f.isDirectory() && recursive)
				convertFolderToXML(R2DFileUtility.getRelativeFile(f).getPath(),recursive);
		}
	}