public void UploadFile(String filename, String username) { ServerFile newFile = new ServerFile(filename, username); if (newFile.size < 6000) { lock (mediumFileSize) { smallFileSize.Enqueue(newFile); } } else if (newFile.size >= 6000 && newFile.size < 11000) { lock (mediumFileSize) { mediumFileSize.Enqueue(newFile); } } else { lock (mediumFileSize) { largeFileSize.Enqueue(newFile); } } }
public void DownloadFile(String filename, String username) { ServerFile fileToDownload = new ServerFile(filename, username); Thread thread = new Thread(ReadResourceHandler); thread.Start(fileToDownload); }
private static void ReadResourceHandler(object fileToDownload) { ServerFile file = (ServerFile)fileToDownload; Console.WriteLine("[INFO RM] Download file:: {0} for user::{1}", file.fileName, file.owner); }
private static void RunThread(DiskManager disk, ServerFile serverFile, FileSizeE fs) { disk.currentFileSize = fs; disk.thread.Start(serverFile); }