GetAbsoluteFile() публичный Метод

public GetAbsoluteFile ( ) : FilePath
Результат FilePath
Пример #1
0
			private static FilePath Canonical(FilePath path)
			{
				try
				{
					return path.GetCanonicalFile();
				}
				catch (IOException)
				{
					return path.GetAbsoluteFile();
				}
			}
Пример #2
0
 public virtual void Test30_stripWorkDir()
 {
     FilePath relCwd = new FilePath(".");
     FilePath absCwd = relCwd.GetAbsoluteFile();
     FilePath absBase = new FilePath(new FilePath(absCwd, "repo"), "workdir");
     FilePath relBase = new FilePath(new FilePath(relCwd, "repo"), "workdir");
     NUnit.Framework.Assert.AreEqual(absBase.GetAbsolutePath(), relBase.GetAbsolutePath
         ());
     FilePath relBaseFile = new FilePath(new FilePath(relBase, "other"), "module.c");
     FilePath absBaseFile = new FilePath(new FilePath(absBase, "other"), "module.c");
     NUnit.Framework.Assert.AreEqual("other/module.c", Repository.StripWorkDir(relBase
         , relBaseFile));
     NUnit.Framework.Assert.AreEqual("other/module.c", Repository.StripWorkDir(relBase
         , absBaseFile));
     NUnit.Framework.Assert.AreEqual("other/module.c", Repository.StripWorkDir(absBase
         , relBaseFile));
     NUnit.Framework.Assert.AreEqual("other/module.c", Repository.StripWorkDir(absBase
         , absBaseFile));
     FilePath relNonFile = new FilePath(new FilePath(relCwd, "not-repo"), ".gitignore"
         );
     FilePath absNonFile = new FilePath(new FilePath(absCwd, "not-repo"), ".gitignore"
         );
     NUnit.Framework.Assert.AreEqual(string.Empty, Repository.StripWorkDir(relBase, relNonFile
         ));
     NUnit.Framework.Assert.AreEqual(string.Empty, Repository.StripWorkDir(absBase, absNonFile
         ));
     NUnit.Framework.Assert.AreEqual(string.Empty, Repository.StripWorkDir(db.WorkTree
         , db.WorkTree));
     FilePath file = new FilePath(new FilePath(db.WorkTree, "subdir"), "File.java");
     NUnit.Framework.Assert.AreEqual("subdir/File.java", Repository.StripWorkDir(db.WorkTree
         , file));
 }
Пример #3
0
		/// <exception cref="Sharpen.URISyntaxException"></exception>
		private static Require CreateRequire(FilePath dir, Context cx, Scriptable scope)
		{
			return new Require(cx, scope, new StrongCachingModuleScriptProvider(new UrlModuleSourceProvider(Collections.Singleton(dir.GetAbsoluteFile().ToURI()), Collections.Singleton(new Uri(typeof(ComplianceTest).GetResource(".").ToExternalForm() + "/")))), null, null, false);
		}