public override bool Equals(object obj)
        {
            if (obj == null || GetType() != obj.GetType())
            {
                return(false);
            }

            var compareTo = (LocalStorageLocation)obj;

            return(RootPath.Equals(compareTo.RootPath, StringComparison.CurrentCultureIgnoreCase));
        }
Esempio n. 2
0
 public bool Equals(FileItem other)
 {
     if (Object.ReferenceEquals(other, null))
     {
         return(false);
     }
     if (object.ReferenceEquals(this, other))
     {
         return(true);
     }
     return(FileName.Equals(other.FileName) &&
            RootPath.Equals(other.RootPath) &&
            SHAHash.Equals(other.SHAHash) &&
            FileSize.Equals(other.FileSize));
 }
Esempio n. 3
0
 private void AutoCreateDir(string ftpFile)
 {
     if (!MakeDirIfNotExist) return;
     string folderWhole = RootPath.Equals("") ? ftpFile : RootPath + "/" + ftpFile;
     string[] dirs = folderWhole.Replace("//", "/").Split('/');
     string folder = "";
     for (int i = 0; i<dirs.Length - 1; i++)
     {
         string dir = dirs[i];
         if (dir.Equals("")) continue;
         List<string> lst = GetDirectoryList(folder);
         if (!lst.Contains(dir))
         {
             MakeDir(folder + "/" + dir);
         }
         folder += "/" + dir;
     }
 }
Esempio n. 4
0
        /// <summary>
        /// Returns true if OrgApacheJackrabbitOakSegmentAzureAzureSegmentStoreServiceProperties instances are equal
        /// </summary>
        /// <param name="other">Instance of OrgApacheJackrabbitOakSegmentAzureAzureSegmentStoreServiceProperties to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(OrgApacheJackrabbitOakSegmentAzureAzureSegmentStoreServiceProperties other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     AccountName == other.AccountName ||
                     AccountName != null &&
                     AccountName.Equals(other.AccountName)
                     ) &&
                 (
                     ContainerName == other.ContainerName ||
                     ContainerName != null &&
                     ContainerName.Equals(other.ContainerName)
                 ) &&
                 (
                     AccessKey == other.AccessKey ||
                     AccessKey != null &&
                     AccessKey.Equals(other.AccessKey)
                 ) &&
                 (
                     RootPath == other.RootPath ||
                     RootPath != null &&
                     RootPath.Equals(other.RootPath)
                 ) &&
                 (
                     ConnectionURL == other.ConnectionURL ||
                     ConnectionURL != null &&
                     ConnectionURL.Equals(other.ConnectionURL)
                 ));
        }
Esempio n. 5
0
        /// <summary>
        /// Returns true if ComAdobeAemUpgradePrechecksTasksImplConsistencyCheckTaskImplProperties instances are equal
        /// </summary>
        /// <param name="other">Instance of ComAdobeAemUpgradePrechecksTasksImplConsistencyCheckTaskImplProperties to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ComAdobeAemUpgradePrechecksTasksImplConsistencyCheckTaskImplProperties other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     RootPath == other.RootPath ||
                     RootPath != null &&
                     RootPath.Equals(other.RootPath)
                     ) &&
                 (
                     FixInconsistencies == other.FixInconsistencies ||
                     FixInconsistencies != null &&
                     FixInconsistencies.Equals(other.FixInconsistencies)
                 ));
        }
Esempio n. 6
0
        private void init(string ftpFile)
        {
            string uri = string.Format(@"ftp://{0}:{1}/", Host, Port);

            if (RootPath.Equals(""))
            {
                uri += ftpFile;
            }
            else
            {
                uri += RootPath + "/" + ftpFile;
            }
            
            // 根据uri创建FtpWebRequest对象 
            ftpReq = (FtpWebRequest)FtpWebRequest.Create(new Uri(uri));
            ftpReq.Credentials = new NetworkCredential(UserName, UserPassword); // ftp用户名和密码 
            ftpReq.KeepAlive = KeepAlive;
            ftpReq.UsePassive = UsePasv;
            ftpReq.EnableSsl = UseSSL;
            ftpReq.UseBinary = UseBinary;
            ftpReq.Timeout = TimeOut;
            ftpReq.ReadWriteTimeout = TimeOut;
        }