public void ReadFileFromFilesystem (string cleanUrl, Coherent.UI.ResourceResponse response)
		{			
			if (!File.Exists(cleanUrl))
			{
				response.SignalFailure();
				return;
			}

			byte[] bytes = File.ReadAllBytes(cleanUrl);

			RespondWithBytes(bytes, response);
		}
		public void RespondWithBytes (byte[] bytes, Coherent.UI.ResourceResponse response)
		{
			IntPtr buffer = response.GetBuffer((uint)bytes.Length);
			if (buffer == IntPtr.Zero)
			{
				response.SignalFailure();
				return;
			}

			Marshal.Copy(bytes, 0, buffer, bytes.Length);

			response.SignalSuccess();
		}
		public void ReadFileFromFilesystem (string cleanUrl, Coherent.UI.ResourceResponse response)
		{
#if COHERENT_UNITY_UNSUPPORTED_PLATFORM
			throw new ApplicationException("Coherent UI doesn't support the target platform!");
#else
			if (!File.Exists(cleanUrl))
			{
				response.SignalFailure();
				return;
			}

			byte[] bytes = File.ReadAllBytes(cleanUrl);

			RespondWithBytes(bytes, response);
#endif
		}
		public void ReadTarFile (string cleanUrl, Coherent.UI.ResourceResponse response)
		{
			string archivePath = Path.Combine(GetArchiveFolder(), m_ArchiveName);
			using (FileStream unarchFile = File.OpenRead(archivePath))
			{
				TarReader reader = new TarReader(unarchFile);
				while (reader.MoveNext(true))
				{
					var path = reader.FileInfo.FileName;
					
					if (path == cleanUrl)
					{
						using (MemoryStream ms = new MemoryStream((int)reader.FileInfo.SizeInBytes))
						{
							reader.Read(ms);
							byte[] buffer = ms.GetBuffer();
							RespondWithBytes(buffer, response);
						}
						
						break;
					}
				}
			}
		}
		public object ExportObject(BoundObject target, Coherent.UI.Mobile.View view)
		{
			return null;
		}
		public override void WriteFile (string url, Coherent.UI.ResourceData resource)
		{
			string cleanUrl = string.Empty;
			bool isFile = GetFilepath(url, out cleanUrl);
			if (!isFile)
			{
				Debug.LogWarning("In this sample the archive is read only!");
				resource.SignalFailure();
				return;
			}
			
			WriteFileToFilesystem(cleanUrl, resource);
		}
		public void WriteFileToFilesystem (string cleanUrl, Coherent.UI.ResourceData resource)
		{
#if COHERENT_UNITY_UNSUPPORTED_PLATFORM
			throw new ApplicationException("Coherent UI doesn't support the target platform!");
#else
			IntPtr buffer = resource.GetBuffer();
			if (buffer == IntPtr.Zero)
			{
				resource.SignalFailure();
				return;
			}

			byte[] bytes = new byte[resource.GetSize()];
			Marshal.Copy(buffer, bytes, 0, bytes.Length);
			
			try
			{
				File.WriteAllBytes(cleanUrl, bytes);
			}
			catch (IOException ex)
			{
				Console.Error.WriteLine(ex.Message);
				resource.SignalFailure();
				return;
			}

			resource.SignalSuccess();
#endif
		}
		public override void ReadFile (string url, Coherent.UI.ResourceResponse response)
		{
			string cleanUrl = string.Empty;
			bool isFile = GetFilepath(url, out cleanUrl);
			
			if (isFile)
			{
				ReadFileFromFilesystem(cleanUrl, response);
			}
			else
			{
				ReadTarFile(cleanUrl, response);
			}
		}
		public void WriteFileToFilesystem (string cleanUrl, Coherent.UI.ResourceData resource)
		{
			IntPtr buffer = resource.GetBuffer();
			if (buffer == IntPtr.Zero)
			{
				resource.SignalFailure();
				return;
			}

			byte[] bytes = new byte[resource.GetSize()];
			Marshal.Copy(buffer, bytes, 0, bytes.Length);
			
			try
			{
				File.WriteAllBytes(cleanUrl, bytes);
			}
			catch (IOException ex)
			{
				Console.Error.WriteLine(ex.Message);
				resource.SignalFailure();
				return;
			}

			resource.SignalSuccess();
		}