public DataProvider(File dir) {
		// building an array of files in dir
		File[] newFileList = dir.listFiles();
		// building a new array of files in dir + 1 file for previous folder
		fileList = new File[(newFileList.length + 1)];

		if (fileList.length > 1) {
			fileList[0] = newFileList[0].getParentFile();
			for (int i = 1; i < fileList.length; i++)
				fileList[i] = newFileList[i - 1];
		} else {
			try {
				fileList[0] = dir.getCanonicalFile();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}