|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.jgit.util.FS
public abstract class FS
Abstraction to support various file system operations not in Java.
Field Summary | |
---|---|
static FS |
DETECTED
The auto-detected implementation selected for this operating system and JRE. |
Constructor Summary | |
---|---|
protected |
FS()
Constructs a file system abstraction. |
protected |
FS(FS src)
Initialize this FS using another's current settings. |
Method Summary | |
---|---|
abstract boolean |
canExecute(File f)
Determine if the file is executable (or not). |
static FS |
detect()
Auto-detect the appropriate file system abstraction. |
static FS |
detect(Boolean cygwinUsed)
Auto-detect the appropriate file system abstraction, taking into account the presence of a Cygwin installation on the system. |
protected abstract File |
discoverGitPrefix()
|
File |
gitPrefix()
|
abstract boolean |
isCaseSensitive()
Is this file system case sensitive |
abstract FS |
newInstance()
|
protected static String |
readPipe(File dir,
String[] command,
String encoding)
Execute a command and return a single line of output as a String |
File |
resolve(File dir,
String name)
Resolve this file to its actual path name that the JRE can use. |
abstract boolean |
retryFailedLockFileCommit()
Does this file system have problems with atomic renames? |
abstract ProcessBuilder |
runInShell(String cmd,
String[] args)
Initialize a ProcesssBuilder to run a command using the system shell. |
abstract boolean |
setExecute(File f,
boolean canExec)
Set a file to be executable by the user. |
FS |
setGitPrefix(File path)
Set the $prefix directory C Git uses. |
FS |
setUserHome(File path)
Set the user's home directory location. |
abstract boolean |
supportsExecute()
Does this operating system and JRE support the execute flag on files? |
File |
userHome()
Determine the user's home directory (location where preferences are). |
protected File |
userHomeImpl()
Determine the user's home directory (location where preferences are). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final FS DETECTED
Constructor Detail |
---|
protected FS()
protected FS(FS src)
src
- the source FS to copy from.Method Detail |
---|
public static FS detect()
public static FS detect(Boolean cygwinUsed)
cygwinUsed
- Boolean.TRUE
to assume that Cygwin is used in
combination with jgitBoolean.FALSE
to assume that Cygwin is
not used with jgitnull
to auto-detect whether a Cygwin
installation is present on the system and in this case assume
that Cygwin is usedpublic abstract FS newInstance()
public abstract boolean supportsExecute()
public abstract boolean isCaseSensitive()
public abstract boolean canExecute(File f)
Not all platforms and JREs support executable flags on files. If the feature is unsupported this method will always return false.
f
- abstract path to test.
public abstract boolean setExecute(File f, boolean canExec)
Not all platforms and JREs support executable flags on files. If the feature is unsupported this method will always return false and no changes will be made to the file specified.
f
- path to modify the executable status of.canExec
- true to enable execution; false to disable it.
public File resolve(File dir, String name)
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.
dir
- directory relative to which the path name is.name
- path name to translate.
new File(dir,name)
if this
platform does not require path name translation.public File userHome()
This method can be expensive on the first invocation if path name translation is required. Subsequent invocations return a cached result.
Not all platforms and JREs require path name translation. Currently only Cygwin on Win32 requires translation of the Cygwin HOME directory.
public FS setUserHome(File path)
path
- the location of the user's preferences; null if there is no
home directory for the current user.
this
.public abstract boolean retryFailedLockFileCommit()
protected File userHomeImpl()
protected static String readPipe(File dir, String[] command, String encoding)
dir
- Working directory for the commandcommand
- as component arrayencoding
-
public File gitPrefix()
protected abstract File discoverGitPrefix()
public FS setGitPrefix(File path)
path
- the directory. Null if C Git is not installed.
this
public abstract ProcessBuilder runInShell(String cmd, String[] args)
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |