package hh.dejsem.hack;

import android.os.Environment;

import java.io.File;

import hh.lib.D;

public class HackFile {

	D d;

	HackFile(D d) { this.d = d.klon(this); }

	void fileStorageTest() {
		d.l(String.format("+++ getDataDirectory()=%s", Environment.getDataDirectory().getPath()));
		d.l(String.format("+++ getDownloadCacheDirectory()=%s", Environment.getDownloadCacheDirectory().getPath()));
		d.l(String.format("+++ getExternalStorageDirectory()=%s", Environment.getExternalStorageDirectory().getPath()));
		d.l(String.format("+++ getExternalStoragePublicDirectory(DIRECTORY_DOWNLOADS)=%s", Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getPath()));
		d.l(String.format("+++ getExternalStorageState()=%s", Environment.getExternalStorageState(new File("/storage/extSdCard/HH"))));
		d.l(String.format("+++ getRootDirectory()=%s", Environment.getRootDirectory()));
		d.l(String.format("+++ isExternalStorageEmulated()=%b", Environment.isExternalStorageEmulated()));
		d.l(String.format("+++ isExternalStorageRemovable()=%b", Environment.isExternalStorageRemovable()));

		File f= new File(Environment.getExternalStorageDirectory(), "_HH/tmp/f");
		d.l(String.format("set timestamp=%b", f.setLastModified(1000*1000*1000*1000L)));
		for(String fn: (new File(Environment.getExternalStorageDirectory(), "_HH/tmp").list())) d.l("+++ " + fn);
	}
}
