foreach(RepositoryInfo repo in repoList.EnabledRepositories) {\r
RaiseTaskSetEvent(NaGetTaskSetEventType.STARTED_TASKSET, TaskSetNames[currentTaskSetIndex]);\r
\r
- string tmpfileName = Path.GetTempFileName();\r
- try {\r
- Downloader.Download(repo.Url.Href, tmpfileName);\r
- \r
- if (repo.Type == RepositoryType.APPLISTATION_NATIVE_XML_1_0) {\r
- try {\r
- PackageList<Package> pkgList = NaGet.Utils.GetDeserializedObject<PackageList<Package>>(tmpfileName);\r
- pkgList.FixPackageListName(); // PackageListNameとの紐付けを行う\r
- \r
- // RepositoryReferenceの名前を読み込む // TODO RepositoryReferenceの名前を読み込む処理はここでいいのか?\r
- repo.Name = (string.IsNullOrEmpty(pkgList.Name))? repo.Name : pkgList.Name;\r
- \r
- avaiablePackageList.AddPackages(pkgList);\r
- } catch (InvalidOperationException) {\r
- RaiseTaskSetEvent(NaGetTaskSetEventType.ERROR, string.Format("Repository {0} does not have a AppliStation Native XML softlist.", repo.Name ?? repo.Url.Href));\r
+ if (Uri.IsWellFormedUriString(repo.Url.Href, UriKind.Absolute)) {\r
+ string tmpfileName = Path.GetTempFileName();\r
+ try {\r
+ Downloader.Download(repo.Url.Href, tmpfileName);\r
+ if (repo.Type == RepositoryType.APPLISTATION_NATIVE_XML_1_0) {\r
+ try {\r
+ PackageList<Package> pkgList = NaGet.Utils.GetDeserializedObject<PackageList<Package>>(tmpfileName);\r
+ pkgList.FixPackageListName(); // PackageListNameとの紐付けを行う\r
+ \r
+ // RepositoryReferenceの名前を読み込む // TODO RepositoryReferenceの名前を読み込む処理はここでいいのか?\r
+ repo.Name = (string.IsNullOrEmpty(pkgList.Name))? repo.Name : pkgList.Name;\r
+ \r
+ avaiablePackageList.AddPackages(pkgList);\r
+ } catch (InvalidOperationException) {\r
+ RaiseTaskSetEvent(NaGetTaskSetEventType.ERROR, string.Format("レポジトリ'{0}'はAppliStation Native XML softlist形式ではありません。", repo.Name ?? repo.Url.Href));\r
+ }\r
+ } else {\r
+ RaiseTaskSetEvent(NaGetTaskSetEventType.WARNING, string.Format("レポジトリ'{0}'の設定が不正です。", repo.Name ?? repo.Url.Href));\r
+ }\r
+ } finally {\r
+ if (File.Exists(tmpfileName)) {\r
+ File.Delete(tmpfileName);\r
}\r
- } else {\r
- RaiseTaskSetEvent(NaGetTaskSetEventType.WARNING, string.Format("Repository {0} is illegal type.", repo.Name ?? repo.Url.Href));\r
- }\r
- } finally {\r
- if (File.Exists(tmpfileName)) {\r
- File.Delete(tmpfileName);\r
}\r
+ } else {\r
+ RaiseTaskSetEvent(NaGetTaskSetEventType.WARNING, string.Format("レポジトリ'{0}'のURLが不正なため、ソフトリストは取得できませんでした。", repo.Name ?? repo.Url.Href));\r
}\r
\r
currentTaskSetIndex ++;\r