public FileBase(FileBase file) { FullPath = file.FullPath; ContentType = file.ContentType; FileName = file.FileName; PlatformInit(file); }
internal static AndroidUri GetShareableFileUri(FileBase file) { Java.IO.File sharedFile; if (FileProvider.IsFileInPublicLocation(file.FullPath)) { // we are sharing a file in a "shared/public" location sharedFile = new Java.IO.File(file.FullPath); } else { var root = FileProvider.GetTemporaryRootDirectory(); var tmpFile = FileSystemUtils.GetTemporaryFile(root, file.FileName); System.IO.File.Copy(file.FullPath, tmpFile.CanonicalPath); sharedFile = tmpFile; } // create the uri, if N use file provider if (OperatingSystem.IsAndroidVersionAtLeast(24)) { return(FileProvider.GetUriForFile(sharedFile)); } // use the shared file path created return(AndroidUri.FromFile(sharedFile)); }
void PlatformInit(FileBase file) { }
void PlatformInit(FileBase file) { File = file.File; }
void PlatformInit(FileBase file) => throw ExceptionUtils.NotSupportedOrImplementedException;
internal void Init(FileBase file) => throw ExceptionUtils.NotSupportedOrImplementedException;