public GroupDocsComponents()
        {
            list.Clear();

            GroupDocsComponent groupdocsEditor = new GroupDocsComponent();

            groupdocsEditor.set_downloadUrl("");
            groupdocsEditor.set_downloadFileName("groupdocs.Editor.zip");
            groupdocsEditor.set_name(Constants.GROUPDOCS_COMPONENT);
            groupdocsEditor.set_remoteExamplesRepository("https://github.com/groupdocs-Editor/GroupDocs.Editor-for-.NET.git");
            list.Add(Constants.GROUPDOCS_COMPONENT, groupdocsEditor);
        }
        public static void storeVersion(GroupDocsComponent component)
        {
            string localPath = getLibaryDownloadPath() + component.get_name() + ".ver";

            try
            {
                System.IO.File.WriteAllText(localPath, component.get_latestVersion());
            }
            catch (FileNotFoundException e)
            {
            }
            catch (Exception e)
            {
            }
        }
        public void storeReleaseNotes(GroupDocsComponent component)
        {
            string localPath = getLibaryDownloadPath() + component.get_name() + ".htm";

            try
            {
                System.IO.File.WriteAllText(localPath, component.get_changeLog());
            }
            catch (FileNotFoundException e)
            {
            }
            catch (Exception e)
            {
            }
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="component"></param>
        /// <returns></returns>

        public static string CloneOrCheckOutRepo(GroupDocsComponent component)
        {
            string repUrl      = component.get_remoteExamplesRepository();
            string localFolder = getLocalRepositoryPath(component);
            string error       = string.Empty;

            checkAndCreateFolder(getLocalRepositoryPath(component));

            try
            {
                CloneCommand clone = Git.CloneRepository();
                clone.SetURI(repUrl);
                clone.SetDirectory(localFolder);

                Git repo = clone.Call();
                //writer.Close();
                repo.GetRepository().Close();
            }
            catch (Exception ex)
            {
                try
                {
                    var git = Git.Open(localFolder);
                    //var repository = git.GetRepository();
                    //PullCommand pullCommand = git.Pull();
                    //pullCommand.Call();
                    //repository.Close();

                    var reset = git.Reset().SetMode(ResetCommand.ResetType.HARD).SetRef("origin/master").Call();
                }
                catch (Exception ex2)
                {
                    error = ex2.Message;
                }

                error = ex.Message;
            }

            return(error);
        }
 public static string getLocalRepositoryPath(GroupDocsComponent component)
 {
     return(GroupDocsComponentsManager.getGroupDocsHomePath() + "gitrepos" + "/" + component.get_name());
 }