Exemplo n.º 1
0
 public string DeleteAllUploadedFilesTimeSpanBeforeNow(DateTime time, string userName, bool byUser)
 {
     using (UploadHistoryLogApi m = new UploadHistoryLogApi(_writeListDir))
     {
         try
         {
             return(m.DeleteAllUploadedFilesTimeSpanBeforeNow(time, userName, byUser));
         }
         catch (Exception err)
         {
             return(err.Message);
         }
     }
 }
Exemplo n.º 2
0
 public int DeleteAllUploadedFilesOnServer(string password, string userName, bool byUser)
 {
     using (UploadHistoryLogApi m = new UploadHistoryLogApi(_writeListDir))
     {
         try
         {
             int numberOfDeletedFiles;
             int numberOfActualDeletedFiles;
             m.DeleteAllUploadedFiles(out numberOfDeletedFiles, out numberOfActualDeletedFiles, password, userName, byUser);
             return(numberOfActualDeletedFiles);
         }
         catch (Exception err)
         {
             return(-1);
         }
     }
 }
Exemplo n.º 3
0
        void SyncFileThread(string DirectoryToSync, bool recoursive, string userName, int SyncBy)
        {
            try
            {
                int        count = 0;
                FileData[] files = FastDirectoryEnumerator.GetFiles(DirectoryToSync,
                                                                    "*.Bin",
                                                                    recoursive == true ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly);

                ulong g360Index;
                using (UploadHistoryLogApi m = new UploadHistoryLogApi(_writeListDir, false))
                {
                    m.LoadLogToMemoryDic();
                    string fileToAdd = string.Empty;
                    Dictionary <string, bool> list = m.DicFileList;
                    for (int i = 0; i < files.Length; i++)
                    {
                        if (list.ContainsKey(files[i].Path) == false)
                        {
                            switch (SyncBy)
                            {
                            case 0:
                                q.AddFile(files[i].Path, m_startTime, files[i].CreationTime, out g360Index, userName);
                                break;

                            case 1:
                                q.AddFile(files[i].Path, m_startTime, files[i].LastAccesTime, out g360Index, userName);
                                break;

                            case 2:
                                q.AddFile(files[i].Path, m_startTime, files[i].LastWriteTime, out g360Index, userName);
                                break;
                            }
                            count++;
                        }
                    }
                }
                pCallback(133, m_clientIpAddress, count.ToString(), string.Empty, "ok", 0, DateTime.Now, 0, m_FileOwnerUserName);
            }
            catch (Exception err)
            {
                pCallback(133, m_clientIpAddress, "0", string.Empty, err.Message, 0, DateTime.Now, 0, m_FileOwnerUserName);
            }
        }
Exemplo n.º 4
0
 public string DeleteAllFilesFromFieldStartingFromDate(DateTime startingFrom, string password, string userName, bool byUser)
 {
     try
     {
         using (UploadHistoryLogApi m = new UploadHistoryLogApi(_writeListDir))
         {
             try
             {
                 return(m.DeleteAllFilesFromFieldStartingFromDate(startingFrom, password, userName, byUser));
             }
             catch (Exception err)
             {
                 return(err.Message);
             }
         }
     }
     catch (Exception err)
     {
         return(err.Message);
     }
 }
Exemplo n.º 5
0
 public string DeleteAllFilesFromFieldBetweenDates(DateTime start, DateTime end, bool includeTime, string password, string userName, bool byUser)
 {
     try
     {
         using (UploadHistoryLogApi m = new UploadHistoryLogApi(_writeListDir))
         {
             try
             {
                 return(m.DeleteAllFilesFromFieldBetweenDates(start, end, includeTime, password, userName, byUser));
             }
             catch (Exception err)
             {
                 return(err.Message);
             }
         }
     }
     catch (Exception err)
     {
         return(err.Message);
     }
 }
Exemplo n.º 6
0
 public string DeleteAllFilesFromFieldDaysBefore(int days, string password, string userName, bool byUser)
 {
     try
     {
         using (UploadHistoryLogApi m = new UploadHistoryLogApi(_writeListDir))
         {
             try
             {
                 return(m.DeleteAllFilesFromFieldDaysBefore(days, password, userName, byUser));
             }
             catch (Exception err)
             {
                 return(err.Message);
             }
         }
     }
     catch (Exception err)
     {
         throw (new SystemException(err.Message));
     }
 }
Exemplo n.º 7
0
        public string GetStatistics(string userName, bool byUser)
        {
            using (UploadHistoryLogApi m = new UploadHistoryLogApi(_writeListDir))
            {
                int    waitingToUpload;
                int    numberUploadedAlready;
                double totalStorageSize;
                double totalStorageWaitingToUploadSize;
                double totalStorageUploadedSize;
                int    waitingToUploadDoesNotExists;
                int    numberOfUploadedFilesThatAreStillExistOnField;
                int    numberOfUploadedFilesThatAreNotExistOnField;
                int    waitingToUploadStilExistsOnField;


                try
                {
                    m.GetStatistics(out waitingToUpload,
                                    out numberUploadedAlready,
                                    out totalStorageSize,
                                    out totalStorageWaitingToUploadSize,
                                    out totalStorageUploadedSize,
                                    out waitingToUploadDoesNotExists,
                                    out numberOfUploadedFilesThatAreStillExistOnField,
                                    out numberOfUploadedFilesThatAreNotExistOnField,
                                    out waitingToUploadStilExistsOnField,
                                    userName,
                                    byUser);


                    return(waitingToUpload.ToString() + "," + numberUploadedAlready + "," + totalStorageSize + "," + totalStorageWaitingToUploadSize + "," + totalStorageUploadedSize + "," + waitingToUploadDoesNotExists + ", " + numberOfUploadedFilesThatAreStillExistOnField + "," + numberOfUploadedFilesThatAreNotExistOnField + ", " + m_uploadInProgress + "," + waitingToUploadStilExistsOnField);
                }
                catch (Exception err)
                {
                    return(err.Message);
                }
            }
        }