Top Description Fields Constructors Methods
org.eclipse.jgit.util

public Class FS_Win32_Cygwin

extends FS_Win32
Class Inheritance
Static Imports
java.nio.charset.StandardCharsets.UTF_8

FS implementation for Cygwin on Windows
Since
3.0

Field Summary

Modifier and TypeField and Description
private static String
private static final Logger

Constructor Summary

AccessConstructor and Description
public
FS_Win32_Cygwin()

Constructor

protected
FS_Win32_Cygwin(FS
instance whose attributes to copy
src
)

Constructor

Method Summary

Modifier and TypeMethod and Description
public static boolean

Returns:

true if cygwin is found
isCygwin
()

Whether cygwin is found

public FS
newInstance()

Overrides org.eclipse.jgit.util.FS_Win32.newInstance.

Create a new instance of the same type of FS.

public String
relativize(String
The path against which other should be relativized.
base
,
String
The path that will be made relative to base.
other
)

Overrides org.eclipse.jgit.util.FS.relativize.

See org.eclipse.jgit.util.FileUtils#relativizePath(String, String, String, boolean).

public File
resolve(File
directory relative to which the path name is.
dir
,
String
path name to translate.
pn
)

Overrides org.eclipse.jgit.util.FS.resolve.

Resolve this file to its actual path name that the JRE can use.

public ProcessResult
runHookIfPresent(Repository
The repository for which a hook should be run.
repository
,
String
The name of the hook to be executed.
hookName
,
String[]
Arguments to pass to this hook. Cannot be null, but can be an empty array.
args
,
OutputStream
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.
outRedirect
,
OutputStream
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.
errRedirect
,
String
A string to pass on to the standard input of the hook. May be null.
stdinArgs
)

Overrides org.eclipse.jgit.util.FS.runHookIfPresent.

Checks whether the given hook is defined for the given repository, then runs it with the given arguments.

public ProcessBuilder
runInShell(String
command to execute. This string should originate from the end-user, and thus is platform specific.
cmd
,
String[]
arguments to pass to command. These should be protected from shell evaluation.
args
)

Overrides org.eclipse.jgit.util.FS_Win32.runInShell.

Initialize a ProcessBuilder to run a command using the system shell.

pack-priv String
shellQuote(String
the String to quote
cmd
)

Overrides org.eclipse.jgit.util.FS.shellQuote.

Quote a string (such as a file system path obtained from a Java File or Path object) such that it can be passed as first argument to runInShell(String, String[]).

protected File
userHomeImpl()

Overrides org.eclipse.jgit.util.FS_Win32.userHomeImpl.

Determine the user's home directory (location where preferences are).

Inherited from org.eclipse.jgit.util.FS_Win32:
canExecutediscoverGitExegetAttributesisCaseSensitivelistretryFailedLockFileCommitsetExecutesupportsExecute

Field Detail

cygpathback to summary
private static String cygpath
LOGback to summary
private static final Logger LOG

Hides org.eclipse.jgit.util.FS_Win32.LOG.

Constructor Detail

FS_Win32_Cygwinback to summary
public FS_Win32_Cygwin()

Constructor

FS_Win32_Cygwinback to summary
protected FS_Win32_Cygwin(FS src)

Constructor

Parameters
src:FS

instance whose attributes to copy

Method Detail

isCygwinback to summary
public static boolean isCygwin()

Whether cygwin is found

Returns:boolean

true if cygwin is found

newInstanceback to summary
public FS newInstance()

Overrides org.eclipse.jgit.util.FS_Win32.newInstance.

Doc from org.eclipse.jgit.util.FS.newInstance.

Create a new instance of the same type of FS.

Returns:FS

a new instance of the same type of FS.

Annotations
@Override
relativizeback to summary
public String relativize(String base, String other)

Overrides org.eclipse.jgit.util.FS.relativize.

Doc from org.eclipse.jgit.util.FS.relativize.

See org.eclipse.jgit.util.FileUtils#relativizePath(String, String, String, boolean).

Parameters
base:String

The path against which other should be relativized.

other:String

The path that will be made relative to base.

Returns:String

A relative path that, when resolved against base, will yield the original other.

Annotations
@Override
resolveback to summary
public File resolve(File dir, String pn)

Overrides org.eclipse.jgit.util.FS.resolve.

Doc from org.eclipse.jgit.util.FS.resolve.

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.

Parameters
dir:File

directory relative to which the path name is.

pn:String

path name to translate.

Returns:File

the translated path. new File(dir,name) if this platform does not require path name translation.

Annotations
@Override
runHookIfPresentback to summary
public ProcessResult runHookIfPresent(Repository repository, String hookName, String[] args, OutputStream outRedirect, OutputStream errRedirect, String stdinArgs) throws JGitInternalException

Overrides org.eclipse.jgit.util.FS.runHookIfPresent.

Doc from org.eclipse.jgit.util.FS.runHookIfPresent.

Checks whether the given hook is defined for the given repository, then runs it with the given arguments.

Parameters
repository:Repository

The repository for which a hook should be run.

hookName:String

The name of the hook to be executed.

args:String[]

Arguments to pass to this hook. Cannot be null, but can be an empty array.

outRedirect:OutputStream

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:OutputStream

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:String

A string to pass on to the standard input of the hook. May be null.

Returns:ProcessResult

The ProcessResult describing this hook's execution.

Annotations
@Override
Exceptions
JGitInternalException:
if we fail to run the hook somehow. Causes may include an interrupted process or I/O errors.
runInShellback to summary
public ProcessBuilder runInShell(String cmd, String[] args)

Overrides org.eclipse.jgit.util.FS_Win32.runInShell.

Doc from org.eclipse.jgit.util.FS.runInShell.

Initialize a ProcessBuilder to run a command using the system shell.

Parameters
cmd:String

command to execute. This string should originate from the end-user, and thus is platform specific.

args:String[]

arguments to pass to command. These should be protected from shell evaluation.

Returns:ProcessBuilder

a partially completed process builder. Caller should finish populating directory, environment, and then start the process.

Annotations
@Override
shellQuoteback to summary
pack-priv String shellQuote(String cmd)

Overrides org.eclipse.jgit.util.FS.shellQuote.

Doc from org.eclipse.jgit.util.FS.shellQuote.

Quote a string (such as a file system path obtained from a Java File or Path object) such that it can be passed as first argument to runInShell(String, String[]).

This default implementation returns the string unchanged.

Parameters
cmd:String

the String to quote

Returns:String

the quoted string

Annotations
@Override
userHomeImplback to summary
protected File userHomeImpl()

Overrides org.eclipse.jgit.util.FS_Win32.userHomeImpl.

Doc from org.eclipse.jgit.util.FS.userHomeImpl.

Determine the user's home directory (location where preferences are).

Returns:File

the user's home directory; null if the user does not have one.

Annotations
@Override