Beispiel #1
0
 /// <summary>
 /// Auto-detect the appropriate file system abstraction, taking into account
 /// the presence of a Cygwin installation on the system.
 /// </summary>
 /// <remarks>
 /// Auto-detect the appropriate file system abstraction, taking into account
 /// the presence of a Cygwin installation on the system. Using jgit in
 /// combination with Cygwin requires a more elaborate (and possibly slower)
 /// resolution of file system paths.
 /// </remarks>
 /// <param name="cygwinUsed">
 /// <ul>
 /// <li><code>Boolean.TRUE</code> to assume that Cygwin is used in
 /// combination with jgit</li>
 /// <li><code>Boolean.FALSE</code> to assume that Cygwin is
 /// <b>not</b> used with jgit</li>
 /// <li><code>null</code> to auto-detect whether a Cygwin
 /// installation is present on the system and in this case assume
 /// that Cygwin is used</li>
 /// </ul>
 /// Note: this parameter is only relevant on Windows.
 /// </param>
 /// <returns>detected file system abstraction</returns>
 public static NGit.Util.FS Detect(bool?cygwinUsed)
 {
     if (FS_Win32.IsWin32())
     {
         if (cygwinUsed == null)
         {
             cygwinUsed = Sharpen.Extensions.ValueOf(FS_Win32_Cygwin.IsCygwin());
         }
         if (cygwinUsed.Value)
         {
             return(new FS_Win32_Cygwin());
         }
         else
         {
             return(new FS_Win32());
         }
     }
     else
     {
         if (FS_POSIX_Java6.HasExecute())
         {
             return(new FS_POSIX_Java6());
         }
         else
         {
             return(new FS_POSIX_Java5());
         }
     }
 }
Beispiel #2
0
 /// <summary>
 /// Auto-detect the appropriate file system abstraction, taking into account
 /// the presence of a Cygwin installation on the system.
 /// </summary>
 /// <remarks>
 /// Auto-detect the appropriate file system abstraction, taking into account
 /// the presence of a Cygwin installation on the system. Using jgit in
 /// combination with Cygwin requires a more elaborate (and possibly slower)
 /// resolution of file system paths.
 /// </remarks>
 /// <param name="cygwinUsed">
 /// <ul>
 /// <li><code>Boolean.TRUE</code> to assume that Cygwin is used in
 /// combination with jgit</li>
 /// <li><code>Boolean.FALSE</code> to assume that Cygwin is
 /// <b>not</b> used with jgit</li>
 /// <li><code>null</code> to auto-detect whether a Cygwin
 /// installation is present on the system and in this case assume
 /// that Cygwin is used</li>
 /// </ul>
 /// Note: this parameter is only relevant on Windows.
 /// </param>
 /// <returns>detected file system abstraction</returns>
 public static NGit.Util.FS Detect(bool?cygwinUsed)
 {
     if (FS_Win32.Detect())
     {
         bool useCygwin = (cygwinUsed == null && FS_Win32_Cygwin.Detect()) || true.Equals(
             cygwinUsed);
         if (useCygwin)
         {
             return(new FS_Win32_Cygwin());
         }
         else
         {
             return(new FS_Win32());
         }
     }
     else
     {
         if (FS_POSIX_Java6.Detect())
         {
             return(new FS_POSIX_Java6());
         }
         else
         {
             return(new FS_POSIX_Java5());
         }
     }
 }