ReadAll() public abstract method

public abstract ReadAll ( ) : FileContent
return FileContent
Esempio n. 1
0
        public bool IsRoomFor(string name, FileContent fileContent)
        {
            VolumeFile existingFile = Open(name);

            int usedByThisFile = 0;

            if (existingFile != null)
            {
                usedByThisFile = existingFile.ReadAll().Size;
            }

            return(INFINITE_CAPACITY == FreeSpace || FreeSpace + usedByThisFile >= fileContent.Size);
        }
Esempio n. 2
0
        public bool IsRoomFor(VolumePath path, FileContent fileContent)
        {
            VolumeItem existing = Open(path);

            if (existing is VolumeDirectory)
            {
                throw new KOSPersistenceException("'" + path + "' is a directory");
            }

            VolumeFile existingFile = existing as VolumeFile;

            int usedByThisFile = 0;

            if (existingFile != null)
            {
                usedByThisFile = existingFile.ReadAll().Size;
            }

            return(INFINITE_CAPACITY == FreeSpace || FreeSpace + usedByThisFile >= fileContent.Size);
        }
Esempio n. 3
0
 public VolumeFile SaveFile(VolumeFile volumeFile)
 {
     return(SaveFile(volumeFile.Path, volumeFile.ReadAll()));
 }
Esempio n. 4
0
        //public abstract bool AppendToFile(string name, string textToAppend);

        //public abstract bool AppendToFile(string name, byte[] bytesToAppend);

        public VolumeFile Save(VolumeFile volumeFile)
        {
            return(Save(volumeFile.Name, volumeFile.ReadAll()));
        }
Esempio n. 5
0
 protected bool CopyFileToDirectory(VolumeFile volumeFile, VolumeDirectory volumeDirectory,
                                    bool verifyFreeSpace)
 {
     return(volumeDirectory.Volume.SaveFile(volumeDirectory.Path.Combine(volumeFile.Name), volumeFile.ReadAll(),
                                            verifyFreeSpace) != null);
 }
Esempio n. 6
0
 protected bool CopyFile(VolumeFile volumeFile, GlobalPath destinationPath, Volume targetVolume,
                         bool verifyFreeSpace)
 {
     return(targetVolume.SaveFile(destinationPath, volumeFile.ReadAll(), verifyFreeSpace) != null);
 }