public class NFS
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
NFS.OpenMode
The different modes of opening a file in NFS
|
Constructor and Description |
---|
NFS(net.maidsafe.api.AppHandle appHandle) |
Modifier and Type | Method and Description |
---|---|
java.util.concurrent.CompletableFuture<java.lang.Long> |
deleteFile(MDataInfo parentInfo,
java.lang.String fileName,
long version)
Deletes a file that exists on the network
|
java.util.concurrent.CompletableFuture<File> |
fileClose(NativeHandle fileContextHandle)
Write the content to the network and close the file.
|
java.util.concurrent.CompletableFuture<NativeHandle> |
fileOpen(MDataInfo parentInfo,
File file,
NFS.OpenMode openMode)
Open a file for reading or writing
|
java.util.concurrent.CompletableFuture<byte[]> |
fileRead(NativeHandle fileContextHandle,
long position,
long length)
Read the data from a file
|
java.util.concurrent.CompletableFuture |
fileWrite(NativeHandle fileContextHandle,
byte[] data)
Write data to a file
|
java.util.concurrent.CompletableFuture<NFSFileMetadata> |
getFileMetadata(MDataInfo parentInfo,
java.lang.String fileName)
Get the metadata for the requested file
|
java.util.concurrent.CompletableFuture<java.lang.Long> |
getSize(NativeHandle fileContextHandle)
Get the size of a file that has been opened
|
java.util.concurrent.CompletableFuture |
insertFile(MDataInfo parentInfo,
java.lang.String fileName,
File file)
Insert the file into the underlying Mutable Data.
|
java.util.concurrent.CompletableFuture<java.lang.Long> |
updateFile(MDataInfo parentInfo,
java.lang.String fileName,
File file,
long version)
Update an existing file on the network.
|
public java.util.concurrent.CompletableFuture<NFSFileMetadata> getFileMetadata(MDataInfo parentInfo, java.lang.String fileName)
parentInfo
- Parent Mutable Data info as MDataInfo
fileName
- File nameNFSFileMetadata
public java.util.concurrent.CompletableFuture insertFile(MDataInfo parentInfo, java.lang.String fileName, File file)
parentInfo
- Parent Mutable Data infofileName
- File namefile
- File to be insertedpublic java.util.concurrent.CompletableFuture<java.lang.Long> updateFile(MDataInfo parentInfo, java.lang.String fileName, File file, long version)
parentInfo
- Parent Mutable Data infofileName
- File namefile
- The updated file to be storedversion
- The next version of the filepublic java.util.concurrent.CompletableFuture<java.lang.Long> deleteFile(MDataInfo parentInfo, java.lang.String fileName, long version)
parentInfo
- Parent Mutable Data infofileName
- File nameversion
- The next version of the filepublic java.util.concurrent.CompletableFuture<NativeHandle> fileOpen(MDataInfo parentInfo, File file, NFS.OpenMode openMode)
parentInfo
- Parent Mutable Data infofile
- File objectopenMode
- File opening modeNativeHandle
public java.util.concurrent.CompletableFuture<java.lang.Long> getSize(NativeHandle fileContextHandle)
fileContextHandle
- File handle as NativeHandle
public java.util.concurrent.CompletableFuture<byte[]> fileRead(NativeHandle fileContextHandle, long position, long length)
fileContextHandle
- File handle as NativeHandle
position
- Start positionlength
- Length of the data to be readpublic java.util.concurrent.CompletableFuture fileWrite(NativeHandle fileContextHandle, byte[] data)
fileContextHandle
- File handle as NativeHandle
data
- Data to be writtenpublic java.util.concurrent.CompletableFuture<File> fileClose(NativeHandle fileContextHandle)
fileContextHandle
- File handle as NativeHandle