Exemplo n.º 1
0
        private void SendFileRequest(ICommandConnection connection,
                                     Entry entry)
        {
            bool     fileExists;
            DateTime old = entry.TimeStamp;

            entry.TimeStamp = entry.TimeStamp;
            try {
                fileExists = File.Exists(entry.FullPath);
            }
            catch (Exception e) {
                LOGGER.Error(e);
                fileExists = false;
            }

            if (!fileExists)
            {
                connection.SubmitRequest(new EntryRequest(entry));
            }
            else if (File.GetLastAccessTime(entry.FullPath) !=
                     entry.TimeStamp.ToUniversalTime())
            {
                connection.SubmitRequest(new ModifiedRequest(entry.Name));
                connection.SendFile(entry.FullPath, entry.IsBinaryFile);
            }
            else
            {
                connection.SubmitRequest(new EntryRequest(entry));
                connection.SubmitRequest(new UnchangedRequest(entry.Name));
            }

            entry.TimeStamp = old;
        }
Exemplo n.º 2
0
        private void SendFileRequest(ICommandConnection connection, Entry entry)
        {
            DateTime old = entry.TimeStamp;

            entry.TimeStamp = entry.TimeStamp;
            connection.SubmitRequest(new EntryRequest(entry));
            connection.SubmitRequest(new ModifiedRequest(entry.Name));
            connection.SendFile(entry.FullPath, entry.IsBinaryFile);

            entry.TimeStamp = old;
        }
Exemplo n.º 3
0
        private void SendFileRequest (ICommandConnection connection,
            Entry entry) {
            DateTime old = entry.TimeStamp;
            entry.TimeStamp = entry.TimeStamp;
            connection.SubmitRequest (new EntryRequest (entry));
            connection.SubmitRequest(new ModifiedRequest(entry.Name));
            connection.SendFile(entry.FullPath, entry.IsBinaryFile);

            entry.TimeStamp = old;
        }
        private void SendFileRequest (ICommandConnection connection,
            Entry entry) {
            bool fileExists;
            DateTime old = entry.TimeStamp;
            entry.TimeStamp = entry.TimeStamp;
            try {
                fileExists = File.Exists (entry.FullPath);
            }
            catch (Exception e) {
                LOGGER.Error (e);
                fileExists = false;
            }

            if (!fileExists) {
                connection.SubmitRequest (new EntryRequest (entry));
            } else if (File.GetLastAccessTime(entry.FullPath) !=
                entry.TimeStamp.ToUniversalTime ()) {
                connection.SubmitRequest(new ModifiedRequest(entry.Name));
                connection.SendFile(entry.FullPath, entry.IsBinaryFile);
            } else {
                connection.SubmitRequest(new EntryRequest(entry));
                connection.SubmitRequest(new UnchangedRequest(entry.Name));
            }

            entry.TimeStamp = old;
        }