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