Class SVNFileUtil

java.lang.Object
org.tmatesoft.svn.core.internal.wc.SVNFileUtil

public class SVNFileUtil extends java.lang.Object
Version:
1.3
  • Field Details

    • ID_COMMAND

      private static final java.lang.String ID_COMMAND
    • LN_COMMAND

      private static final java.lang.String LN_COMMAND
    • LS_COMMAND

      public static final java.lang.String LS_COMMAND
    • CHMOD_COMMAND

      private static final java.lang.String CHMOD_COMMAND
    • ATTRIB_COMMAND

      private static final java.lang.String ATTRIB_COMMAND
    • ENV_COMMAND

      private static final java.lang.String ENV_COMMAND
    • STAT_COMMAND

      private static final java.lang.String STAT_COMMAND
    • logNativeCalls

      public static final boolean logNativeCalls
    • isWindows

      public static final boolean isWindows
    • isOS2

      public static final boolean isOS2
    • isOSX

      public static final boolean isOSX
    • isBSD

      public static final boolean isBSD
    • isLinux

      public static boolean isLinux
    • isSolaris

      public static final boolean isSolaris
    • isOpenVMS

      public static final boolean isOpenVMS
    • is32Bit

      public static final boolean is32Bit
    • is64Bit

      public static final boolean is64Bit
    • STREAM_CHUNK_SIZE

      public static final int STREAM_CHUNK_SIZE
      See Also:
    • FILE_CREATION_ATTEMPTS_COUNT

      public static final int FILE_CREATION_ATTEMPTS_COUNT
    • DUMMY_OUT

      public static final java.io.OutputStream DUMMY_OUT
    • DUMMY_IN

      public static final java.io.InputStream DUMMY_IN
    • ourUseUnsafeCopyOnly

      private static boolean ourUseUnsafeCopyOnly
    • ourCopyOnSetWritable

      private static boolean ourCopyOnSetWritable
    • ourUseNIOCopying

      private static boolean ourUseNIOCopying
    • nativeEOLMarker

      private static java.lang.String nativeEOLMarker
    • ourGroupID

      private static java.lang.String ourGroupID
    • ourUserID

      private static java.lang.String ourUserID
    • ourAppDataPath

      private static java.io.File ourAppDataPath
    • ourAdminDirectoryName

      private static java.lang.String ourAdminDirectoryName
    • ourSystemAppDataPath

      private static java.io.File ourSystemAppDataPath
    • ourSetWritableMethod

      private static java.lang.reflect.Method ourSetWritableMethod
    • ourSetExecutableMethod

      private static java.lang.reflect.Method ourSetExecutableMethod
    • ourIsSleepForTimeStamp

      private static volatile boolean ourIsSleepForTimeStamp
    • BINARY_MIME_TYPE

      public static final java.lang.String BINARY_MIME_TYPE
      See Also:
    • ourTestEditor

      private static java.lang.String ourTestEditor
    • ourTestMergeTool

      private static java.lang.String ourTestMergeTool
    • ourTestFunction

      private static java.lang.String ourTestFunction
    • java7readAttributesMethod

      private static java.lang.reflect.Method java7readAttributesMethod
    • java7toPathMethod

      private static java.lang.reflect.Method java7toPathMethod
    • java7lastModifiedTimeMethod

      private static java.lang.reflect.Method java7lastModifiedTimeMethod
    • java7setLastModifiedTimeMethod

      private static java.lang.reflect.Method java7setLastModifiedTimeMethod
    • java7toTimeMethod

      private static java.lang.reflect.Method java7toTimeMethod
    • java7fromTimeMethod

      private static java.lang.reflect.Method java7fromTimeMethod
    • java7BasciFileAttributesClazz

      private static java.lang.Class<?> java7BasciFileAttributesClazz
    • java7FileTimeClazz

      private static java.lang.Class<?> java7FileTimeClazz
    • java7noFollowLinksParam

      private static java.lang.Object java7noFollowLinksParam
  • Constructor Details

    • SVNFileUtil

      public SVNFileUtil()
  • Method Details

    • isCaseInsensitiveFS

      public static boolean isCaseInsensitiveFS()
    • useUnsafeCopyOnly

      public static boolean useUnsafeCopyOnly()
    • setUseUnsafeCopyOnly

      public static void setUseUnsafeCopyOnly(boolean useUnsafeCopyOnly)
    • useCopyOnSetWritable

      public static boolean useCopyOnSetWritable()
    • setUseCopyOnSetWritable

      public static void setUseCopyOnSetWritable(boolean useCopyOnSetWritable)
    • useNIOCopying

      public static boolean useNIOCopying()
    • setUseNIOCopying

      public static void setUseNIOCopying(boolean useNIOCopy)
    • getIdCommand

      public static java.lang.String getIdCommand()
    • getLnCommand

      public static java.lang.String getLnCommand()
    • getLsCommand

      public static java.lang.String getLsCommand()
    • getChmodCommand

      public static java.lang.String getChmodCommand()
    • getAttribCommand

      public static java.lang.String getAttribCommand()
    • getEnvCommand

      public static java.lang.String getEnvCommand()
    • getStatCommand

      public static java.lang.String getStatCommand()
    • getParentFile

      public static java.io.File getParentFile(java.io.File file)
    • readFully

      public static byte[] readFully(java.io.File file) throws SVNException
      Throws:
      SVNException
    • readFile

      public static java.lang.String readFile(java.io.File file) throws SVNException
      Throws:
      SVNException
    • readFile

      public static java.lang.String readFile(java.io.InputStream input) throws java.io.IOException
      Throws:
      java.io.IOException
    • readIntoBuffer

      public static int readIntoBuffer(java.io.InputStream is, byte[] buff, int off, int len) throws java.io.IOException
      Throws:
      java.io.IOException
    • getBasePath

      public static java.lang.String getBasePath(java.io.File file)
    • createEmptyFile

      public static void createEmptyFile(java.io.File file) throws SVNException
      Throws:
      SVNException
    • createNewFile

      public static boolean createNewFile(java.io.File file) throws java.io.IOException
      Throws:
      java.io.IOException
    • createFile

      public static void createFile(java.io.File file, java.lang.String contents, java.lang.String charSet) throws SVNException
      An internal method for ASCII bytes to write only!
      Parameters:
      file -
      contents -
      Throws:
      SVNException
    • writeToFile

      public static void writeToFile(java.io.File file, java.lang.String contents, java.lang.String charSet) throws SVNException
      Throws:
      SVNException
    • writeToFile

      public static void writeToFile(java.io.File file, byte[] contents) throws SVNException
      Throws:
      SVNException
    • writeVersionFile

      public static void writeVersionFile(java.io.File file, int version) throws SVNException
      Throws:
      SVNException
    • createUniqueFile

      public static java.io.File createUniqueFile(java.io.File parent, java.lang.String name, java.lang.String suffix, boolean useUUIDGenerator) throws SVNException
      Throws:
      SVNException
    • createUniqueDir

      public static java.io.File createUniqueDir(java.io.File parent, java.lang.String name, java.lang.String suffix, boolean useUUIDGenerator) throws SVNException
      Throws:
      SVNException
    • moveFile

      public static void moveFile(java.io.File src, java.io.File dst) throws SVNException
      Throws:
      SVNException
    • moveDir

      public static void moveDir(java.io.File src, java.io.File dst) throws SVNException
      Throws:
      SVNException
    • rename

      public static void rename(java.io.File src, java.io.File dst) throws SVNException
      Throws:
      SVNException
    • setReadonly

      public static boolean setReadonly(java.io.File file, boolean readonly)
    • setExecutable

      public static void setExecutable(java.io.File file, boolean executable)
    • symlinksSupported

      public static boolean symlinksSupported()
    • setSGID

      public static void setSGID(java.io.File dir)
    • resolveSymlinkToFile

      public static java.io.File resolveSymlinkToFile(java.io.File file)
    • resolveSymlink

      public static java.io.File resolveSymlink(java.io.File file)
    • copy

      public static void copy(java.io.File src, java.io.File dst, boolean safe, boolean copyAdminDirectories) throws SVNException
      Throws:
      SVNException
    • copyFile

      public static void copyFile(java.io.File src, java.io.File dst, boolean safe) throws SVNException
      Throws:
      SVNException
    • copyFile

      public static void copyFile(java.io.File src, java.io.File dst, boolean safe, boolean keepTimestamp) throws SVNException
      Throws:
      SVNException
    • setLastModified

      public static boolean setLastModified(java.io.File file, long timestamp)
    • createSymlink

      public static boolean createSymlink(java.io.File link, java.io.File linkName) throws SVNException
      Throws:
      SVNException
    • createSymlink

      public static boolean createSymlink(java.io.File link, java.lang.String linkName)
    • detranslateSymlink

      public static boolean detranslateSymlink(java.io.File src, java.io.File linkFile) throws SVNException
      Throws:
      SVNException
    • getSymlinkName

      public static java.lang.String getSymlinkName(java.io.File link)
    • copySymlink

      public static void copySymlink(java.io.File source, java.io.File target) throws SVNException
      Throws:
      SVNException
    • computeChecksum

      public static java.lang.String computeChecksum(java.lang.String line)
    • computeChecksum

      public static java.lang.String computeChecksum(java.io.File file) throws SVNException
      Throws:
      SVNException
    • compareFiles

      public static boolean compareFiles(java.io.File f1, java.io.File f2, java.security.MessageDigest digest) throws SVNException
      Throws:
      SVNException
    • truncate

      public static void truncate(java.io.File file, long truncateToSize) throws java.io.IOException
      Throws:
      java.io.IOException
    • setHidden

      public static void setHidden(java.io.File file, boolean hidden)
    • deleteAll

      public static void deleteAll(java.io.File dir, ISVNEventHandler cancelBaton) throws SVNException
      Throws:
      SVNException
    • deleteAll

      public static void deleteAll(java.io.File dir, boolean deleteDirs)
    • deleteAll

      public static void deleteAll(java.io.File dir, boolean deleteDirs, ISVNCanceller cancelBaton) throws SVNException
      Throws:
      SVNException
    • deleteFile

      public static boolean deleteFile(java.io.File file) throws SVNException
      Throws:
      SVNException
    • toHexDigest

      public static java.lang.String toHexDigest(java.security.MessageDigest digest)
    • toHexDigest

      public static java.lang.String toHexDigest(byte[] digest)
    • fromHexDigest

      public static byte[] fromHexDigest(java.lang.String hexDigest)
    • getNativeEOLMarker

      public static java.lang.String getNativeEOLMarker(ISVNOptions options)
    • roundTimeStamp

      public static long roundTimeStamp(long tstamp)
    • sleepForTimestamp

      public static void sleepForTimestamp()
    • setSleepForTimestamp

      public static void setSleepForTimestamp(boolean sleep)
    • readLineFromStream

      public static java.lang.String readLineFromStream(java.io.InputStream is, java.lang.StringBuffer buffer, java.nio.charset.CharsetDecoder decoder) throws java.io.IOException
      Throws:
      java.io.IOException
    • detectMimeType

      public static java.lang.String detectMimeType(java.io.InputStream is) throws java.io.IOException
      Throws:
      java.io.IOException
    • detectMimeType

      public static java.lang.String detectMimeType(java.io.File file, java.util.Map<java.lang.String,java.lang.String> mimeTypes) throws SVNException
      Throws:
      SVNException
    • isExecutable

      public static boolean isExecutable(java.io.File file) throws SVNException
      Throws:
      SVNException
    • ensureDirectoryExists

      public static java.io.File ensureDirectoryExists(java.io.File path) throws SVNException
      Throws:
      SVNException
    • copyDirectory

      public static void copyDirectory(java.io.File srcDir, java.io.File dstDir, boolean copyAdminDir, ISVNEventHandler cancel) throws SVNException
      Throws:
      SVNException
    • openFileForWriting

      public static java.io.OutputStream openFileForWriting(java.io.File file) throws SVNException
      Throws:
      SVNException
    • openFileForWriting

      public static java.io.OutputStream openFileForWriting(java.io.File file, boolean append) throws SVNException
      Throws:
      SVNException
    • createFileOutputStream

      public static java.io.FileOutputStream createFileOutputStream(java.io.File file, boolean append) throws java.io.IOException
      Throws:
      java.io.IOException
    • openRAFileForWriting

      public static java.io.RandomAccessFile openRAFileForWriting(java.io.File file, boolean append) throws SVNException
      Throws:
      SVNException
    • openFileForReading

      public static java.io.InputStream openFileForReading(java.io.File file) throws SVNException
      Throws:
      SVNException
    • openFileForReading

      public static java.io.InputStream openFileForReading(java.io.File file, SVNLogType logType) throws SVNException
      Throws:
      SVNException
    • openFileForReading

      public static java.io.InputStream openFileForReading(java.io.File file, java.util.logging.Level logLevel, SVNLogType logType) throws SVNException
      Throws:
      SVNException
    • createFileInputStream

      public static java.io.FileInputStream createFileInputStream(java.io.File file) throws java.io.IOException
      Throws:
      java.io.IOException
    • openRAFileForReading

      public static java.io.RandomAccessFile openRAFileForReading(java.io.File file) throws SVNException
      Throws:
      SVNException
    • closeFile

      public static void closeFile(java.io.InputStream is)
    • closeFile

      public static void closeFile(ISVNInputFile inFile)
    • closeFile

      public static void closeFile(java.io.OutputStream os)
    • closeFile

      public static void closeFile(java.io.RandomAccessFile raf)
    • execCommand

      public static java.lang.String execCommand(java.lang.String[] commandLine) throws SVNException
      Throws:
      SVNException
    • execCommand

      public static java.lang.String execCommand(java.lang.String[] commandLine, boolean waitAfterRead, ISVNReturnValueCallback callback) throws SVNException
      Throws:
      SVNException
    • execCommand

      public static java.lang.String execCommand(java.lang.String[] commandLine, java.lang.String[] env, boolean waitAfterRead, ISVNReturnValueCallback callback) throws SVNException
      Throws:
      SVNException
    • closeFile

      public static void closeFile(java.io.Writer os)
    • closeFile

      public static void closeFile(java.io.Reader is)
    • getAdminDirectoryName

      public static java.lang.String getAdminDirectoryName()
    • setAdminDirectoryName

      public static void setAdminDirectoryName(java.lang.String name)
    • getApplicationDataPath

      public static java.io.File getApplicationDataPath()
    • getSystemApplicationDataPath

      public static java.io.File getSystemApplicationDataPath()
    • getEnvironmentVariable

      public static java.lang.String getEnvironmentVariable(java.lang.String name)
    • setTestEnvironment

      public static void setTestEnvironment(java.lang.String editor, java.lang.String mergeTool, java.lang.String function)
    • getTestEnvironment

      public static java.lang.String[] getTestEnvironment()
    • getEnvironment

      public static java.util.Properties getEnvironment() throws java.lang.Throwable
      Throws:
      java.lang.Throwable
    • createTempDirectory

      public static java.io.File createTempDirectory(java.lang.String name) throws SVNException
      Throws:
      SVNException
    • createTempFile

      public static java.io.File createTempFile(java.lang.String prefix, java.lang.String suffix) throws SVNException
      Throws:
      SVNException
    • getSystemConfigurationDirectory

      public static java.io.File getSystemConfigurationDirectory()
    • readSingleLine

      public static java.lang.String readSingleLine(java.io.File file) throws java.io.IOException
      Throws:
      java.io.IOException
    • decode

      private static java.lang.String decode(java.nio.charset.CharsetDecoder decoder, byte[] in)
    • getCurrentUser

      public static java.lang.String getCurrentUser() throws SVNException
      Throws:
      SVNException
    • getCurrentGroup

      public static java.lang.String getCurrentGroup() throws SVNException
      Throws:
      SVNException
    • isHex

      private static boolean isHex(char ch)
    • isAbsolute

      public static boolean isAbsolute(java.io.File path)
    • getFilePath

      public static java.lang.String getFilePath(java.io.File file)
    • getFileName

      public static java.lang.String getFileName(java.io.File file)
    • getFileDir

      public static java.io.File getFileDir(java.io.File file)
    • createFilePath

      public static java.io.File createFilePath(java.lang.String path)
    • createFilePath

      public static java.io.File createFilePath(java.io.File parent, java.io.File child)
    • createFilePath

      public static java.io.File createFilePath(java.io.File parent, java.lang.String child)
    • createFilePath

      public static java.io.File createFilePath(java.lang.String parent, java.lang.String child)
    • skipAncestor

      public static java.io.File skipAncestor(java.io.File parent, java.io.File child)
    • getFileExtension

      public static java.lang.String getFileExtension(java.io.File path)
    • getFileNameExtension

      public static java.lang.String getFileNameExtension(java.lang.String name)
    • compare

      public static boolean compare(java.io.InputStream is, java.io.InputStream old)
    • readSymlink

      public static java.io.InputStream readSymlink(java.io.File link) throws SVNException
      Throws:
      SVNException
    • getFileLength

      public static long getFileLength(java.io.File file)
    • getFileLastModified

      public static long getFileLastModified(java.io.File file)
    • setFileLastModifiedMicros

      public static void setFileLastModifiedMicros(java.io.File file, long timeInMicros)
    • getFileLastModifiedMicros

      public static long getFileLastModifiedMicros(java.io.File file)