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); }
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); }
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); //-- }