类 ConcurrentDiskUtil
- java.lang.Object
-
- com.alibaba.nacos.client.config.utils.ConcurrentDiskUtil
-
public class ConcurrentDiskUtil extends java.lang.Objectconcurrent disk util;op file with file lock.- 作者:
- configCenter
-
-
字段概要
字段 修饰符和类型 字段 说明 private static org.slf4j.LoggerLOGGERprivate static java.lang.StringREAD_ONLYprivate static java.lang.StringREAD_WRITE(专用程序包) static intRETRY_COUNT(专用程序包) static intSLEEP_BASETIMEms.
-
构造器概要
构造器 构造器 说明 ConcurrentDiskUtil()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static java.lang.StringbyteBufferToString(java.nio.ByteBuffer buffer, java.lang.String charsetName)transfer ByteBuffer to String.static java.lang.StringgetFileContent(java.io.File file, java.lang.String charsetName)get file content.static java.lang.StringgetFileContent(java.lang.String path, java.lang.String charsetName)get file content.private static voidsleep(int time)static java.lang.BooleanwriteFileContent(java.io.File file, java.lang.String content, java.lang.String charsetName)write file content.static java.lang.BooleanwriteFileContent(java.lang.String path, java.lang.String content, java.lang.String charsetName)write file content.
-
-
-
字段详细资料
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
RETRY_COUNT
static final int RETRY_COUNT
- 另请参阅:
- 常量字段值
-
SLEEP_BASETIME
static final int SLEEP_BASETIME
ms.- 另请参阅:
- 常量字段值
-
READ_ONLY
private static final java.lang.String READ_ONLY
- 另请参阅:
- 常量字段值
-
READ_WRITE
private static final java.lang.String READ_WRITE
- 另请参阅:
- 常量字段值
-
-
方法详细资料
-
getFileContent
public static java.lang.String getFileContent(java.lang.String path, java.lang.String charsetName) throws java.io.IOExceptionget file content.- 参数:
path- file pathcharsetName- charsetName- 返回:
- content
- 抛出:
java.io.IOException- IOException
-
getFileContent
public static java.lang.String getFileContent(java.io.File file, java.lang.String charsetName) throws java.io.IOExceptionget file content.- 参数:
file- filecharsetName- charsetName- 返回:
- content
- 抛出:
java.io.IOException- IOException
-
writeFileContent
public static java.lang.Boolean writeFileContent(java.lang.String path, java.lang.String content, java.lang.String charsetName) throws java.io.IOExceptionwrite file content.- 参数:
path- file pathcontent- contentcharsetName- charsetName- 返回:
- whether write ok
- 抛出:
java.io.IOException- IOException
-
writeFileContent
public static java.lang.Boolean writeFileContent(java.io.File file, java.lang.String content, java.lang.String charsetName) throws java.io.IOExceptionwrite file content.- 参数:
file- filecontent- contentcharsetName- charsetName- 返回:
- whether write ok
- 抛出:
java.io.IOException- IOException
-
byteBufferToString
public static java.lang.String byteBufferToString(java.nio.ByteBuffer buffer, java.lang.String charsetName) throws java.io.IOExceptiontransfer ByteBuffer to String.- 参数:
buffer- buffercharsetName- charsetName- 返回:
- String
- 抛出:
java.io.IOException- IOException
-
sleep
private static void sleep(int time)
-
-