Beispiel #1
0
 public FileBase(FileBase file)
 {
     FullPath    = file.FullPath;
     ContentType = file.ContentType;
     FileName    = file.FileName;
     PlatformInit(file);
 }
Beispiel #2
0
        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));
        }
Beispiel #3
0
 void PlatformInit(FileBase file)
 {
 }
Beispiel #4
0
 void PlatformInit(FileBase file)
 {
     File = file.File;
 }
Beispiel #5
0
 void PlatformInit(FileBase file)
 => throw ExceptionUtils.NotSupportedOrImplementedException;
Beispiel #6
0
 internal void Init(FileBase file) =>
 throw ExceptionUtils.NotSupportedOrImplementedException;