Interface IOUtils
public interface IOUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Set<StandardOpenOption> static final byte[]static final UUIDstatic final Set<StandardOpenOption> -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic ByteBufferallocateTempBuffer(int maxBufferSize, long fileSize) static ByteBufferallocateTempBuffer(Path file) static voidappendBytes(Path path, ByteBuffer buf, long remainingBytes) static voidclearDirectory(Path dir) static voiddeleteRecursively(Path dir) static byte[]digest(String algorithm, Path file, long size, @Nullable LongConsumer callback) static StringgetAttribute(Path file, String attribute) static @Nullable ByteBuffergetAttributeBuffer(Path file, String attribute) static @Nullable byte[]getAttributeBytes(Path file, String attribute) static @Nullable InstantgetCreatedTime(Path path) static @Nullable InstantgetLastAccessedTime(Path path) static @Nullable InstantgetLastModifiedTime(Path path) static longstatic MessageDigeststatic MessageDigestmd5()static FileSystemstatic FileSystempathEndsWith(String suffix) platformCopy(String from, String to) static voidrunUnmodified(Path path, PathOperation operation) static booleansetAttribute(Path file, String attribute, String value) static booleansetAttributeBuffer(Path file, String attribute, ByteBuffer value) static booleansetAttributeBytes(Path file, String attribute, byte[] value) static byte[]toByteArray(io.netty.buffer.ByteBuf buf, boolean release) static ByteBuffertoDirect(ByteBuffer buffer) static voidwriteBytes(Path path, ByteBuffer buf, long remainingBytes)
-
Field Details
-
NIL_UUID
-
WRITE_OPEN_OPTIONS
-
APPEND_OPEN_OPTIONS
-
EMPTY_BYTE_ARRAY
static final byte[] EMPTY_BYTE_ARRAY
-
-
Method Details
-
getSize
-
getCreatedTime
-
getLastModifiedTime
-
getLastAccessedTime
-
runUnmodified
- Throws:
IOException
-
deleteRecursively
- Throws:
IOException
-
clearDirectory
- Throws:
IOException
-
toByteArray
static byte[] toByteArray(io.netty.buffer.ByteBuf buf, boolean release) -
writeBytes
- Throws:
IOException
-
appendBytes
- Throws:
IOException
-
allocateTempBuffer
-
allocateTempBuffer
- Throws:
IOException
-
md
-
md5
-
digest
static byte[] digest(String algorithm, Path file, long size, @Nullable @Nullable LongConsumer callback) throws IOException - Throws:
IOException
-
getAttributeBuffer
@Nullable static @Nullable ByteBuffer getAttributeBuffer(Path file, String attribute) throws IOException - Throws:
IOException
-
getAttribute
- Throws:
IOException
-
getAttributeBytes
- Throws:
IOException
-
setAttributeBuffer
- Throws:
IOException
-
setAttribute
- Throws:
IOException
-
setAttributeBytes
- Throws:
IOException
-
pathEndsWith
-
openAsZip
- Throws:
IOException
-
openAsZip
- Throws:
IOException
-
platformCopy
-
toDirect
-