Beispiel #1
0
        public void CreateProvider_Success()
        {
            var       factory  = new FileSystemProviderFactory();
            IProvider provider = factory.CreateProvider(_hostInteraction);

            Assert.AreSame(_hostInteraction.WorkingDirectory, provider.HostInteraction.WorkingDirectory);
            Assert.AreSame(_hostInteraction.CacheDirectory, provider.HostInteraction.CacheDirectory);
            Assert.IsFalse(string.IsNullOrEmpty(provider.Id));
        }
Beispiel #2
0
        public void DeleteFile(int fileID)
        {
            AuthorizedIdent ident = AuthenticateTicket(Ticket);

            CFile file = new FileSystem(ident, true).GetFile(fileID);

            FileSystemProviderFactory.GetInstance(this);
            m_fs.DeleteFile(file);
        }
Beispiel #3
0
        public void CommitData(int fileID, byte[] data)
        {
            AuthorizedIdent ident = AuthenticateTicket(Ticket);

            CFile file = new FileSystem(ident, true).GetFile(fileID);

            file.RawData = data;
            FileSystemProviderFactory.GetInstance(this);
            m_fs.CommitData(file);
        }
Beispiel #4
0
        public DataEnvelope LoadFileData(int fileID)
        {
            AuthorizedIdent ident = AuthenticateTicket(Ticket);

            CFile file = new FileSystem(ident, true).GetFile(fileID);

            FileSystemProviderFactory.GetInstance(this);
            m_fs.FetchData(file);

            return(new DataEnvelope(file.RawData, file.RawData.Length));
        }
Beispiel #5
0
        public void CopyFile(int destID, int srcID)
        {
            AuthorizedIdent ident = AuthenticateTicket(Ticket);

            FileSystem fs   = new FileSystem(ident, true);
            CFile      src  = fs.GetFile(srcID);
            CFile      dest = fs.GetFile(destID);

            FileSystemProviderFactory.GetInstance(this);
            m_fs.CopyFile(dest, src);
        }
Beispiel #6
0
        private void Init(AuthorizedIdent ident, bool local)
        {
            DataProviderFactory.GetInstance(this);
            m_ident = ident;
            m_user  = new Users(m_ident).GetInfo(m_ident.Name, null);

            if (local || Globals.FSLocal)
            {
                FileSystemProviderFactory.GetInstance(this);
            }
            else
            {
                FileServiceInit(ident, false);
            }
        }
Beispiel #7
0
 public void CreateProvider_NullParameter()
 {
     var       factory  = new FileSystemProviderFactory();
     IProvider provider = factory.CreateProvider(null);
 }