コード例 #1
0
ファイル: MCSService.cs プロジェクト: bsimovic/MyCloudStore
        public void Delete(string username, string token, string filename)
        {
            SQLiteConn conn = SQLiteConn.Instance;

            CheckToken(username, token);
            if (!conn.QueryFile(username, filename))
            {
                throw new FaultException("File does not exist.");
            }

            conn.DeleteFile(username, filename);
        }
コード例 #2
0
ファイル: MCSService.cs プロジェクト: bsimovic/MyCloudStore
        public void Upload(string username, StoredFile f, string token)
        {
            SQLiteConn conn = SQLiteConn.Instance;

            CheckToken(username, token);
            if (conn.QueryFile(username, f.filename))
            {
                throw new FaultException("File with that name already exsits.");
            }

            conn.InsertFile(f);
        }
コード例 #3
0
ファイル: MCSService.cs プロジェクト: bsimovic/MyCloudStore
        public StoredFile Download(string username, string filename, string token)
        {
            SQLiteConn conn = SQLiteConn.Instance;

            CheckToken(username, token);
            if (!conn.QueryFile(username, filename))
            {
                throw new FaultException("File does not exist.");
            }

            StoredFile sf = conn.GetFile(username, filename);

            return(sf);
            //--
        }