Package org.apache.bookkeeper.util
Class HardLink.HardLinkCGWin
- java.lang.Object
- 
- org.apache.bookkeeper.util.HardLink.HardLinkCGWin
 
- 
- Enclosing class:
- HardLink
 
 static class HardLink.HardLinkCGWin extends java.lang.ObjectImplementation of HardLinkCommandGetter class for Windows.Note that the linkCount shell command for Windows is actually a Cygwin shell command, and depends on ${cygwin}/bin being in the Windows PATH environment variable, so stat.exe can be found. 
- 
- 
Field SummaryFields Modifier and Type Field Description (package private) static java.lang.String[]getLinkCountCommand(package private) static java.lang.String[]hardLinkCommand(package private) static java.lang.StringhardLinkMultDir(package private) static java.lang.String[]hardLinkMultPrefix(package private) static java.lang.String[]hardLinkMultSuffix
 - 
Constructor SummaryConstructors Constructor Description HardLinkCGWin()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) intgetLinkMultArgLength(java.io.File fileDir, java.lang.String[] fileBaseNames, java.io.File linkDir)Calculate the total string length of the shell command resulting from execution of linkMult, plus the length of the source directory name (which will also be provided to the shell).(package private) intgetMaxAllowedCmdArgLength()Get the maximum allowed string length of a shell command on this OS, which is just the documented minimum guaranteed supported command length - aprx.(package private) java.lang.String[]linkCount(java.io.File file)Get the command string to query the hardlink count of a file.(package private) java.lang.String[]linkMult(java.lang.String[] fileBaseNames, java.io.File linkDir)Get the command string needed to hardlink a bunch of files from a single source directory into a target directory.(package private) java.lang.String[]linkOne(java.io.File file, java.io.File linkName)Get the command string needed to hardlink a single file.
 
- 
- 
- 
Field Detail- 
hardLinkCommandstatic java.lang.String[] hardLinkCommand 
 - 
hardLinkMultPrefixstatic java.lang.String[] hardLinkMultPrefix 
 - 
hardLinkMultDirstatic java.lang.String hardLinkMultDir 
 - 
hardLinkMultSuffixstatic java.lang.String[] hardLinkMultSuffix 
 - 
getLinkCountCommandstatic java.lang.String[] getLinkCountCommand 
 
- 
 - 
Method Detail- 
linkOnejava.lang.String[] linkOne(java.io.File file, java.io.File linkName) throws java.io.IOExceptionGet the command string needed to hardlink a single file.- Throws:
- java.io.IOException
 
 - 
linkMultjava.lang.String[] linkMult(java.lang.String[] fileBaseNames, java.io.File linkDir) throws java.io.IOExceptionGet the command string needed to hardlink a bunch of files from a single source directory into a target directory. The source directory is not specified here, but the command will be executed using the source directory as the "current working directory" of the shell invocation.- Parameters:
- fileBaseNames- - array of path-less file names, relative to the source directory
- linkDir- - target directory where the hardlinks will be put
- Returns:
- - an array of Strings suitable for use as a single shell command
            with Runtime.exec()
- Throws:
- java.io.IOException- - if any of the file or path names misbehave
 
 - 
linkCountjava.lang.String[] linkCount(java.io.File file) throws java.io.IOExceptionGet the command string to query the hardlink count of a file.- Throws:
- java.io.IOException
 
 - 
getLinkMultArgLengthint getLinkMultArgLength(java.io.File fileDir, java.lang.String[] fileBaseNames, java.io.File linkDir) throws java.io.IOExceptionCalculate the total string length of the shell command resulting from execution of linkMult, plus the length of the source directory name (which will also be provided to the shell).- Parameters:
- fileDir- - source directory, parent of fileBaseNames
- fileBaseNames- - array of path-less file names, relative to the source directory
- linkDir- - target directory where the hardlinks will be put
- Returns:
- - total data length (must not exceed maxAllowedCmdArgLength)
- Throws:
- java.io.IOException
 
 - 
getMaxAllowedCmdArgLengthint getMaxAllowedCmdArgLength() Get the maximum allowed string length of a shell command on this OS, which is just the documented minimum guaranteed supported command length - aprx. 32KB for Unix, and 8KB for Windows.
 
- 
 
-