public class FS_Win32_Cygwin extends FS_Win32
FS.Attributes, FS.FSFactory| Modifier | Constructor and Description |
|---|---|
|
FS_Win32_Cygwin()
Constructor
|
protected |
FS_Win32_Cygwin(FS src)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
createSymLink(File path,
String target)
Create a symbolic link
|
void |
delete(File path)
Delete a file.
|
boolean |
exists(File path)
Tests if the path exists, in case of a symbolic link, true even if the
target does not exist
|
File |
findHook(Repository repository,
String hookName)
Tries to find a hook matching the given one in the given repository.
|
FS.Attributes |
getAttributes(File path) |
static boolean |
isCygwin() |
boolean |
isDirectory(File path)
Check if path is a directory.
|
boolean |
isFile(File path)
Examine if path represents a regular file.
|
boolean |
isHidden(File path) |
boolean |
isSymLink(File path) |
long |
lastModified(File path)
Get the last modified time of a file system object.
|
long |
length(File f)
Get the length of a file or link, If the OS/JRE supports symbolic links
it's the length of the link, else the length of the target.
|
FS |
newInstance() |
String |
readSymLink(File path)
Check if a file is a symbolic link and read it
|
String |
relativize(String base,
String other)
|
File |
resolve(File dir,
String pn)
Resolve this file to its actual path name that the JRE can use.
|
ProcessResult |
runHookIfPresent(Repository repository,
String hookName,
String[] args,
PrintStream outRedirect,
PrintStream errRedirect,
String stdinArgs)
Checks whether the given hook is defined for the given repository, then
runs it with the given arguments.
|
ProcessBuilder |
runInShell(String cmd,
String[] args)
Initialize a ProcesssBuilder to run a command using the system shell.
|
void |
setHidden(File path,
boolean hidden)
Set the hidden attribute for file whose name starts with a period.
|
void |
setLastModified(File path,
long time)
Set the last modified time of a file system object.
|
boolean |
supportsSymlinks()
Does this operating system and JRE supports symbolic links.
|
protected File |
userHomeImpl()
Determine the user's home directory (location where preferences are).
|
canExecute, discoverGitPrefix, isCaseSensitive, retryFailedLockFileCommit, setExecute, supportsExecutedetect, detect, gitPrefix, internalRunHookIfPresent, normalize, normalize, readPipe, runHookIfPresent, runProcess, searchPath, setGitPrefix, setUserHome, userHomepublic FS_Win32_Cygwin()
protected FS_Win32_Cygwin(FS src)
src - instance whose attributes to copypublic static boolean isCygwin()
public FS newInstance()
newInstance in class FS_Win32public File resolve(File dir, String pn)
FSThis 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.
protected File userHomeImpl()
FSuserHomeImpl in class FS_Win32public ProcessBuilder runInShell(String cmd, String[] args)
FSrunInShell in class FS_Win32cmd - 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.public String relativize(String base, String other)
FSrelativize in class FSbase - The path against which other should be
relativized.other - The path that will be made relative to base.base,
will yield the original other.FileUtils.relativize(String, String)public ProcessResult runHookIfPresent(Repository repository, String hookName, String[] args, PrintStream outRedirect, PrintStream errRedirect, String stdinArgs) throws JGitInternalException
FSrunHookIfPresent in class FSrepository - 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.JGitInternalException - if we fail to run the hook somehow. Causes may include an
interrupted process or I/O errors.public boolean supportsSymlinks()
FSsupportsSymlinks in class FS_Win32public boolean isSymLink(File path) throws IOException
isSymLink in class FS_Win32IOExceptionpublic long lastModified(File path) throws IOException
FSlastModified in class FS_Win32IOExceptionpublic void setLastModified(File path, long time) throws IOException
FSsetLastModified in class FS_Win32IOExceptionpublic void delete(File path) throws IOException
FSdelete in class FS_Win32IOException - this may be a Java7 subclass with detailed informationpublic long length(File f) throws IOException
FSlength in class FS_Win32IOExceptionpublic boolean exists(File path)
FSpublic boolean isDirectory(File path)
FSisDirectory in class FS_Win32public boolean isFile(File path)
FSpublic boolean isHidden(File path) throws IOException
isHidden in class FS_Win32IOExceptionpublic void setHidden(File path, boolean hidden) throws IOException
FSsetHidden in class FS_Win32IOExceptionpublic String readSymLink(File path) throws IOException
FSreadSymLink in class FS_Win32IOExceptionpublic void createSymLink(File path, String target) throws IOException
FScreateSymLink in class FS_Win32IOExceptionpublic FS.Attributes getAttributes(File path)
getAttributes in class FS_Win32public File findHook(Repository repository, String hookName)
FSCopyright © 2015. All rights reserved.