Class FS_Win32_Cygwin

  • public class FS_Win32_Cygwin
    extends FS_Win32
    FS implementation for Cygwin on Windows
    • Constructor Detail

      • FS_Win32_Cygwin

        public FS_Win32_Cygwin()
      • FS_Win32_Cygwin

        protected FS_Win32_Cygwin​(FS src)
        src - instance whose attributes to copy
    • Method Detail

      • isCygwin

        public static boolean isCygwin()
        Whether cygwin is found
        true if cygwin is found
      • newInstance

        public FS newInstance()
        Create a new instance of the same type of FS.
        newInstance in class FS_Win32
        a new instance of the same type of FS.
      • resolve

        public File resolve​(File dir,
                            String pn)
        Resolve this file to its actual path name that the JRE can use.

        This method can be relatively expensive. Computing a translation may require forking an external process per path name translated. Callers should try to minimize the number of translations necessary by caching the results.

        Not all platforms and JREs require path name translation. Currently only Cygwin on Win32 require translation for Cygwin based paths.

        resolve in class FS
        dir - directory relative to which the path name is.
        pn - path name to translate.
        the translated path. new File(dir,name) if this platform does not require path name translation.
      • userHomeImpl

        protected File userHomeImpl()
        Determine the user's home directory (location where preferences are).
        userHomeImpl in class FS_Win32
        the user's home directory; null if the user does not have one.
      • runInShell

        public ProcessBuilder runInShell​(String cmd,
                                         String[] args)
        Initialize a ProcessBuilder to run a command using the system shell.
        runInShell in class FS_Win32
        cmd - command to execute. This string should originate from the end-user, and thus is platform specific.
        args - arguments to pass to command. These should be protected from shell evaluation.
        a partially completed process builder. Caller should finish populating directory, environment, and then start the process.
      • runHookIfPresent

        public ProcessResult runHookIfPresent​(Repository repository,
                                              String hookName,
                                              String[] args,
                                              OutputStream outRedirect,
                                              OutputStream errRedirect,
                                              String stdinArgs)
                                       throws JGitInternalException
        Checks whether the given hook is defined for the given repository, then runs it with the given arguments.
        runHookIfPresent in class FS
        repository - The repository for which a hook should be run.
        hookName - The name of the hook to be executed.
        args - Arguments to pass to this hook. Cannot be null, but can be an empty array.
        outRedirect - A print stream on which to redirect the hook's stdout. Can be null, in which case the hook's standard output will be lost.
        errRedirect - A print stream on which to redirect the hook's stderr. Can be null, in which case the hook's standard error will be lost.
        stdinArgs - A string to pass on to the standard input of the hook. May be null.
        The ProcessResult describing this hook's execution.
        JGitInternalException - if we fail to run the hook somehow. Causes may include an interrupted process or I/O errors.