示例#1
0
        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
        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
        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);
            //--
        }