package org.arkiwi.app.utility;

import java.io.File;

import android.os.Environment;

public class Download {
	
	public static File getFile(String url, String reldir) {
		final String ADIR = "/aarkiwi/" ;
		File file, apath;
		
    String[] fileUrlParts = url.split("/");
		apath = new File(Environment.getExternalStorageDirectory()+ ADIR + reldir);
		if (! apath.exists()){
			apath.mkdirs();
		} 
		
    file = new File(apath.toString()+ "/" + fileUrlParts[fileUrlParts.length-1]);
    //Log.d(LOG_TAG,"getFile() file path:"+file.toString());
	    	
    return file;
	}
}
